[FFmpeg-devel] [RFC] lavf/tee per-output stream selection

Nicolas George nicolas.george at normalesup.org
Sun Jul 21 23:23:59 CEST 2013


Le tridi 3 thermidor, an CCXXI, Stefano Sabatini a écrit :
> That said, assuming I would come with a patch to implement this, would
> you accept to integrate it into master?

Sure.

> Stream selection would operate at the muxing level, when mapping the
> input to the output (and thus it would be useful even when
> stream-copying). How could be this implemented through filter
> configuration, or in other words how would you use scripting to
> implement stream selection/mapping?

I had something like that in mind:

    f = graph.create_filter("demux", { file: input_file, streams: "all" });
    for (i = 0; i < f.nb_outputs; i++) {
	lang = f.outputs[i].get_meta("lang");
	if (lang == "fr" || lang == "en") {
	    var w = graph.create_filter("mux",
		{ file: "out-" + lang + ".ogg", streams: "a" });
	    f.outputs[i].connect(w.inputs[0]);
	} else {
	    f.outputs[i].close();
	}
    }
    graph.run();

Since the filters are inited immediately, the information about what streams
can be read in a movie/demuxer source is available to build the rest of the
filter graph.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130721/6c1ff7fe/attachment.asc>


More information about the ffmpeg-devel mailing list