VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Hey guys. I just want to say first that you guys have been more than helpful on my posts in the past; and I really appreciate it.

    Now to my question. I have an M2TS (with AC3) audio file of a movie I recorded off my TV with a Hauppauge 1212. It plays on my PC perfectly, but when I try to edit or convert it, the audio jumps out of sequence in a couple places by about a half second to a second each (video ahead of audio).

    My goal is to convert it from a 59.94P M2TS to 24P (23.976) MP4. I've had good luck with this before using an avisynth script like this:

    DirectShowSource("the searchers.m2ts", fps=59.940, convertfps=true)
    SelectEven()
    TDecimate()
    delayaudio(0.09)
    Trim(7553, 177660)
    LanczosResize(768,434)

    On this particular video, though, somewhere in the middle of the movie, I lose the A/V sync, and the video is ahead at the end by about 1-1.5 seconds. The video playback is smooth like it should be, and I can find no obvious breaks or skips in the video or audio, it simply is just no longer in sync.

    I've tried converting using a variety of programs including ffmpeg, handbrake, etc... I even used virtualdub with and without the avisynth script. Same thing. Does anyone know of a reason this might happen?

    One other thing. I can open the avisynth script in virtualdub, and the video/audio are in sync perfectly, but when I re-encode with HuffYUV or Xvid, the file is out of sync again. I'm out of ideas.
    Quote Quote  
  2. I noticed something a few minutes ago. I opened the m2ts file directly in avisynth, and I noticed a point where a frame was frozen for about a half-second. Is there a way to remove the frozen frame or frames (as this may occur at more than one point in the video)? Maybe some filter to remove 3 or more duplicate frames in a row?
    Quote Quote  
  3. Since it's an M2TS, you'll be better off making a D2V Project File in DGIndex and opening the video with MPEG2Source.

    You can delete frames like this. Or by using stickboy's DeleteRange, part of his JDL_Range filter.
    Quote Quote  
  4. Originally Posted by manono View Post
    Since it's an M2TS, you'll be better off making a D2V Project File in DGIndex and opening the video with MPEG2Source.

    You can delete frames like this. Or by using stickboy's DeleteRange, part of his JDL_Range filter.
    Thanks, I'll give it a try.
    Quote Quote  
  5. It didn't work. Apparently the file has the m2ts extension, but is encoded with h.264 video. Dgindex won't open the file.
    Quote Quote  
  6. By definition M2TS files are supposed to have MPEG-2 video inside. Okay, next I'd try FFVideoSource. Anything but DirectShowSource which (maybe together with illegal video being inside the M2TS) is probably responsible for the video being seen out of sequence.
    Quote Quote  
  7. Originally Posted by manono View Post
    That's what I thought, but according to FFMPEG, it's h264.

    Duration: 01:50:01.18, start: 0.387044, bitrate: 5703kb/s
    Program 1
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x56D448), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3) /0x332D4341), 48000 Hz, Stereo, fltp, 384 kb/s

    Go figure...
    Quote Quote  
  8. And MediaInfo says the same?
    Quote Quote  
  9. It's called "MPEG2 Transport Stream" , but it can hold many types of video. The most common is AVC, MPEG2 and VC1 - and all those are all found on blu-ray

    Since it's progressive AVC, you can try the depreciated DGAVCIndex . It has problems with PAFF streams, and even some "normal" progressive streams, but it's worth a try. It has been replaced by DGDecNV, which isn't free and requires a compatible Nvidia card. It's probably the most reliable

    The next most reliable for free transport stream source filters is l-smash
    Quote Quote  
  10. Originally Posted by poisondeathray View Post
    It's called "MPEG2 Transport Stream" , but it can hold many types of video. The most common is AVC, MPEG2 and VC1 - and all those are all found on blu-ray
    Yeah, you're right. It turns out I didn't read enough of my own link. Thanks for the correction and I apologize to Mr_Flintstone for giving him incorrect information.
    Quote Quote  
  11. Thanks for all the info guys. I didn't have much time to fool with this the last couple days. I'm off work today, and I found that using DGAVCDec and saving as a .dga file, and then using Avisynth allows me to create a good 29.97 fps AVI with Virtualdub that plays in sync with no jumps or jerky motion. I'm encoding to a 29.97 fps mp4 right now with Handbrake.

    Avisynth script:

    LoadPlugin("I:\dgavcdec109\DGAVCDecode.dll")
    LoadPlugin("I:\NicAudio_206\NicAudio_206\NicAudio. dll")
    video=AvcSource("the searchers-DG.dga")
    audio=NicAC3Source("The Searchers-DG PID 1100 2_0ch 48KHz 384Kbps DELAY -18ms.ac3")
    audiodub(video, audio)
    AssumeFPS(60000, 1001, true)
    Crop(38, 28, -48, -20)
    delayaudio(0.09)
    LanczosResize(768,432)

    I then used Virtualdub to do my decimating from 60fps to 30fps. For some reason I can't get Avisynth to play nice with selecteven or selectodd on this video. I still haven't had any luck with inverse telecining to 23.976 either. The first half of the video works perfectly, but somewhere in the middle the motion starts to jump/skip, but stays in sync. My guess is that there are some dropped frames that cause the telecine sequence to be different in the last part of the video than the first. I was hoping to get to 23.976, but I guess 29.97 is as close as I'll get with this video.
    Quote Quote  
  12. At least you're in sync now. But one thing to be aware of is DGAVCDecode is depreciated - Even on "normal" progressive sequences, sometimes there are decoding errors. Look out for corrupted / blocky frames

    As for the motion problems, it might have been broadcasted or recorded that way. It might have VFR sequences. The only way to determine is to go frame by frame in the 59.94 sequence and analyze for motion and cadence characteristics . If you need help you can post a sample, but it sound like you are having a difficult time narrowing down when it occurs ("somewhere in the middle") .
    Quote Quote  
  13. If you need help you can post a sample, but it sound like you are having a difficult time narrowing down when it occurs ("somewhere in the middle") .
    Thanks, but I actually think it happens two or three times. It comes on TV again in the middle of April, so I may re-record to see if I can get a better copy. What I have now seems pretty good though.
    Quote Quote  
  14. You could try it without having the audio in the script to see if you get better results.

    LoadPlugin("I:\dgavcdec109\DGAVCDecode.dll")
    #LoadPlugin("I:\NicAudio_206\NicAudio_206\NicAudio . dll")
    AvcSource("the searchers-DG.dga")
    #video=AvcSource("the searchers-DG.dga")
    #audio=NicAC3Source("The Searchers-DG PID 1100 2_0ch 48KHz 384Kbps DELAY -18ms.ac3")
    #audiodub(video, audio)
    AssumeFPS(60000, 1001, true)
    Crop(38, 28, -48, -20)
    #delayaudio(0.09)
    LanczosResize(768,432)


    And then see if you can do the SelectEven and decimation. You don't want to leave it at 29.97fps. Worry about the audio later. Maybe just mux it in afterwards.

    You listed a +90ms delay in your script originally but the audio name says there's a -18ms delay. Whichever you decide it is, you can remove it completely using DelayCut and not have to worry about it any more.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!