Changes between Version 27 and Version 28 of DirectShow


Ignore:
Timestamp:
Jun 4, 2014, 12:49:20 AM (4 years ago)
Author:
rogerdpack
Comment:

hopefully clarify

Legend:

Unmodified
Added
Removed
Modified
  • DirectShow

    v27 v28  
    7878You can set framerate like {{{ffmpeg -f dshow -framerate 7.5 -i video=XXX}}}.  This instructs the device itself to send you frames at 7.5 fps [if it can]. 
    7979 
    80 Be careful *not* to specify framerate with the "-r" parameter, like this  {{{ffmpeg -f dshow -r 7.5 -i video=XXX}}}.  This actually specifies that the devices incoming PTS timestamps be *ignored* and replaced as if the device were running at 7.5 fps [so it runs at default fps, but its timestamps are treated as if 7.t fps].  This can cause the recording to have "video faster than audio" or, under high cpu load (if video frames are dropped) it will cause the video to fall "behind" the audio [after the recording is done, audio continues on--and highly out of sync]. 
     80Be careful *not* to specify framerate with the "-r" parameter, like this  {{{ffmpeg -f dshow -r 7.5 -i video=XXX}}}.  This actually specifies that the devices incoming PTS timestamps be *ignored* and replaced as if the device were running at 7.5 fps [so it runs at default fps, but its timestamps are treated as if 7.t fps].  This can cause the recording to appear to have "video slower than audio" or, under high cpu load (if video frames are dropped) it will cause the video to fall "behind" the audio [after playback of the recording is done, audio continues on--and gets highly out of sync, video appears to go into "fast forward" mode during high cpu scenes]. 
    8181 
    82 If you want say 10 fps, and you device only supports 7.5 and 15 fps, then run it at fps then "downsample" to 10 fps.  There are a few ways to do this--you could specify your output to be 10 fps, like this: {{{ffmpeg -f dshow -framerate 15 -i video=XXX -r 10 output.mp4}}} or insert a filter to do the same thing for you: {{{ffmpeg -f dshow -framerate 15 -vf fps=fps=15 output.mp4}}}. 
     82If you want say 10 fps, and you device only supports 7.5 and 15 fps, then run it at fps then "downsample" to 10 fps.  There are a few ways to do this--you could specify your output to be 10 fps, like this: {{{ffmpeg -f dshow -framerate 15 -i video=XXX -r 10 output.mp4}}} or insert a filter to do the same thing for you: {{{ffmpeg -f dshow -framerate 15 -vf fps=15 output.mp4}}}. 
    8383 
    8484 
    85 == Buffering/Latency == 
     85== !Buffering/Latency == 
    8686 
    8787By default FFmpeg captures frames from the input, and then does whatever you told it to do, for instance, re-encoding them and saving them to an output file.  By default if it receives a video frame "too early" (while the previous frame isn't finished yet), it will discard that frame, so that it can keep up the the real time input.  You can adjust this by setting the `-rtbufsize` parameter, though note that if your encoding process can't keep up, eventually you'll still start losing frames just the same (and using it at all can introduce a bit of latency).  It may be helpful to still specify some size of buffer, however, otherwise frames may be needlessly dropped possibly.