[FFmpeg-devel] [PATCH 2/2] cmdutils: add show_help_protocol for get protocol options

Gyan ffmpeg at gyani.pro
Fri Nov 22 11:47:31 EET 2019



On 22-11-2019 03:08 pm, Steven Liu wrote:
>
>> 在 2019年11月22日,17:30,Gyan <ffmpeg at gyani.pro> 写道:
>>
>>
>>
>> On 22-11-2019 02:26 pm, Steven Liu wrote:
>>> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
>>> ---
>>>   fftools/cmdutils.c | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>
>>> diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
>>> index 84f98b7c04..fe18093ce1 100644
>>> --- a/fftools/cmdutils.c
>>> +++ b/fftools/cmdutils.c
>>> @@ -1870,6 +1870,21 @@ static void show_help_demuxer(const char *name)
>>>           show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
>>>   }
>>>   +static void show_help_protocol(const char *name)
>>> +{
>>> +    const URLProtocol *proto = av_find_protocol_by_name(name);;
>>> +
>>> +    if (!proto) {
>>> +        av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
>>> +        return;
>>> +    }
>>> +
>>> +    printf("Protocol %s:\n", name);
>>> +
>>> +    if (proto->priv_data_class)
>>> +        show_help_children(proto->priv_data_class, AV_OPT_FLAG_DECODING_PARAM);
>>> +}
>> Protocols may be employed for output as well. Is there a separate option for those protocol options?
> after patch:
>
> liuqideMBP:dash liuqi$ ./ffmpeg -h protocol=rtmp
> ffmpeg version N-95813-g5353723f20 Copyright (c) 2000-2019 the FFmpeg developers
>    built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
>    configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2 --samples=fate-suite/ --enable-libopencv --enable-libopus
>    libavutil      56. 36.100 / 56. 36.100
>    libavcodec     58. 62.100 / 58. 62.100
>    libavformat    58. 35.101 / 58. 35.101
>    libavdevice    58.  9.101 / 58.  9.101
>    libavfilter     7. 66.100 /  7. 66.100
>    libswscale      5.  6.100 /  5.  6.100
>    libswresample   3.  6.100 /  3.  6.100
>    libpostproc    55.  6.100 / 55.  6.100
> Protocol rtmp:
> rtmp AVOptions:
>    -rtmp_app          <string>     ED........ Name of application to connect to on the RTMP server
>    -rtmp_buffer       <int>        ED........ Set buffer time in milliseconds. The default is 3000. (from 0 to INT_MAX) (default 3000)
>    -rtmp_conn         <string>     ED........ Append arbitrary AMF data to the Connect message
>    -rtmp_flashver     <string>     ED........ Version of the Flash plugin used to run the SWF player.
>    -rtmp_live         <int>        .D........ Specify that the media is a live stream. (from INT_MIN to INT_MAX) (default any)
>       any             -2           .D........ both
>       live            -1           .D........ live stream
>       recorded        0            .D........ recorded stream
>    -rtmp_pageurl      <string>     .D........ URL of the web page in which the media was embedded. By default no value will be sent.
>    -rtmp_playpath     <string>     ED........ Stream identifier to play or to publish
>    -rtmp_subscribe    <string>     .D........ Name of live stream to subscribe to. Defaults to rtmp_playpath.
>    -rtmp_swfhash      <binary>     .D........ SHA256 hash of the decompressed SWF file (32 bytes).
>    -rtmp_swfsize      <int>        .D........ Size of the decompressed SWF file, required for SWFVerification. (from 0 to INT_MAX) (default 0)
>    -rtmp_swfurl       <string>     ED........ URL of the SWF player. By default no value will be sent
>    -rtmp_swfverify    <string>     .D........ URL to player swf file, compute hash/size automatically.
>    -rtmp_tcurl        <string>     ED........ URL of the target stream. Defaults to proto://host[:port]/app.
>    -rtmp_listen       <int>        .D........ Listen for incoming rtmp connections (from INT_MIN to INT_MAX) (default 0)
>    -listen            <int>        .D........ Listen for incoming rtmp connections (from INT_MIN to INT_MAX) (default 0)
>    -timeout           <int>        .D........ Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies -rtmp_listen 1 (from INT_MIN to INT_MAX) (default -1)

-rtmp_flush_interval is missing since it's an output only option. Which 
command shows that field?

Gyan


More information about the ffmpeg-devel mailing list