[vlc-devel] [PATCH 0/3] Bug when converting with both deinterlace checked and codec options
Jérôme Froissart
software at froissart.eu
Thu Sep 19 22:44:51 CEST 2019
Hi,
When converting a video, an MRL is poorly handled.
When the user checks the "deinterlace" statement, convert.cpp inserts this
statement after removing closing braces to the MRL (using "mrl.remove( '}'
);").
This causes issues in case the passed mrl already contains closing braces
(which is the case when the selected profile has custom video codec
options).
A quick-and-dirty fix would be to remove only the latest brace before
inserting the "deinterlace" statement, but, well...that would be
quick-and-dirty.
I rather send you a more object-oriented implementation of SoutMrl, that
avoids problems because it better handles "modules" and "options" within
SoutMrls.
The first and second patches are drop-in replacement for the current
implementation.
Then the thirs patch actually fixes the bug.
To reproduce the bug:
* open VLC, then "Open capture device" (I am not using the English version,
my description can be slightly wrong)
* Choose whatever source you want, e.g. screen
* Choose "convert"
* Choose a profile, and edit it. In the "video codec" tab, add a custom
argument (e.g. "preset=faster", which makes sense with the x264 codec)
* Start the process. VLC will fail because the MRL will lack a closing
brace.
You can see the MRL in the "messages" dialog.
Without my patch, the MRL may look like
sout=#transcode{vcodec=MJPG,venc=x264{preset=faster,scale=Auto,acodec=mp4a,ab=128,channels=1,samplerate=44100,scodec=none,deinterlace}:std{access=file{no-overwrite},mux=mp4,dst='/path/to/output.mp4'}
whereas my patch correctly handles the closing brace
Sorry, I did not know what to put in the .hpp header, I could have
copied/pasted the GPL license, but I do not know how to properly set the
copyright. Maybe you'll know this better than I do.
These patches can be applied (almost painlessly) to the 3.0.8 branch (there
may only be slight issues with a Makefile.am and a convert.cpp that was
slightly changed)
Jérôme Froissart (3):
Re-implemented SoutMrl in a more object-oriented way
Additions to the new SoutMrl implementation
Deinterlace can be associated with codec arguments
modules/gui/qt/Makefile.am | 1 +
.../qt/components/sout/profile_selector.cpp | 80 +++++-----
.../qt/components/sout/profile_selector.hpp | 5 +-
.../gui/qt/components/sout/sout_widgets.cpp | 1 +
modules/gui/qt/dialogs/convert.cpp | 37 +++--
modules/gui/qt/dialogs/sout.cpp | 4 +-
modules/gui/qt/dialogs/sout.hpp | 71 +--------
modules/gui/qt/util/soutmrl.cpp | 86 +++++++++++
modules/gui/qt/util/soutmrl.hpp | 145 ++++++++++++++++++
9 files changed, 301 insertions(+), 129 deletions(-)
create mode 100644 modules/gui/qt/util/soutmrl.cpp
create mode 100644 modules/gui/qt/util/soutmrl.hpp
--
2.20.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190919/2d350e0a/attachment.html>
More information about the vlc-devel
mailing list