[FFmpeg-devel] [PATCH] matroskadec: Export the MuxingApp element value as metadata
James Almer
jamrial at gmail.com
Mon Dec 2 00:19:00 CET 2013
On 01/12/13 6:52 PM, Michael Niedermayer wrote:
> On Sun, Dec 01, 2013 at 02:18:09PM -0300, James Almer wrote:
>> On 01/12/13 8:11 AM, Michael Niedermayer wrote:
>>> On Sun, Nov 24, 2013 at 05:31:48AM -0300, James Almer wrote:
>>>> Signed-off-by: James Almer <jamrial at gmail.com>
>>>> ---
>>>> libavformat/matroskadec.c | 4 +++-
>>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> this leaks the muxer app into the output file
>>>
>>> for example when transcoding to nut with -flags +bitexact but
>>> there are probably other cases too
>>
>> I'm not sure i follow. What difference does it make reading the value
>> for the "encoder" dict entry from MATROSKA_ID_MUXINGAPP instead of a
>> Tag as we're currently doing?
>>
>> I tried remuxing from a matroska file into nut with and without this
>> patch and every available dict entry in the mkv file was copied even
>> when using -flags +bitexact to mux the nut.
>> This patch doesn't really make any difference in that regard. It simply
>> sets a standard dict entry using the proper string present in every
>> matroska file.
>
> ./ffmpeg -i ~/videos/gg_moshidora01_sample.mkv -flags +bitexact test.nut
>
> before the patch:
> Input #0, nut, from 'test.nut':
> Duration: 00:00:20.93, start: 0.000000, bitrate: 899 kb/s
> Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 48k tbn, 48k tbc (default)
> Metadata:
> title : Moshidora - 01
> Stream #0:1(jpn): Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
> Metadata:
> title : Stereo AAC
>
>
> after the patch:
> Input #0, nut, from 'test2.nut':
> Metadata:
> encoder : libebml v1.0.0 + libmatroska v1.0.0
> Duration: 00:00:27.65, start: 0.000000, bitrate: 894 kb/s
> Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 48k tbn, 48k tbc (default)
> Metadata:
> title : Moshidora - 01
> Stream #0:1(jpn): Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
> Metadata:
> title : Stereo AAC
>
>
> the nut files are not generated with libebml nor with libmatroska
> the metadata is wrong
>
> If you wish to export this from the matroska demuxer you must ensure
> ffmpeg doesnt copy it blindly. Theres at least code to prevent
> copying "duration" already
I see now what you mean. How could this be prevented?
> also not sure "encoder" is the correct name for it
By default we set the "encoder" dict entry in every muxer with the lavformat version string.
Based on that, reading the value of the muxingapp element as dict entry "encoder" in this demuxer
is IMO correct.
I do however agree that it should not make its way into the output file.
More information about the ffmpeg-devel
mailing list