[FFmpeg-devel] [PATCH 1/2] Add programs to ffprobe

Florent Tribouilloy ftriboui at smartjog.com
Wed Jul 24 17:56:16 CEST 2013


On 07/24/2013 04:56 PM, Stefano Sabatini wrote:
> On date Tuesday 2013-07-23 11:05:40 +0200, Florent Tribouilloy encoded:
>> Option -show_programs for ffprobe will sort the output by programs
>>
>> Signed-off-by: Florent Tribouilloy<florent.tribouilloy at smartjog.com>
>> ---
>>   doc/ffprobe.texi               |   14 ++++++--
>>   doc/ffprobe.xsd                |   26 ++++++++++++++
>>   ffprobe.c                      |   76 +++++++++++++++++++++++++++++++++++-----
>>   tests/ref/fate/ffprobe_compact |    2 +-
>>   tests/ref/fate/ffprobe_csv     |    2 +-
>>   tests/ref/fate/ffprobe_default |    1 +
>>   tests/ref/fate/ffprobe_flat    |    1 +
>>   tests/ref/fate/ffprobe_ini     |    1 +
>>   tests/ref/fate/ffprobe_json    |    1 +
>>   tests/ref/fate/ffprobe_xml     |    2 +-
>>   10 files changed, 112 insertions(+), 14 deletions(-)
>>
>> diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
>> index 38517a8..02cffbb 100644
>> --- a/doc/ffprobe.texi
>> +++ b/doc/ffprobe.texi
>> @@ -44,7 +44,8 @@ name (which may be shared by other sections), and an unique
>>   name. See the output of @option{sections}.
>>
>>   Metadata tags stored in the container or in the streams are recognized
>> -and printed in the corresponding "FORMAT" or "STREAM" section.
>> +and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM"
>> +section.
>>
>>   @c man end
>>
>> @@ -209,6 +210,13 @@ multimedia stream.
>>   Each media stream information is printed within a dedicated section
>>   with name "STREAM".
>>
>> + at item -show_programs
>> +Show information about programs and their streams contained in the input
>> +multimedia stream.
>> +
>> +Each media stream information is printed within a dedicated section
>> +with name "PROGRAM_STREAM".
>> +
>>   @item -show_chapters
>>   Show information about chapters stored in the format.
>>
>> @@ -279,8 +287,8 @@ keyN=valN
>>   [/SECTION]
>>   @end example
>>
>> -Metadata tags are printed as a line in the corresponding FORMAT or
>> -STREAM section, and are prefixed by the string "TAG:".
>> +Metadata tags are printed as a line in the corresponding FORMAT, STREAM or
>> +PROGRAM_STREAM section, and are prefixed by the string "TAG:".
>>
>>   A description of the accepted options follows.
>>
>> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
>> index bd890b1..5716c7f 100644
>> --- a/doc/ffprobe.xsd
>> +++ b/doc/ffprobe.xsd
>> @@ -11,6 +11,7 @@
>>               <xsd:element name="packets"  type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
>>               <xsd:element name="frames"   type="ffprobe:framesType"  minOccurs="0" maxOccurs="1" />
>>               <xsd:element name="streams"  type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
>> +<xsd:element name="programs" type="ffprobe:programsType" minOccurs="0" maxOccurs="1" />
>>               <xsd:element name="chapters" type="ffprobe:chaptersType" minOccurs="0" maxOccurs="1" />
>>               <xsd:element name="format"   type="ffprobe:formatType"  minOccurs="0" maxOccurs="1" />
>>               <xsd:element name="error"    type="ffprobe:errorType"   minOccurs="0" maxOccurs="1" />
>> @@ -87,6 +88,12 @@
>>           </xsd:sequence>
>>       </xsd:complexType>
>>
>> +<xsd:complexType name="programsType">
>> +<xsd:sequence>
>> +<xsd:element name="programs" type="ffprobe:programType" minOccurs="0" maxOccurs="unbounded"/>
>> +</xsd:sequence>
>> +</xsd:complexType>
>> +
>>       <xsd:complexType name="streamDispositionType">
>>         <xsd:attribute name="default"          type="xsd:int" use="required" />
>>         <xsd:attribute name="dub"              type="xsd:int" use="required" />
>> @@ -147,6 +154,25 @@
>>         <xsd:attribute name="nb_read_packets"  type="xsd:int"/>
>>       </xsd:complexType>
>>
>> +<xsd:complexType name="programType">
>> +<xsd:sequence>
>> +<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
>> +</xsd:sequence>
>> +
>> +<xsd:attribute name="program_id"           type="xsd:int" use="required"/>
>> +<xsd:attribute name="program_num"          type="xsd:int" use="required"/>
>> +<xsd:attribute name="nb_stream"            type="xsd:int" use="required"/>
>
>> +<xsd:attribute name="start_time"           type="xsd:int" use="required"/>
>> +<xsd:attribute name="end_time"             type="xsd:int" use="required"/>
>
> start/end_pts?
>
> I use xmllint to test compliance.
>
>> +<xsd:attribute name="pmt_pid"              type="xsd:int" use="required"/>
>> +<xsd:attribute name="pcr_pid"              type="xsd:int" use="required"/>
>
>> +<xsd:attribute name="pts_wrap_reference"   type="xsd:int" use="required"/>
>> +<xsd:attribute name="pts_wrap_behavior"    type="xsd:int" use="required"/>
>
> Need to be removed?
Oups, I forgot to update the documentation.
[...]

>> +    if (program->start_time != INT64_MIN) {
>> +        print_ts("start_pts", program->start_time);
>> +        print_time("start_time", program->start_time,&AV_TIME_BASE_Q);
>> +    }
>> +    if (program->end_time != INT64_MIN) {
>> +        print_ts("end_pts", program->end_time);
>> +        print_time("end_time", program->end_time,&AV_TIME_BASE_Q);
>> +    }
>
> usually times/PTSs are printed in case their value is !=
> AV_NOPTS_VALUE. Any reason to check on INT64_MIN instead?
No, I mixed two things, sorry.

-- 
Florent Tribouilloy
Intern at Smartjog


More information about the ffmpeg-devel mailing list