[FFmpeg-devel] [PATCH] ffmpeg: implement input file stream disabling

Gyan ffmpeg at gyani.pro
Wed Dec 12 21:50:22 EET 2018

On 13-12-2018 12:50 AM, Michael Niedermayer wrote:
> On Wed, Dec 12, 2018 at 10:25:46AM +0530, Gyan wrote:
>> On 12-12-2018 03:40 AM, Michael Niedermayer wrote:
>>> On Mon, Dec 10, 2018 at 08:57:44PM +0530, Gyan wrote:
>>>> At Michael's suggestion, this patch lets -vn/-an/-sn/-dn work for input
>>>> files. Individual streams can still be let through e.g.
>>>>      ffmpeg -an -discard:a:1 none -i file ...
>>>> will let (only) the 2nd audio stream be seen during stream selection and
>>>> filtergraph construction.
>>>> Thanks,
>>>> Gyan
>>>>   ffmpeg_filter.c |    7 +++++++
>>>>   ffmpeg_opt.c    |   17 +++++++++++++++++
>>>>   2 files changed, 24 insertions(+)
>>>> 212c7bcecbd62329f3f18893c71f464ebeee3b67  0001-ffmpeg-implement-input-file-stream-disabling.patch
>>>>  From 9823a71f2055f2c4c4484536291bbd2afee36a81 Mon Sep 17 00:00:00 2001
>>>> From: Gyan Doshi <ffmpeg at gyani.pro>
>>>> Date: Mon, 10 Dec 2018 20:38:20 +0530
>>>> Subject: [PATCH] ffmpeg: implement input file stream disabling
>>>> -vn/-an/-sn/-dn can be set to stop processing of streams
>>>> of said type from an input file.
>>> isnt this 2 seperate changes ?
>>> one is adding -vn/-an/-sn/-dn input support and the other is fixing some input
>>> discard issues related to existing -discard functionality
>> Only one change. I provided an example command syntax to show how to
>> selectively enable streams while leaving others of the same type disabled.
> You misunderstand me i think
> patches should be split in self contained changes.
> part of this patch adds support for -vn/-an/-sn/-dn
> and other parts are fixing bugs
> the patch for example adds a error check for disabled filter inputs
> using this example:
> ffmpeg -discard all  -i tests/data/asynth-44100-1.wav -i tests/data/asynth-44100-1.wav -filter_complex '[0:a][1:a]amerge=inputs=2[aout]' -map '[aout]'  -f framecrc -
> This newly added code triggers and prints
> "Stream specifier ':a' in filtergraph description [0:a][1:a]amerge=inputs=2[aout] matches a disabled input stream."
> before the patch the code did not error out.

Actually, I meant to catch and error out for scenarios like,

     ffmpeg -vn -i input -lavfi [0:v]filter output

Since there's only one variable to set discard state, it happens to 
error out your command as well. I didn't consider it a bug fix but as 
due diligence for this new 'feature'.

I can split this in two, if you like.

Anything else?


More information about the ffmpeg-devel mailing list