<div dir="ltr">Hi,<br><br>When converting a video, an MRL is poorly handled.<br>When the user checks the "deinterlace" statement, convert.cpp inserts this statement after removing closing braces to the MRL (using "mrl.remove( '}' );").<br>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).<br>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.<br><br>I rather send you a more object-oriented implementation of SoutMrl, that avoids problems because it better handles "modules" and "options" within SoutMrls.<br>The first and second patches are drop-in replacement for the current implementation.<br>Then the thirs patch actually fixes the bug.<br><br>To reproduce the bug:<br>* open VLC, then "Open capture device" (I am not using the English version, my description can be slightly wrong)<br>* Choose whatever source you want, e.g. screen<br>* Choose "convert"<br>* 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)<br>* Start the process. VLC will fail because the MRL will lack a closing brace.<br>  You can see the MRL in the "messages" dialog.<br>  Without my patch, the MRL may look like<br>  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'}<br>  whereas my patch correctly handles the closing brace<br><br><br>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.<br><br>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)<br><br><br>Jérôme Froissart (3):<br>  Re-implemented SoutMrl in a more object-oriented way<br>  Additions to the new SoutMrl implementation<br>  Deinterlace can be associated with codec arguments<br><br> modules/gui/qt/Makefile.am                    |   1 +<br> .../qt/components/sout/profile_selector.cpp   |  80 +++++-----<br> .../qt/components/sout/profile_selector.hpp   |   5 +-<br> .../gui/qt/components/sout/sout_widgets.cpp   |   1 +<br> modules/gui/qt/dialogs/convert.cpp            |  37 +++--<br> modules/gui/qt/dialogs/sout.cpp               |   4 +-<br> modules/gui/qt/dialogs/sout.hpp               |  71 +--------<br> modules/gui/qt/util/soutmrl.cpp               |  86 +++++++++++<br> modules/gui/qt/util/soutmrl.hpp               | 145 ++++++++++++++++++<br> 9 files changed, 301 insertions(+), 129 deletions(-)<br> create mode 100644 modules/gui/qt/util/soutmrl.cpp<br> create mode 100644 modules/gui/qt/util/soutmrl.hpp<br><br>--<br>2.20.1<br><br></div>