4 ms·
Literally just used it today to re-sync the audio and video in some movies I recorded where I needed to add a 210ms delay to the audio. There's no better tool t
by js2 6y ago
Literally just used it today to re-sync the audio and video in some movies I recorded where I needed to add a 210ms delay to the audio. There's no better tool that I know of for doing this, even on macOS:
ffmpeg \
-i "$input" -itsoffset "$offset" \
-i "$input" \
-map 0:0 \
-map 1:1 \
-acodec copy \
-vcodec copy \
"$output"
- jedberg 6y agoI'm curious as to how you figured out the audio was 210ms ahead of the video.
- hiq 6y agoPlayers like vlc and mpv allow you to dynamically shift the audio wrt the video while playing, so one can just play around a bit until the perfect setting is found.
- js2 6y agoSo I had recorded my son playing keyboard for a recital. The audio was recorded via MIDI into GarageBand into QuickTime Player. The video was off my iPhone via EpocCam over USB also into QuickTime Player. I was able to get the audio routing setup via a Multi-Output Device I configured in Audio MIDI Setup. The video had a slight delay which I didn’t quite notice till after I’d recorded it. I basically wrote a quick script to generate variations of the recorded movies with delays from 50ms to 500ms in 50ms increments and then just watched each of them to see which appeared most correct for his hands playing the keys and the sound of the notes. It was slightly over 200ms and less than 250ms. 210ms seemed the best. I have now learned the importance of a clapperboard. (Originally I was going to record the audio in GarageBand and the video on my phone and join them later, but I was learning as I went and I wanted to see if I could record the two streams together.)
- jedberg 6y agoThat's an awesome story. > I have now learned the importance of a clapperboard. Ha! Good tip! Never thought about using one when doing recordings of recitals and stuff. Good idea.
- js2 6y agoAlthough now that I think about it, a clapperboard wouldn't help here because the audio was being generated on the Mac. There was no actual microphone involved capturing the sound a clapperboard would make. I need some other way to measure the latency being added by EpocCam. Hmmm....
- jedberg 6y agoYour "clapboard" would be a series of notes played on the keyboard in view of the camera.
- npteljes 6y agoAnother one I used to merge subtitles into their respective mkv video files: find . -name "*.mkv" -exec ffmpeg -i "{}" -i "{}.srt" -map 0 -map 1 -c copy "{}_merged.mkv" \;
- gsich 6y agomaybe mkvtoolnix.
- arendtio 6y agoAlso just used it a few hours ago, to resize and convert a video in order to send it via e-mail :-)
- deleted 6y ago[deleted]