Ffmpeg stopping at exactly 400 frames

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

Ffmpeg stopping at exactly 400 frames

David Ventura
Hi

I am trying to get ffmpeg to get a feed from a security camera an capture "motion only" - I have successfully done that when processing a recording, but whenever I capture from the stream it gets cut at exactly 400 frames:



while true; do

date;

ffmpeg -stats -loglevel error -re -i tcp://david-dotopc.labs:5001 -vf "select=gt(scene\,0.003),setpts=N/(20*TB)" -an -c:v libx264 -preset veryfast -t 20 -threads 0 -y $(date +"%Y%m%d-%H%M%S").mkv;

echo "";

sleep 15;

done


Mon Oct  1 22:30:52 CEST 2018                                                                             
frame=  400 fps=0.8 q=-1.0 Lsize=    4196kB time=00:00:19.85 bitrate=1731.5kbits/s speed=0.0375x
                                                                                               
Mon Oct  1 22:39:56 CEST 2018                                                                                                                                                                                                                                                                                               
frame=  400 fps=6.7 q=-1.0 Lsize=    4912kB time=00:00:19.85 bitrate=2027.0kbits/s speed=0.334x                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                            
Mon Oct  1 22:41:10 CEST 2018                                                                    
frame=  400 fps=2.6 q=-1.0 Lsize=    4501kB time=00:00:19.85 bitrate=1857.4kbits/s speed=0.127x 
                                                                                               
Mon Oct  1 22:44:02 CEST 2018                                                                   
frame=  400 fps=6.0 q=-1.0 Lsize=    3570kB time=00:00:19.85 bitrate=1473.4kbits/s speed=0.298x 
                                                                                               
Mon Oct  1 22:45:23 CEST 2018                                                                   
frame=  400 fps=4.5 q=-1.0 Lsize=    4353kB time=00:00:19.85 bitrate=1796.5kbits/s speed=0.223x 
                                                                                               
Mon Oct  1 22:47:07 CEST 2018                                                                   
frame=  400 fps=8.5 q=-1.0 Lsize=    4077kB time=00:00:19.85 bitrate=1682.3kbits/s speed=0.422x 
                                                                                               
Mon Oct  1 22:48:10 CEST 2018                                                                   
frame=  400 fps=9.5 q=-1.0 Lsize=    3797kB time=00:00:19.85 bitrate=1566.9kbits/s speed=0.471x                                            
                                                                                               
Mon Oct  1 22:49:07 CEST 2018                                                                        
frame=  400 fps=9.3 q=-1.0 Lsize=    4019kB time=00:00:19.85 bitrate=1658.5kbits/s speed=0.46x 
                                                                                              

...........



What is the problem with this? Why is it always stopping?



David

_______________________________________________
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 stopping at exactly 400 frames

Gyan Doshi
On Tue, Oct 2, 2018 at 7:12 PM David <[hidden email]> wrote:

>
>
> ffmpeg -stats -loglevel error -re -i tcp://david-dotopc.labs:5001 -vf
> "select=gt(scene\,0.003),setpts=N/(20*TB)" -an -c:v libx264 -preset
> veryfast -t 20 -threads 0 -y $(date +"%Y%m%d-%H%M%S").mkv;
>
> What is the problem with this? Why is it always stopping?
>

You are retiming frames to have a density of 20/s using setpts and stopping
execution using -t 20. Drop the latter option.

Gyan
_______________________________________________
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
|

unsubscribe

Andrew Grace
In reply to this post by David Ventura


> On Oct 2, 2018, at 9:41 AM, David <[hidden email]> wrote:
>
> Hi
>
> I am trying to get ffmpeg to get a feed from a security camera an capture "motion only" - I have successfully done that when processing a recording, but whenever I capture from the stream it gets cut at exactly 400 frames:
>
>
>
> while true; do
>
> date;
>
> ffmpeg -stats -loglevel error -re -i tcp://david-dotopc.labs:5001 -vf "select=gt(scene\,0.003),setpts=N/(20*TB)" -an -c:v libx264 -preset veryfast -t 20 -threads 0 -y $(date +"%Y%m%d-%H%M%S").mkv;
>
> echo "";
>
> sleep 15;
>
> done
>
>
> Mon Oct  1 22:30:52 CEST 2018                                                                            
> frame=  400 fps=0.8 q=-1.0 Lsize=    4196kB time=00:00:19.85 bitrate=1731.5kbits/s speed=0.0375x
>                                                                                                
> Mon Oct  1 22:39:56 CEST 2018                                                                                                                                                                                                                                                                                              
> frame=  400 fps=6.7 q=-1.0 Lsize=    4912kB time=00:00:19.85 bitrate=2027.0kbits/s speed=0.334x                                                                                                                                                                                                                            
>                                                                                                                                                                                                                                                                                                                            
> Mon Oct  1 22:41:10 CEST 2018                                                                    
> frame=  400 fps=2.6 q=-1.0 Lsize=    4501kB time=00:00:19.85 bitrate=1857.4kbits/s speed=0.127x
>                                                                                                
> Mon Oct  1 22:44:02 CEST 2018                                                                  
> frame=  400 fps=6.0 q=-1.0 Lsize=    3570kB time=00:00:19.85 bitrate=1473.4kbits/s speed=0.298x
>                                                                                                
> Mon Oct  1 22:45:23 CEST 2018                                                                  
> frame=  400 fps=4.5 q=-1.0 Lsize=    4353kB time=00:00:19.85 bitrate=1796.5kbits/s speed=0.223x
>                                                                                                
> Mon Oct  1 22:47:07 CEST 2018                                                                  
> frame=  400 fps=8.5 q=-1.0 Lsize=    4077kB time=00:00:19.85 bitrate=1682.3kbits/s speed=0.422x
>                                                                                                
> Mon Oct  1 22:48:10 CEST 2018                                                                  
> frame=  400 fps=9.5 q=-1.0 Lsize=    3797kB time=00:00:19.85 bitrate=1566.9kbits/s speed=0.471x                                            
>                                                                                                
> Mon Oct  1 22:49:07 CEST 2018                                                                        
> frame=  400 fps=9.3 q=-1.0 Lsize=    4019kB time=00:00:19.85 bitrate=1658.5kbits/s speed=0.46x
>                                                                                              
>
> ...........
>
>
>
> What is the problem with this? Why is it always stopping?
>
>
>
> David
>
> _______________________________________________
> 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".