[FFmpeg-devel] [PATCH] Add programs to ffprobe

Florent Tribouilloy ftriboui at smartjog.com
Fri Jul 12 17:38:26 CEST 2013


On 07/12/2013 04:36 PM, Stefano Sabatini wrote:
> On date Friday 2013-07-12 11:30:38 +0200, Florent Tribouilloy encoded:
>> Hi,
>>
>> On 07/12/2013 09:08 AM, Stefano Sabatini wrote:
>>> On date Thursday 2013-07-11 11:29:01 +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>
>>>> ---
>>>>   ffprobe.c |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
>>>>   1 file changed, 58 insertions(+), 5 deletions(-)
>>>
>>> Missing doc/ffprobe.texi and ffprobe.xsd updates.
>> True :)
>> (Will do in next patch)
>>
>>>> +static void show_program(WriterContext *w, AVFormatContext *fmt_ctx, AVProgram *program)
>>>> +{
>>>> +    int i;
>>>> +
>>>> +    writer_print_section_header(w, SECTION_ID_PROGRAM);
>>>> +    print_int("program_id", program->id);
>>>
>>>> +    for (i = 0; i<   program->nb_stream_indexes; i++) {
>>>> +        if (selected_streams[program->stream_index[i]])
>>>> +            show_stream(w, fmt_ctx, program->stream_index[i]);
>>>> +    }
>>>
>>> I dislike reprinting entirely the stream section here. You can simply
>>> print the corresponding stream ID.
>
>> I understand your point but does it make sense to print the programs
>> with their datas and the their corresponding stream IDs.
>> Then, each stream with their datas.
>
> I don't understand if this is a question or a claim.
This is a question.

>> Does the program will be printed without the stream information?
>> Something like :
>>
>> programs:
>>     program:1:
>>          data program1
>>          program1_stream_id1
>>     end_program
>>     program:2:
>>          data program2
>>          program2_stream_id2
>>          program2_stream_id3
>>     end_program
>> programs
>> streams:
>>     stream:1:
>>          data stream1
>>     end_stream
>>     stream:2:
>>          data stream2
>>     end_stream
>>     stream:3:
>>          data stream3
>>     end_stream
>> streams
>
> Looks fine, I'm assuming we have one stream per program, but I may
> easily be wrong (I never dealt directly with "programs"), an example
> of a file with programs would be helpful.
http://xhq.me/m3u8/all.m3u8 (first found on Google with HLS programs)

>> ?
Question mark is here :)

>> Or directly print the streams section inside the program?
>> programs:
>>      program:1:
>>          data program1
>>          stream:1
>>              data stream1
>>          end_stream
>>      end_program
>>      program:2:
>>          data program2
>>          stream:2
>>              data stream2
>>          end_stream
>>          stream:3
>>              data stream3
>>          end_stream
>>      end_program
>> programs
>
> I like this less, because this requires to print program information
> in order to get stream data. But I think you want to print stream info
> in the streams section as well, in this case you have duplication,
> which is not necessarily bad since it would avoid a two-pass
> processing in case you need to extract the stream information related
> to a given program.
The final goal was to print only the programs section with the stream 
inside when we use the option -show_programs and print only the streams 
section with the stream inside when we use the option -show_streams.
(or both if we use all of them).
That's why I used the have_show_streams|programs in opt_show_##

-- 
Florent Tribouilloy
Intern at Smartjog


More information about the ffmpeg-devel mailing list