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

2019-11-26 Thread Steven Liu
Signed-off-by: Steven Liu 
---
 fftools/cmdutils.c   | 18 ++
 fftools/ffmpeg_opt.c |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 84f98b7c04..e0516296d5 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1870,6 +1870,22 @@ 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 AVClass *proto_class = av_urlcontext_get_class_by_name(name);
+
+printf("Protocol [%s]:\n"
+   " D. = Input supported\n"
+   " .E = Output supported\n"
+   " --\n", name);
+if (!proto_class) {
+av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
+return;
+}
+
+show_help_children(proto_class, AV_OPT_FLAG_DECODING_PARAM | 
AV_OPT_FLAG_ENCODING_PARAM);
+}
+
 static void show_help_muxer(const char *name)
 {
 const AVCodecDescriptor *desc;
@@ -2000,6 +2016,8 @@ int show_help(void *optctx, const char *opt, const char 
*arg)
 show_help_demuxer(par);
 } else if (!strcmp(topic, "muxer")) {
 show_help_muxer(par);
+} else if (!strcmp(topic, "protocol")) {
+show_help_protocol(par);
 #if CONFIG_AVFILTER
 } else if (!strcmp(topic, "filter")) {
 show_help_filter(par);
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 71063cc443..8d73fa8a78 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3194,7 +3194,7 @@ void show_help_default(const char *opt, const char *arg)
"-h  -- print basic options\n"
"-h long -- print more options\n"
"-h full -- print all options (including all format and codec 
specific options, very long)\n"
-   "-h type=name -- print all options for the named 
decoder/encoder/demuxer/muxer/filter/bsf\n"
+   "-h type=name -- print all options for the named 
decoder/encoder/demuxer/muxer/filter/bsf/protocol\n"
"See man %s for detailed description of the options.\n"
"\n", program_name);
 
-- 
2.15.1



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-11-22 Thread Steven Liu


> 在 2019年11月22日,17:47,Gyan  写道:
> 
> -rtmp_flush_interval is missing since it's an output only option. Which 
> command shows that field?

Ah get your point, thanks.

New patch will come.

Thanks
Steven





___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-11-22 Thread Gyan



On 22-11-2019 03:08 pm, Steven Liu wrote:



在 2019年11月22日,17:30,Gyan  写道:



On 22-11-2019 02:26 pm, Steven Liu wrote:

Signed-off-by: Steven Liu 
---
  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
   libavformat58. 35.101 / 58. 35.101
   libavdevice58.  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
   libpostproc55.  6.100 / 55.  6.100
Protocol rtmp:
rtmp AVOptions:
   -rtmp_app   ED Name of application to connect to 
on the RTMP server
   -rtmp_buffer   ED Set buffer time in milliseconds. 
The default is 3000. (from 0 to INT_MAX) (default 3000)
   -rtmp_conn  ED Append arbitrary AMF data to the 
Connect message
   -rtmp_flashver  ED Version of the Flash plugin used 
to run the SWF player.
   -rtmp_live .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
  recorded0.D recorded stream
   -rtmp_pageurl   .D URL of the web page in which the 
media was embedded. By default no value will be sent.
   -rtmp_playpath  ED Stream identifier to play or to 
publish
   -rtmp_subscribe .D Name of live stream to subscribe 
to. Defaults to rtmp_playpath.
   -rtmp_swfhash   .D SHA256 hash of the decompressed 
SWF file (32 bytes).
   -rtmp_swfsize  .D Size of the decompressed SWF 
file, required for SWFVerification. (from 0 to INT_MAX) (default 0)
   -rtmp_swfurlED URL of the SWF player. By default 
no value will be sent
   -rtmp_swfverify .D URL to player swf file, compute 
hash/size automatically.
   -rtmp_tcurl ED URL of the target stream. 
Defaults to proto://host[:port]/app.
   -rtmp_listen   .D Listen for incoming rtmp 
connections (from INT_MIN to INT_MAX) (default 0)
   -listen.D Listen for incoming rtmp 
