[FFmpeg-user] Use ffmpeg to delay webcam feed with dshow displayed locally

scott denton scottd777 at yahoo.com
Wed Feb 13 20:10:31 EET 2019


 Hi Ted,
Thank you so much for your help and suggestions.  I tried a few different permutations of what you recommended, but without luck.  :( 

It seems that nothing I'm trying does anything other than *delay the start* of the video.  The video itself still isn't delayed.  

For example, I tried the following command:export this_date=`date +%s`;this_date=`echo \($this_date+10\)*1000000|bc`;./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -pix_fmt yuv420p -filter:v cue=cue=$this_date:buffer=20 -f sdl2 "SDL OUT"

It shows a white output screen for 10 seconds, then it shows what appears to be a very fast set of "catchup" frames for a fraction of a second, then shows the live video stream again with no delay.
Commandline output is below.  Thanks again for your help with this!
-Scott
** Commandline output**
 libavcodec     58. 46.100 / 58. 46.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, dshow, from 'video=Integrated Webcam':
  Duration: N/A, start: 93371.403000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 160x120, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, sdl,sdl2, to 'SDL OUT':
  Metadata:
    encoder         : Lavf58.26.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 160x120, q=2-31, 6912 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.46.100 rawvideo
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 73 >= 73
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 84 >= 84
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 97 >= 97
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 109 >= 109
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 120 >= 120
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 133 >= 133
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 144 >= 144
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 252 >= 252
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 264 >= 264
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 276 >= 276
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 289 >= 289
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 300 >= 300
[sdl,sdl2 @ 00000257dc497180] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 312 >= 312
av_interleaved_write_frame(): I/O errore=00:00:13.66 bitrate=N/A speed=   1x
frame=  423 fps= 30 q=-0.0 Lsize=N/A time=00:00:14.16 bitrate=N/A speed=   1x





    On Wednesday, February 13, 2019, 6:50:32 AM PST, Ted Park <kumowoon1025 at gmail.com> wrote:  
 
 > Hi - it very well might, but I'm not sure how to combine those.  Would you be willing to give me an example?

There is a buffer parameter for the cue filter, you can just set it a reasonable number of seconds bigger than your delay introduced by cue. In bash, you can set something like

cue=cue=(`date +%s`+$DELAY)*1000000:buffer=20

(The cue timestamp is in microseconds)
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


More information about the ffmpeg-user mailing list