NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 … 6 7 8 9 10 … 56 Next »
audio out of sync? fix with ffmpeg!

 
  • 0 Vote(s) - 0 Average
audio out of sync? fix with ffmpeg!
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#1
2011-02-05, 10:10 PM (This post was last modified: 2011-02-06, 10:23 AM by pBS.)
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..Smile 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...Big Grin 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"
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..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,958
Threads: 956
Joined: May 2006
#2
2011-02-05, 10:27 PM
Hi pBS can you put a 100MB chunk on one of the upload sites for me to look at?

Martin
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#3
2011-02-06, 10:14 AM
you can download at my server, tho i think i converted all my troubled shows already..Smile
[lost 2 2hr Human Targets! plus another and a few House epsodes..seemingly anything shot on film..live doesn't have problem..not antenna related either..]
will record another and see if it has problem and let you know where to dl...
something wrong with their broadcast settings, shows look skippy even straight on regular tv...smoothness sucks if you look closely..
it's watchable, but it seems like it's skipping frames to keep up with audio all the time..

prolly gonnna have to wait till monday as nothing on fox but SuperBowl tomrrow...oh, glee after might do it..that's filmed..

yea, i notice a lot of people having sync problems lately..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,958
Threads: 956
Joined: May 2006
#4
2011-02-06, 04:15 PM
Thanks, being primarily a livetv user no fixes are going to work for me, so I am looking to see if there is anything I can do on the NMT on the fly. So far all my local ATSC files are fine, but locally our digital cutoff is Aug 31 and I want to be ready if Canadian broadcasters follow this.

Martin
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#5
2011-02-06, 06:16 PM
I wonder if what you're seeing is another effect of that frame-dropping technology that ABC is known to use in order to add more commercials to a show without cutting scenes. It's rendered "V" on ABC almost unwatchable. I suspect ABC isn't the only one using it.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,958
Threads: 956
Joined: May 2006
#6
2011-02-06, 06:56 PM
johnsonx42 I thought your problem was slightly different, some sort of judder which couldn't be fixed by adjusting the timing offset? I wouldn't mind a 100MB sample of your bad V recording but you problem need to use to make a clean cut of the body of the show rather than a chuck from the beginning if the problem is in the show and not in the pre-padding.

Martin
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#7
2011-02-07, 03:31 AM
well my problems turned out to be caused by cyberlink mux....[was experimenting, odd how it only affected 1 channel tho]
went back to ati mux and all is well again...ts mux also worked but mpg is just so easy for comskip etc..
i've used ati mux for over 5 years without problems...Big Grin
still was interesting finding that ffmpeg ability...
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,958
Threads: 956
Joined: May 2006
#8
2011-02-07, 03:51 AM
Fortunately new users won't have this GB-PVR related problem and on top of that comskip is near perfect on TS files in NextPVR.

Martin
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#9
2011-02-07, 05:34 AM
mvallevand Wrote:johnsonx42 I thought your problem was slightly different, some sort of judder which couldn't be fixed by adjusting the timing offset? I wouldn't mind a 100MB sample of your bad V recording but you problem need to use to make a clean cut of the body of the show rather than a chuck from the beginning if the problem is in the show and not in the pre-padding.
Yes, you're correct, it was more along the lines of a video freeze every 15 seconds or so, followed by an audio stutter. I was just thinking aloud, based on what pBS was saying, that maybe what he was getting was a different effect of the same root cause. I see now that wasn't the case as switching the mux fixed it.

I have been thinking I ought to provide a sample of one of the offending recordings to those like you who understand MPEG-2 streams far better than I, and who have more ways to test it. I will see about doing that in the next day or two. Fortunately I do not use Pre-padding, so the glitch should appear even in the first 100MB.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Change audio input on HDPVR without TME pBS 0 1,465 2011-10-10, 09:18 PM
Last Post: pBS
  Sky Channel Sync Tool Version 1.0.2 systemshark 0 1,170 2008-08-17, 07:26 AM
Last Post: systemshark
  Sky Channel Sync Tool systemshark 2 1,450 2007-11-05, 01:20 PM
Last Post: systemshark
  V2.0 of the UbuStream web video/audio plugin now available ubu 1 1,622 2006-12-10, 11:28 PM
Last Post: ubu

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode