well apparently Fox channels in my area [atsc] are being broadcast out of sync lately..
everything from fringe to house to human target...off about a sec per hour..
it's the files too, as i play from another machine/player[vlc] with same results...over a dozen files already..
i thought the files were drifting, but it turns out not....maybe just *looked* that way as at beginning it can make up for some sync offset, but not later in file when offset is too large....
so i looked back into using ffmpeg as a re-muxer..was using 2 ffmpeg lines to unmux then remux...worked ok but slow and didn't seem like any difference...
but files now have same offset for entire file.. progress..
then i determined needed offset [.5 sec]and looked into getting the timeline shifted..
not an easy thing....as almost every program i tried either couldn't do it, or lots of steps or wasn't accurate or needed re-encoding..
then i played more with ffmpeg and came up with this line, along with help from faq page...
It allows you to advance or delay audio w/respect to video, without re-encoding, and only 1 line ffmpeg with no temp files!
i get between 800-1500 FPS! speed too... when output dir is another drive it doubles in speed..but you'd have to copy it back anyways so not much point..
if audio is early, delay with positive number..
if audio is late, start it earlier with a negative number...
you can even re-remux file if you don't get it right first time..[tho i wouldn't advise it. try to use original file every time]
only tested with mpeg2, but should work with any containers ffmpeg supports, tho h.264 .ts may be more of a challenge..
no video/audio data is touched, just remuxed with a timestamp offset...
here's the line by itself..i'll post a batch file that takes care of the other stuff too for a complete 1 liner cmdline fixup...
the -itsoffset is the time you wish to adjust...it affects the audio portion..negative number starts audio sooner, positive starts it later..
example above adds a half second delay to audio...both original.mpg are same file or can be different files..
everything from fringe to house to human target...off about a sec per hour..
it's the files too, as i play from another machine/player[vlc] with same results...over a dozen files already..
i thought the files were drifting, but it turns out not....maybe just *looked* that way as at beginning it can make up for some sync offset, but not later in file when offset is too large....
so i looked back into using ffmpeg as a re-muxer..was using 2 ffmpeg lines to unmux then remux...worked ok but slow and didn't seem like any difference...
but files now have same offset for entire file.. progress..
then i determined needed offset [.5 sec]and looked into getting the timeline shifted..
not an easy thing....as almost every program i tried either couldn't do it, or lots of steps or wasn't accurate or needed re-encoding..
then i played more with ffmpeg and came up with this line, along with help from faq page...
It allows you to advance or delay audio w/respect to video, without re-encoding, and only 1 line ffmpeg with no temp files!
i get between 800-1500 FPS! speed too... when output dir is another drive it doubles in speed..but you'd have to copy it back anyways so not much point..
if audio is early, delay with positive number..
if audio is late, start it earlier with a negative number...
you can even re-remux file if you don't get it right first time..[tho i wouldn't advise it. try to use original file every time]
only tested with mpeg2, but should work with any containers ffmpeg supports, tho h.264 .ts may be more of a challenge..
no video/audio data is touched, just remuxed with a timestamp offset...
here's the line by itself..i'll post a batch file that takes care of the other stuff too for a complete 1 liner cmdline fixup...
Code:
ffmpeg -y -fflags +genpts -i original.mpg -itsoffset [b]00:00:00.5[/b] -i original.mpg -map 0:0 -map 1:1 -vcodec copy -acodec copy -f vob "sync-output.mpg"
example above adds a half second delay to audio...both original.mpg are same file or can be different files..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie