ffmpeg hang in background

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg hang in background

sailor-godkane
Hello,

I am using ffmpeg in a big project for video/audio automated processing.
Each project for processing requires lots of ffmpeg commands. Those commands
are run by a daemon written in ObjC using GnuStep.
Since it runs on the background i used -nostdin and -loglevel quiet for
production use.
To be sure i read everything on stdout and stderr to /dev/null but it should
not matter since the command does not output anything.
Everything run fine except sometimes a ffmpeg command will hang and i cannot
understand why.
Sometimes i can see a few % of cpu used by the commands but after hours it
was still there.
When it happens i have to shutdown my daemon and restart the processing. The
same command will then run fine and the process can be finished.

Details of ffmpeg (compiled from source)

ffmpeg version n4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.8 (SUSE Linux)
  configuration: --disable-programs --enable-ffprobe --enable-ffmpeg
--enable-libx264 --enable-gpl --enable-shared --enable-pthreads
--enable-libmp3lame --enable-pic
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100

System is :

openSUSE 13.1 - 3.11.10-29-desktop

The machine is a virtual one running on VMWare.

The command that most often hangs is

ffmpeg -nostdin -loglevel quiet -y -i front_slide_video.mov -an -r 16.000000
-c:v libx264 -preset slow -b:v 5000k -aspect 1.333333 -vf
scale=640:480,pad=640:480:0:0:black front_slide_video-rescaled.mov

But i had other commands hanging randomly as well so this is just a sample.

Since this is completely random i have no way of testing it. The command
that hang works fine if i run it manually and it runs fine most of the time
when the daemon runs it.
I upgraded from a version 2.X that was running on the previous major version
of my software. It's been a few years since i worked on it but i don't
recall hangs back in the day with version 2.

I had the same problem with 4.0.1 btw.

Thanks for your help




--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

Paul B Mahol
On 10/10/18, sailor-godkane <[hidden email]> wrote:

> Hello,
>
> I am using ffmpeg in a big project for video/audio automated processing.
> Each project for processing requires lots of ffmpeg commands. Those commands
> are run by a daemon written in ObjC using GnuStep.
> Since it runs on the background i used -nostdin and -loglevel quiet for
> production use.
> To be sure i read everything on stdout and stderr to /dev/null but it should
> not matter since the command does not output anything.
> Everything run fine except sometimes a ffmpeg command will hang and i cannot
> understand why.
> Sometimes i can see a few % of cpu used by the commands but after hours it
> was still there.
> When it happens i have to shutdown my daemon and restart the processing. The
> same command will then run fine and the process can be finished.
>
> Details of ffmpeg (compiled from source)
>
> ffmpeg version n4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
>   built with gcc 4.8 (SUSE Linux)
>   configuration: --disable-programs --enable-ffprobe --enable-ffmpeg
> --enable-libx264 --enable-gpl --enable-shared --enable-pthreads
> --enable-libmp3lame --enable-pic
>   libavutil      56. 14.100 / 56. 14.100
>   libavcodec     58. 18.100 / 58. 18.100
>   libavformat    58. 12.100 / 58. 12.100
>   libavdevice    58.  3.100 / 58.  3.100
>   libavfilter     7. 16.100 /  7. 16.100
>   libswscale      5.  1.100 /  5.  1.100
>   libswresample   3.  1.100 /  3.  1.100
>   libpostproc    55.  1.100 / 55.  1.100
>
> System is :
>
> openSUSE 13.1 - 3.11.10-29-desktop
>
> The machine is a virtual one running on VMWare.
>
> The command that most often hangs is
>
> ffmpeg -nostdin -loglevel quiet -y -i front_slide_video.mov -an -r 16.000000
> -c:v libx264 -preset slow -b:v 5000k -aspect 1.333333 -vf
> scale=640:480,pad=640:480:0:0:black front_slide_video-rescaled.mov

What if you do not use -r parameter but fps filter explicitly in filtergraph?

>
> But i had other commands hanging randomly as well so this is just a sample.
>
> Since this is completely random i have no way of testing it. The command
> that hang works fine if i run it manually and it runs fine most of the time
> when the daemon runs it.
> I upgraded from a version 2.X that was running on the previous major version
> of my software. It's been a few years since i worked on it but i don't
> recall hangs back in the day with version 2.
>
> I had the same problem with 4.0.1 btw.
>
> Thanks for your help
>
>
>
>
> --
> Sent from: http://www.ffmpeg-archive.org/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

DopeLabs
its not very well documented but ffmpeg has a daemon mode

ffmpeg -d <all your stuff> </dev/null &



> On Oct 10, 2018, at 6:56 46AM, Paul B Mahol <[hidden email]> wrote:
>
> On 10/10/18, sailor-godkane <[hidden email]> wrote:
>> Hello,
>>
>> I am using ffmpeg in a big project for video/audio automated processing.
>> Each project for processing requires lots of ffmpeg commands. Those commands
>> are run by a daemon written in ObjC using GnuStep.
>> Since it runs on the background i used -nostdin and -loglevel quiet for
>> production use.
>> To be sure i read everything on stdout and stderr to /dev/null but it should
>> not matter since the command does not output anything.
>> Everything run fine except sometimes a ffmpeg command will hang and i cannot
>> understand why.
>> Sometimes i can see a few % of cpu used by the commands but after hours it
>> was still there.
>> When it happens i have to shutdown my daemon and restart the processing. The
>> same command will then run fine and the process can be finished.
>>
>> Details of ffmpeg (compiled from source)
>>
>> ffmpeg version n4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
>>  built with gcc 4.8 (SUSE Linux)
>>  configuration: --disable-programs --enable-ffprobe --enable-ffmpeg
>> --enable-libx264 --enable-gpl --enable-shared --enable-pthreads
>> --enable-libmp3lame --enable-pic
>>  libavutil      56. 14.100 / 56. 14.100
>>  libavcodec     58. 18.100 / 58. 18.100
>>  libavformat    58. 12.100 / 58. 12.100
>>  libavdevice    58.  3.100 / 58.  3.100
>>  libavfilter     7. 16.100 /  7. 16.100
>>  libswscale      5.  1.100 /  5.  1.100
>>  libswresample   3.  1.100 /  3.  1.100
>>  libpostproc    55.  1.100 / 55.  1.100
>>
>> System is :
>>
>> openSUSE 13.1 - 3.11.10-29-desktop
>>
>> The machine is a virtual one running on VMWare.
>>
>> The command that most often hangs is
>>
>> ffmpeg -nostdin -loglevel quiet -y -i front_slide_video.mov -an -r 16.000000
>> -c:v libx264 -preset slow -b:v 5000k -aspect 1.333333 -vf
>> scale=640:480,pad=640:480:0:0:black front_slide_video-rescaled.mov
>
> What if you do not use -r parameter but fps filter explicitly in filtergraph?
>
>>
>> But i had other commands hanging randomly as well so this is just a sample.
>>
>> Since this is completely random i have no way of testing it. The command
>> that hang works fine if i run it manually and it runs fine most of the time
>> when the daemon runs it.
>> I upgraded from a version 2.X that was running on the previous major version
>> of my software. It's been a few years since i worked on it but i don't
>> recall hangs back in the day with version 2.
>>
>> I had the same problem with 4.0.1 btw.
>>
>> Thanks for your help
>>
>>
>>
>>
>> --
>> Sent from: http://www.ffmpeg-archive.org/
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

Micael Silva
In reply to this post by sailor-godkane
On Wed, Oct 10, 2018 at 10:37 AM sailor-godkane <[hidden email]> wrote:

