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

scott denton scottd777 at yahoo.com
Thu Feb 14 21:38:54 EET 2019


 Hi Ted,
Thank you - I definitely appreciate all of the suggestions.  It seems like with the cue filter, frames are getting buffered and then at the end of the start delay, they all play through really quickly. It makes me wonder if there isn't some index that needs to be updated to basically tell it to not start at the beginning, but somewhere in the middle of the buffer.  You can see I tried using setpts in combination with the cue filter, and also tried adding the fifo statement but I really don't know how any of these interact.  I'm wondering if there is some combination of buffer filter and cue filter?  I'm having a hard time getting the buffer statement to work.

I tried all of the following (and more), but with no success.  

All of the following just shows live input:
./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -filter setpts=expr=PTS+10/TB -pix_fmt yuv420p -f sdl2 "SDL_OUT"

$ ./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -filter setpts='expr=PTS+10/(TB*1000000)' -pix_fmt yuv420p -f sdl2 "SDL_OUT"

 $ ./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -filter setpts='(RTCTIME-RTCSTART+10)/(TB*1000000)' -pix_fmt yuv420p -f sdl2 "SDL_OUT"

$ ./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -filter setpts='(RTCTIME-RTCSTART-10)/(TB*1000000)' -pix_fmt yuv420p -f sdl2 "SDL_OUT"

All of the following shows a delayed start to the video (blank white screen), then realtime video:
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" -filter cue=cue=$this_date:buffer=20,setpts='(RTCTIME-RTCSTART+10)/(TB*1000000)' -pix_fmt yuv420p -f sdl2 "SDL_OUT"

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" -filter setpts='(RTCTIME-RTCSTART+10)/(TB*1000000)',cue=cue=$this_date:buffer=20 -pix_fmt yuv420p -f sdl2 "SDL_OUT"

export this_date=`date +%s`;this_date=`echo \($this_date+5\)*1000000|bc`;./ffmpeg.exe -f dshow -video_size 160x120 -framerate 30 -i video="Integrated Webcam" -filter fifo,cue=cue=$this_date:buffer=20 -pix_fmt yuv420p -f sdl2 "SDL_OUT"



    On Thursday, February 14, 2019, 5:23:20 AM PST, Ted Park <kumowoon1025 at gmail.com> wrote:  
 
 > 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.

Oh. :s Does chaining setpts=expr=PTS+$DELAY/TB work? (Sorry I’m throwing all the spaghetti against the wall till something sticks) 

_______________________________________________
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