Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] ffmpeg: document -d option
@ 2022-04-03 15:27 Stefano Sabatini
  2022-04-03 17:44 ` Gyan Doshi
  2022-04-05  5:23 ` Anton Khirnov
  0 siblings, 2 replies; 7+ messages in thread
From: Stefano Sabatini @ 2022-04-03 15:27 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Stefano Sabatini

Option was added in commit 39aafa5ee90e10382e.

Fix trac issue: http://trac.ffmpeg.org/ticket/1698
---
 doc/ffmpeg.texi      | 12 ++++++++++++
 fftools/ffmpeg_opt.c |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 164419cad3..bf738da0c1 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -845,6 +845,18 @@ ffmpeg -dump_attachment:t "" -i INPUT
 Technical note -- attachments are implemented as codec extradata, so this
 option can actually be used to extract extradata from any stream, not just
 attachments.
+
+@item -d (@emph{global})
+
+Run ffmpeg in daemon mode. This options should be only specified as fist option,
+or it will be ignored, for example as:
+@example
+ffmpeg -d ...
+@end example
+
+This option disables log and detaches the @code{ffmpeg} process from the
+terminal.
+
 @end table
 
 @section Video Options
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 22c88287df..e3c93d1980 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -186,6 +186,7 @@ static int ignore_unknown_streams = 0;
 static int copy_unknown_streams = 0;
 static int recast_media = 0;
 static int find_stream_info = 1;
