New submission from Richard Neill <[EMAIL PROTECTED]>: Most DV cameras suffer from the "feature" of having unlocked audio. This means that the audio and video clocks are derived from independent oscillators. As a result, the audio sample rate isn't what it claims to be. For example, my Canon XL1 actually samples at 48007.5 Hz (measured).
The resulting DV or AVI files now suffer from A/V sync loss, which gets progressively worse. At the beginning of the file, everything is exactly right; by the end of a 2 hour recording, the audio is over a second behind the video. The current "workaround" is to split out the Audio and Video components, resample the audio using sox: sox -r 48008 orig.wav -r 48000 fixed.wav resample and then re-merge. Another workaround (at the playback side) is to run xmacroplay every 288 seconds, which fakes a keypress, and makes vlc re-adjust the sync. echo -e "KeyStrPress Control_L \n KeyStrPress l \n KeyStrRelease l \n KeyStrRelease Control_L \n" | xmacroplay :0 > /dev/null What I'm requesting for ffmpeg is a -itsdrift option. This would take a float as its parameter, and would increase, or decrease the playback speed of that file (or stream within a file). For example: ffmpeg -i video.m4v -itsdrift 0.999984 -i audio.wav -vcodec copy -acodec copy -y final.avi This would slow down the audio.wav file with respect to the video.m4v file, by a tiny fraction. * How should the end of the file be handled? final.avi will "run out of video" before the audio ends. Either it should be truncated, or there should be a small amount of silence/blackness. * How should this be implemented? Given that typical drifts are very small, simply dropping or duplicating audio samples would do. An altenative would be a -dropevery option (taking an integer), such that -dropevery 6400 would cause every 6400th sample to be dropped. Thanks very much, Richard ---------- messages: 2347 nosy: RichardNeill priority: normal status: new substatus: new title: Request for -itsdrift option (for videos where the a/v sync drifts progressively) type: feature_request ______________________________________________________ FFmpeg issue tracker <[EMAIL PROTECTED]> <https://roundup.mplayerhq.hu/roundup/ffmpeg/issue511> ______________________________________________________
