[FFmpeg-devel] [PATCH] ffprobe: add stream_index to frame data

Dave Rice dave at dericed.com
Tue May 26 02:49:02 CEST 2015


> On May 14, 2015, at 3:53 AM, Stefano Sabatini <stefasab at gmail.com> wrote:
> 
> [...]
>> From c655acffb8d9acc97e19553c2e464c0d78586063 Mon Sep 17 00:00:00 2001
>> From: Dave Rice <dave at dericed.com>
>> Date: Wed, 13 May 2015 13:38:29 -0400
>> Subject: [PATCH] ffprobe: print stream_index with frame data
>> 
>> otherwise the frame data can't be associated back to its stream. This
>> makes it easier to work with data from multi-track outputs such as:
>> ffprobe -f lavfi
>> movie=1video_3audio.mov:s=v+a+a+a[out0][out1][out2][out3] -show_streams
>> -show_frames
>> ---
>> doc/ffprobe.xsd | 1 +
>> ffprobe.c       | 1 +
>> 2 files changed, 2 insertions(+)
>> 
>> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
>> index d473c9b..5e0f9a9 100644
>> --- a/doc/ffprobe.xsd
>> +++ b/doc/ffprobe.xsd
>> @@ -86,6 +86,7 @@
>>             <xsd:element name="side_data_list" type="ffprobe:frameSideDataListType"   minOccurs="0" maxOccurs="1" />
>>       </xsd:sequence>
>> 
>> +      <xsd:attribute name="stream_index"  type="xsd:int"/>
>>       <xsd:attribute name="media_type"    type="xsd:string" use="required"/>
>>       <xsd:attribute name="key_frame"     type="xsd:int"    use="required"/>
>>       <xsd:attribute name="pts"           type="xsd:long" />
>> diff --git a/ffprobe.c b/ffprobe.c
>> index fadcd93..8ee97f5 100644
>> --- a/ffprobe.c
>> +++ b/ffprobe.c
>> @@ -1822,6 +1822,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
>>     writer_print_section_header(w, SECTION_ID_FRAME);
>> 
>>     s = av_get_media_type_string(stream->codec->codec_type);
>> +    print_int ("stream_index",          stream->index);
>>     if (s) print_str    ("media_type", s);
>>     else   print_str_opt("media_type", "unknown");
> 
> Nit: maybe you should print this after the media_type, as in the case
> of packet.

Fixed.

> Note: you also need to update the fate ffprobe references, see the
> script in attachment (which I should probably commit).

Fixed. New patch is attached.
Dave Rice

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-print-stream_index-with-frame-data.patch
Type: application/octet-stream
Size: 50696 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150525/b0532e5e/attachment.obj>
-------------- next part --------------



More information about the ffmpeg-devel mailing list