+static int daemon = 0;
 
 static void uninit_options(OptionsContext *o)
 {
@@ -3713,6 +3714,8 @@ const OptionDef options[] = {
     { "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT,
         { .off = OFFSET(bits_per_raw_sample) },
         "set the number of bits per raw sample", "number" },
+    { "d",             OPT_BOOL | OPT_EXPERT,                       { &daemon },
+        "run in daemon mode, can only be specified as first option" },
 
     /* video options */
     { "vframes",      OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_video_frames },
-- 
2.25.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-03 15:27 [FFmpeg-devel] [PATCH] ffmpeg: document -d option Stefano Sabatini
@ 2022-04-03 17:44 ` Gyan Doshi
  2022-04-05  5:23 ` Anton Khirnov
  1 sibling, 0 replies; 7+ messages in thread
From: Gyan Doshi @ 2022-04-03 17:44 UTC (permalink / raw)
  To: ffmpeg-devel



On 2022-04-03 08:57 pm, Stefano Sabatini wrote:
> Option was added in commit 39aafa5ee90e10382e.
>
> Fix trac issue: http://trac.ffmpeg.org/ticket/1698
> ---
>   doc/ffmpeg.texi      | 12 ++++++++++++
>   fftools/ffmpeg_opt.c |  3 +++
>   2 files changed, 15 insertions(+)
>
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 164419cad3..bf738da0c1 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -845,6 +845,18 @@ ffmpeg -dump_attachment:t "" -i INPUT
>   Technical note -- attachments are implemented as codec extradata, so this
>   option can actually be used to extract extradata from any stream, not just
>   attachments.
> +
> +@item -d (@emph{global})
> +
> +Run ffmpeg in daemon mode. This options should be only specified as fist option,

s/fist/first

> +or it will be ignored, for example as:
> +@example
> +ffmpeg -d ...
> +@end example
> +
> +This option disables log and detaches the @code{ffmpeg} process from the
> +terminal.
> +
>   @end table
>   
>   @section Video Options
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index 22c88287df..e3c93d1980 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -186,6 +186,7 @@ static int ignore_unknown_streams = 0;
>   static int copy_unknown_streams = 0;
>   static int recast_media = 0;
>   static int find_stream_info = 1;
> +static int daemon = 0;
>   
>   static void uninit_options(OptionsContext *o)
>   {
> @@ -3713,6 +3714,8 @@ const OptionDef options[] = {
>       { "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT,
>           { .off = OFFSET(bits_per_raw_sample) },
>           "set the number of bits per raw sample", "number" },
> +    { "d",             OPT_BOOL | OPT_EXPERT,                       { &daemon },
> +        "run in daemon mode, can only be specified as first option" },

If you're going to add this, might as well use the var instead of 
strcmp(argv[1]) and remove the positional constraint.

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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-03 15:27 [FFmpeg-devel] [PATCH] ffmpeg: document -d option Stefano Sabatini
  2022-04-03 17:44 ` Gyan Doshi
@ 2022-04-05  5:23 ` Anton Khirnov
  2022-04-05 21:27   ` Stefano Sabatini
  1 sibling, 1 reply; 7+ messages in thread
From: Anton Khirnov @ 2022-04-05  5:23 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Stefano Sabatini

Quoting Stefano Sabatini (2022-04-03 17:27:06)
> Option was added in commit 39aafa5ee90e10382e.
> 
> Fix trac issue: http://trac.ffmpeg.org/ticket/1698
> ---
>  doc/ffmpeg.texi      | 12 ++++++++++++
>  fftools/ffmpeg_opt.c |  3 +++
>  2 files changed, 15 insertions(+)

Does this option do anything useful? Shouldn't it rather be removed?

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-05  5:23 ` Anton Khirnov
@ 2022-04-05 21:27   ` Stefano Sabatini
  2022-04-06 14:43     ` Michael Niedermayer
  0 siblings, 1 reply; 7+ messages in thread
From: Stefano Sabatini @ 2022-04-05 21:27 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On date Tuesday 2022-04-05 07:23:27 +0200, Anton Khirnov wrote:
> Quoting Stefano Sabatini (2022-04-03 17:27:06)
> > Option was added in commit 39aafa5ee90e10382e.
> > 
> > Fix trac issue: http://trac.ffmpeg.org/ticket/1698
> > ---
> >  doc/ffmpeg.texi      | 12 ++++++++++++
> >  fftools/ffmpeg_opt.c |  3 +++
> >  2 files changed, 15 insertions(+)
> 
> Does this option do anything useful? Shouldn't it rather be removed?

Works for me.

Do we have a use case for this? This basically disables logs and
detaches ffmpeg from the terminal.

@Michael, can you comment about this (this was added by you)?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-05 21:27   ` Stefano Sabatini
@ 2022-04-06 14:43     ` Michael Niedermayer
  2022-04-07 22:37       ` Stefano Sabatini
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Niedermayer @ 2022-04-06 14:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1099 bytes --]

On Tue, Apr 05, 2022 at 11:27:08PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2022-04-05 07:23:27 +0200, Anton Khirnov wrote:
> > Quoting Stefano Sabatini (2022-04-03 17:27:06)
> > > Option was added in commit 39aafa5ee90e10382e.
> > > 
> > > Fix trac issue: http://trac.ffmpeg.org/ticket/1698
> > > ---
> > >  doc/ffmpeg.texi      | 12 ++++++++++++
> > >  fftools/ffmpeg_opt.c |  3 +++
> > >  2 files changed, 15 insertions(+)
> > 
> > Does this option do anything useful? Shouldn't it rather be removed?
> 
> Works for me.
> 
> Do we have a use case for this? This basically disables logs and
> detaches ffmpeg from the terminal.
> 
> @Michael, can you comment about this (this was added by you)?

i have a few udp&tcp tests that used it but i tried now and they work fine
if i remove it so iam not aware of a current use case

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-06 14:43     ` Michael Niedermayer
@ 2022-04-07 22:37       ` Stefano Sabatini
  2022-06-09 19:00         ` Marton Balint
  0 siblings, 1 reply; 7+ messages in thread
From: Stefano Sabatini @ 2022-04-07 22:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

On date Wednesday 2022-04-06 16:43:02 +0200, Michael Niedermayer wrote:
> On Tue, Apr 05, 2022 at 11:27:08PM +0200, Stefano Sabatini wrote:
> > On date Tuesday 2022-04-05 07:23:27 +0200, Anton Khirnov wrote:
> > > Quoting Stefano Sabatini (2022-04-03 17:27:06)
> > > > Option was added in commit 39aafa5ee90e10382e.
> > > > 
> > > > Fix trac issue: http://trac.ffmpeg.org/ticket/1698
> > > > ---
> > > >  doc/ffmpeg.texi      | 12 ++++++++++++
> > > >  fftools/ffmpeg_opt.c |  3 +++
> > > >  2 files changed, 15 insertions(+)
> > > 
> > > Does this option do anything useful? Shouldn't it rather be removed?
> > 
> > Works for me.
> > 
> > Do we have a use case for this? This basically disables logs and
> > detaches ffmpeg from the terminal.
> > 
> > @Michael, can you comment about this (this was added by you)?
> 
> i have a few udp&tcp tests that used it but i tried now and they work fine
> if i remove it so iam not aware of a current use case

Updated.

[-- Attachment #2: 0001-ffmpeg-drop-undocumented-d-option.patch --]
[-- Type: text/x-diff, Size: 2273 bytes --]

From d5a8c745a7d82f424cc013d9d4b4429aa8fa20e6 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini <stefasab@gmail.com>
Date: Sun, 3 Apr 2022 17:24:40 +0200
Subject: [PATCH] ffmpeg: drop undocumented -d option

Option was added in commit 39aafa5ee90e10382e but was never documented.

Also does not seem there are current use cases for it,
tests for which it was introduced are still working therefore we drop
it altogether.

Indirectly fix trac issue: http://trac.ffmpeg.org/ticket/1698
---
 Changelog        |  1 +
 fftools/ffmpeg.c | 12 ++----------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/Changelog b/Changelog
index e173d43229..5bae61bad5 100644
--- a/Changelog
+++ b/Changelog
@@ -7,6 +7,7 @@ version 5.1:
 - pcm-bluray encoder
 - DFPWM audio encoder/decoder and raw muxer/demuxer
 - SITI filter
+- drop ffmpeg -d option
 
 
 version 5.0:
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6d62bdc7b0..f82ba8a175 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -132,7 +132,6 @@ static BenchmarkTimeStamps get_benchmark_time_stamps(void);
 static int64_t getmaxrss(void);
 static int ifilter_has_all_input_formats(FilterGraph *fg);
 
-static int run_as_daemon  = 0;
 static int nb_frames_dup = 0;
 static unsigned dup_warning = 1000;
 static int nb_frames_drop = 0;
@@ -420,7 +419,7 @@ void term_init(void)
 #endif
 
 #if HAVE_TERMIOS_H
-    if (!run_as_daemon && stdin_interaction) {
+    if (stdin_interaction) {
         struct termios tty;
         if (tcgetattr (0, &tty) == 0) {
             oldtty = tty;
@@ -3854,7 +3853,7 @@ static int check_keyboard_interaction(int64_t cur_time)
     if (received_nb_signals)
         return AVERROR_EXIT;
     /* read_key() returns 0 on EOF */
-    if(cur_time - last_time >= 100000 && !run_as_daemon){
+    if (cur_time - last_time >= 100000) {
         key =  read_key();
         last_time = cur_time;
     }else
@@ -4864,13 +4863,6 @@ int main(int argc, char **argv)
     av_log_set_flags(AV_LOG_SKIP_REPEATED);
     parse_loglevel(argc, argv, options);
 
-    if(argc>1 && !strcmp(argv[1], "-d")){
-        run_as_daemon=1;
-        av_log_set_callback(log_callback_null);
-        argc--;
-        argv++;
-    }
-
 #if CONFIG_AVDEVICE
     avdevice_register_all();
 #endif
-- 
2.25.1


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] ffmpeg: document -d option
  2022-04-07 22:37       ` Stefano Sabatini
@ 2022-06-09 19:00         ` Marton Balint
  0 siblings, 0 replies; 7+ messages in thread
From: Marton Balint @ 2022-06-09 19:00 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Fri, 8 Apr 2022, Stefano Sabatini wrote:

> On date Wednesday 2022-04-06 16:43:02 +0200, Michael Niedermayer wrote:
>> On Tue, Apr 05, 2022 at 11:27:08PM +0200, Stefano Sabatini wrote:
>>> On date Tuesday 2022-04-05 07:23:27 +0200, Anton Khirnov wrote:
>>>> Quoting Stefano Sabatini (2022-04-03 17:27:06)
>>>>> Option was added in commit 39aafa5ee90e10382e.
>>>>>
>>>>> Fix trac issue: http://trac.ffmpeg.org/ticket/1698
>>>>> ---
>>>>>  doc/ffmpeg.texi      | 12 ++++++++++++
>>>>>  fftools/ffmpeg_opt.c |  3 +++
>>>>>  2 files changed, 15 insertions(+)
>>>>
>>>> Does this option do anything useful? Shouldn't it rather be removed?
>>>
>>> Works for me.
>>>
>>> Do we have a use case for this? This basically disables logs and
>>> detaches ffmpeg from the terminal.
>>>
>>> @Michael, can you comment about this (this was added by you)?
>>
>> i have a few udp&tcp tests that used it but i tried now and they work fine
>> if i remove it so iam not aware of a current use case
>
> Updated.
>

Will apply.

Thanks,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-09 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 15:27 [FFmpeg-devel] [PATCH] ffmpeg: document -d option Stefano Sabatini
2022-04-03 17:44 ` Gyan Doshi
2022-04-05  5:23 ` Anton Khirnov
2022-04-05 21:27   ` Stefano Sabatini
2022-04-06 14:43     ` Michael Niedermayer
2022-04-07 22:37       ` Stefano Sabatini
2022-06-09 19:00         ` Marton Balint

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git