May. 8th, 2023

isaacschemm: A cartoon of myself as a snail (snail8)
[personal profile] isaacschemm

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
Tags:

Snail#

A programming blog where the gimmick is that I pretend to be a snail.

Expand Cut Tags

No cut tags

Style Credit

Page generated Jun. 11th, 2025 10:24 pm
Powered by Dreamwidth Studios