> Hello,
>
> I am using ffmpeg in a big project for video/audio automated processing.
> Each project for processing requires lots of ffmpeg commands. Those
> commands
> are run by a daemon written in ObjC using GnuStep.
> Since it runs on the background i used -nostdin and -loglevel quiet for
> production use.
> To be sure i read everything on stdout and stderr to /dev/null but it
> should
> not matter since the command does not output anything.
> Everything run fine except sometimes a ffmpeg command will hang and i
> cannot
> understand why.
> Sometimes i can see a few % of cpu used by the commands but after hours it
> was still there.
> When it happens i have to shutdown my daemon and restart the processing.
> The
> same command will then run fine and the process can be finished.
>
> Details of ffmpeg (compiled from source)
>
> ffmpeg version n4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
>   built with gcc 4.8 (SUSE Linux)
>   configuration: --disable-programs --enable-ffprobe --enable-ffmpeg
> --enable-libx264 --enable-gpl --enable-shared --enable-pthreads
> --enable-libmp3lame --enable-pic
>   libavutil      56. 14.100 / 56. 14.100
>   libavcodec     58. 18.100 / 58. 18.100
>   libavformat    58. 12.100 / 58. 12.100
>   libavdevice    58.  3.100 / 58.  3.100
>   libavfilter     7. 16.100 /  7. 16.100
>   libswscale      5.  1.100 /  5.  1.100
>   libswresample   3.  1.100 /  3.  1.100
>   libpostproc    55.  1.100 / 55.  1.100
>
> System is :
>
> openSUSE 13.1 - 3.11.10-29-desktop
>
> The machine is a virtual one running on VMWare.
>
> The command that most often hangs is
>
> ffmpeg -nostdin -loglevel quiet -y -i front_slide_video.mov -an -r
> 16.000000
> -c:v libx264 -preset slow -b:v 5000k -aspect 1.333333 -vf
> scale=640:480,pad=640:480:0:0:black front_slide_video-rescaled.mov
>
> But i had other commands hanging randomly as well so this is just a sample.
>
> Since this is completely random i have no way of testing it. The command
> that hang works fine if i run it manually and it runs fine most of the time
> when the daemon runs it.
> I upgraded from a version 2.X that was running on the previous major
> version
> of my software. It's been a few years since i worked on it but i don't
> recall hangs back in the day with version 2.
>
> I had the same problem with 4.0.1 btw.
>
> Thanks for your help
>
>
I had similar problems since 4.0 version. I switched back to 3.4.4 and the
problem disapper.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

sailor-godkane
In reply to this post by Paul B Mahol
Could using -r with a filtergraph at the same time hang the command at
random?



--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

Paul B Mahol
On 10/16/18, sailor-godkane <[hidden email]> wrote:
> Could using -r with a filtergraph at the same time hang the command at
> random?
>

It could produce various weird effects.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

DopeLabs
In reply to this post by sailor-godkane
never happens to me and i have many processes that use -r running in the background 24/7

they all start with

ffmpeg -d -i

and end with

-f flv rtmp://host/app/stream  </dev/null &


> On Oct 16, 2018, at 3:16 16AM, sailor-godkane <[hidden email]> wrote:
>
> Could using -r with a filtergraph at the same time hang the command at
> random?
>
>
>
> --
> Sent from: http://www.ffmpeg-archive.org/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg hang in background

Paul B Mahol
On 10/16/18, DopeLabs <[hidden email]> wrote:

> never happens to me and i have many processes that use -r running in the
> background 24/7
>
> they all start with
>
> ffmpeg -d -i
>
> and end with
>
> -f flv rtmp://host/app/stream  </dev/null &

Do you use filtergraphs that change pts at all?

Try with loop filters and -r and you will get fancy effect.


>
>
>> On Oct 16, 2018, at 3:16 16AM, sailor-godkane <[hidden email]> wrote:
>>
>> Could using -r with a filtergraph at the same time hang the command at
>> random?
>>
>>
>>
>> --
>> Sent from: http://www.ffmpeg-archive.org/
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".