Audio/video desync
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
When converting recorded ATSC 1.0 (over-the-air) broadcasts to video DVD format using devede, I've noticed the audio/video sync ends up a little off.
Re-encoding the audio seems to fix this:
ffmpeg -i input.mts -c:v copy -c:a aac -ac 2 output.mkv
This keeps the video data intact, and just re-encodes the audio (as stereo, not the original surround sound).
These sorts of broadcasts usually have an alternate audio track as well - you could use some -map arguments to pick the track(s) you want, but I didn't bother with that this time around.
After doing this, I can put the resulting file into devede :)
If that doesn't work, here's a script that will convert the closed captions to subtitles and re-encode the video. Sometimes this can be necessary - an over-the-air data stream is sometimes missing some data that automated scripts can run into problems with.
#!/bin/sh set -e for i in $*; do o="$(basename $i)" m="$o.mp4" if ! [ -f "$m" ];then chmod +r "$i" ffmpeg -i "$i" -c:a copy -c:v copy "$o" ccextractor "$o" -in=ts -out=srt ffmpeg -i "$o" -c:a aac -ac 2 -c:v libx264 -preset veryfast "$m" rm "$o" fi done