connections (from INT_MIN to INT_MAX) (default 0)
   -timeout   .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
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-11-22 Thread Steven Liu


> 在 2019年11月22日,17:30,Gyan  写道:
> 
> 
> 
> On 22-11-2019 02:26 pm, Steven Liu wrote:
>> Signed-off-by: Steven Liu 
>> ---
>>  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
  libavformat58. 35.101 / 58. 35.101
  libavdevice58.  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
  libpostproc55.  6.100 / 55.  6.100
Protocol rtmp:
rtmp AVOptions:
  -rtmp_app   ED Name of application to connect to 
on the RTMP server
  -rtmp_buffer   ED Set buffer time in milliseconds. 
The default is 3000. (from 0 to INT_MAX) (default 3000)
  -rtmp_conn  ED Append arbitrary AMF data to the 
Connect message
  -rtmp_flashver  ED Version of the Flash plugin used 
to run the SWF player.
  -rtmp_live .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
 recorded0.D recorded stream
  -rtmp_pageurl   .D URL of the web page in which the 
media was embedded. By default no value will be sent.
  -rtmp_playpath  ED Stream identifier to play or to 
publish
  -rtmp_subscribe .D Name of live stream to subscribe 
to. Defaults to rtmp_playpath.
  -rtmp_swfhash   .D SHA256 hash of the decompressed 
SWF file (32 bytes).
  -rtmp_swfsize  .D Size of the decompressed SWF file, 
required for SWFVerification. (from 0 to INT_MAX) (default 0)
  -rtmp_swfurlED URL of the SWF player. By default 
no value will be sent
  -rtmp_swfverify .D URL to player swf file, compute 
hash/size automatically.
  -rtmp_tcurl ED URL of the target stream. Defaults 
to proto://host[:port]/app.
  -rtmp_listen   .D Listen for incoming rtmp 
connections (from INT_MIN to INT_MAX) (default 0)
  -listen.D Listen for incoming rtmp 
connections (from INT_MIN to INT_MAX) (default 0)
  -timeout   .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)


before patch:

liuqideMBP:dash liuqi$
liuqideMBP:dash liuqi$
liuqideMBP:dash liuqi$ ffmpeg -h protocol=rtmp
ffmpeg version N-95812-gd73f062706 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
  libavutil  56. 36.100 / 56. 36.100
  libavcodec 58. 62.100 / 58. 62.100
  libavformat58. 35.100 / 58. 35.100
  libavdevice58.  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
  libpostproc55.  6.100 / 55.  6.100
Unknown help option 'protocol'.
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] 
outfile}...

Getting help:
-h  -- print basic options
  

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

2019-11-22 Thread Gyan



On 22-11-2019 02:26 pm, Steven Liu wrote:

Signed-off-by: Steven Liu 
---
  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?



+
  static void show_help_muxer(const char *name)
  {
  const AVCodecDescriptor *desc;
@@ -2000,6 +2015,8 @@ int show_help(void *optctx, const char *opt, const char 
*arg)
  show_help_demuxer(par);
  } else if (!strcmp(topic, "muxer")) {
  show_help_muxer(par);
+} else if (!strcmp(topic, "protocol")) {
+show_help_protocol(par);
  #if CONFIG_AVFILTER
  } else if (!strcmp(topic, "filter")) {
  show_help_filter(par);


Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-11-22 Thread Steven Liu
Signed-off-by: Steven Liu 
---
 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);
+}
+
 static void show_help_muxer(const char *name)
 {
 const AVCodecDescriptor *desc;
@@ -2000,6 +2015,8 @@ int show_help(void *optctx, const char *opt, const char 
*arg)
 show_help_demuxer(par);
 } else if (!strcmp(topic, "muxer")) {
 show_help_muxer(par);
+} else if (!strcmp(topic, "protocol")) {
+show_help_protocol(par);
 #if CONFIG_AVFILTER
 } else if (!strcmp(topic, "filter")) {
 show_help_filter(par);
-- 
2.15.1



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".