VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 32
Thread
  1. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    I have converted a movie to AVI by choosing H.264/MPEG-4 AVC codec.
    I don't like using codec H.264/MPEG-4 AVC, due to a delay (a bit of skewing) in the movie, which leads to less synchronized between the lips speak and image.
    H.264/MPEG-4 AVC is only good for a short film, but badly for long duration of DVD movies. My experience proves that just good in 20min early, then after..the delay time will begin, even worse at the end of a long duration 1.5 hours movie... Two converters I use Xilisoft and FFDS, they both happened delay!
    I don't know why...also don't know how to fix it. Can someone give me suggestions to eliminate this, thank you.

    Note: My opinion H.264/MPEG-4 AVC just have a slight advantage in compression, that's a little smaller size than MPEG-4/XviD.
    At first glance, I saw both are not much different for image quality. But MPEG-4/XviD is working fine on all movies without any delays!
    Leo99
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by Leo99 View Post
    I have converted a movie to AVI by choosing H.264/MPEG-4 AVC codec.
    I don't know why...also don't know how to fix it. Can someone give me suggestions to eliminate this, thank you.
    Hi
    It's not a good idea to use H.264 in an AVI file.
    Probably will cause lots of troubles.
    Either use a different container (mp4,mov,mkv) with H.264 - or stay with AVI and use MPEG-4/XviD.
    Quote Quote  
  3. h.264 can work fine in an AVI container. Make sure you use constant frame rate, not variable frame rate. But why not use a more modern container like MKV?
    Quote Quote  
  4. Originally Posted by Leo99 View Post
    I don't know why...also don't know how to fix it. Can someone give me suggestions to eliminate this, thank you.
    What sort of video are you trying to convert? If the audio is gradually going out of sync as the video progresses it could be a frame rate issue.
    I've converted countless DVDs using the x264 encoder and audio delay is never an issue. Maybe you need to use a different conversion program (I use MeGUI but there's lots of alternatives) and as has been suggested, it might pay to use a more modern container format such as MKV.

    Originally Posted by Leo99 View Post
    Note: My opinion H.264/MPEG-4 AVC just have a slight advantage in compression, that's a little smaller size than MPEG-4/XviD.
    At first glance, I saw both are not much different for image quality. But MPEG-4/XviD is working fine on all movies without any delays!
    It probably depends a lot on the source video and any resizing you're doing etc. If you're converting DVDs you mightn't see any huge difference (assuming you resize the same way) as DVDs aren't generally all that sharp to begin with. I've re-encoded 1080p/720p video as standard definition Xvid/AVIs and x264/MKVs in order to compare them, and when all else is equal there's no doubt x264 wins for quality.
    Quote Quote  
  5. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    @bat999: In the meantime I agree with you MPEG-4/XviD is the best choice.
    @jagabo: I prefer using AVI rather than MKV, although in Xilisoft converter I've used containing the option for MKV.

    @hello_hello: Here's the details:
    1. The source is AVI too, all works good till the end, but the audio contents PCM 48000Hz.
      This PCM audio is too big, the one thing that makes the filesize becomes large. Therefore, I plan to convert with AVI but changed the Audio format.
      Note:
      I just change the audio only (video settings adjusted to the original).
      Specs Video: Xvid 720x412 29.97fps | 1996kbps | AR 16:9 | 1Hr:42mn | 2.5 GB
      Specs Audio: PCM 48000Hz stereo 1536kbps | 16 bits | Bitrate mode: Constant
    2. Process of converting: (using VirtualDubMod 1.5.10)
      a. Open the source by VirtualDubMod > Streams > Stream list > Save WAV (converted to change with AC3/MP3 by using Xilisoft Vid Cvtr Utm 7.1)
      b. Then, Disable orig audio > Add audio AC3 has just converted > OK
      c. Click Video > tick Fast recompress > click Compression... choose ffdshow Video Codec > Configure
      d. Choose H.264 on tab Encoder > FOURCC: AVC1 > Bitrate change with 1020kbps for example > OK Finish
      e. Then process Save to done!
    3. Converting with Xilisoft Vid Cvtr Ultm 7.1 is much easier because there are fix separated columns video + audio, just click on any box.

    Well, the point2+3 I've done, both the result delay at the end episodes(un-synchronous). Please correct me if something wrong, thanks.
    I really wonder to see on so many movies on the web almost all use AVI with H.264/MPEG-4 AVC, but everything worked fine! I'm confused how they make it or what converters do they use to ripp?
    Last edited by Leo99; 9th Apr 2012 at 06:10.
    Leo99
    Quote Quote  
  6. Why don't you just do the whole thing in VirtualDub?

    1) File -> Open Video File
    2) Video -> Direct Stream Copy
    3) Audio -> Full Processing Mode
    4) Audio -> Compression... select codec, configure
    5) File -> Save as AVI.
    Quote Quote  
  7. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    "I prefer using AVI rather than MKV"

    You're going to have to give me a damn good reason for that one. Why the hell do you want to use a container that does not support all h.264 features? Makes no sense.
    Quote Quote  
  8. Originally Posted by Hoser Rob View Post
    Why the hell do you want to use a container that does not support all h.264 features?
    What h.264 features does AVI not support? The only one I'm aware of is variable frame rate.
    Quote Quote  
  9. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    Originally Posted by Hoser Rob View Post
    You're going to have to give me a damn good reason for that one. Why the hell do you want to use a container that does not support all h.264 features? Makes no sense.
    OK, I understand, but I have one question to this:
    I download so many movies on the web almost all use AVI with H.264/MPEG-4 AVC, but everything worked fine!
    What converters do they use to ripp?

    Please give a smart answer! Thanks.
    Leo99
    Quote Quote  
  10. The only think that might be considered 'problematic' are bidirectional references, but these can be (and normally are) handled the same way they are handled for Xvid&Co and require the same handling from tools that edit them, namely to differentiate between display and coding order.

    The problem in general is mainly not the problem that .avi could not support a lot of stuff, see: http://www.alexander-noe.com/video/amg/en_myths.html, but that the support for a bunch of possibilities just isn't well supported in most of the splitters&co out there, .i.e. problems with vbr audio and avi are normally not a problem due to restrictions in avi but due to restrictions in acm.

    The only one I'm aware of is variable frame rate.
    storing variable framerate in avi is not efficient but it is possible (+ not a hack which would stretch the AVI spec), and most splitters out there should support it, you just set the framerate to the least common multiple of the rates you want to use, and use 0-byte chunks for “skipped” frames

    Cu Selur
    Quote Quote  
  11. What h.264 features does AVI not support? The only one I'm aware of is variable frame rate.
    b-frames?

    I download so many movies on the web almost all use AVI with H.264/MPEG-4 AVC,
    Only amateurs store avc in avi.
    Quote Quote  
  12. can work the same way they to for MPEG-4 ASP

    for general amusement:
    <pengvado> <Dark_Shikari> if a fansubber or DVD rip group uploaded an H.264-in-AVI file they'd get laughed off the internet
    <Dark_Shikari> Probably
    <pengvado> but asp-in-avi wouldn't be laughed at
    <Dark_Shikari> of course not, ASP in AVI is normal unless you want softsubs
    <pengvado> and asp-in-avi requires exactly the same ugly hacks
    <Dark_Shikari> Probably because its been that way so long that everyone is accustomed to it
    <pengvado> which just goes to show that our campaign to use a new codec as an excuse to tell people to upgrade their container is working
    source: http://www.x264.nl/developers/Dark_Shikari/loren.html
    Last edited by Selur; 9th Apr 2012 at 07:27.
    Quote Quote  
  13. Originally Posted by Atak_Snajpera View Post
    What h.264 features does AVI not support? The only one I'm aware of is variable frame rate.
    b-frames?
    B-frames are supported. You are confusing AVI and VFW. Many editors use VFW to read AVI files. VFW is based on a one-frame-in-one-frame-out model. So it requires a hack to work with b-frames. But media players us DirectShow (or their own internal filters) which has no problem with b-frames in AVI.
    Last edited by jagabo; 9th Apr 2012 at 07:41.
    Quote Quote  
  14. <pengvado> and asp-in-avi requires exactly the same ugly hacks
    ugly hacks.no thanks.
    Quote Quote  
  15. ugly hacks.
    'ugly' really lies in the eye of the beholder there,... personally I would call it a "creative way of 'spec interpretation' " and not an ugly hack

    no thanks.
    but you support Xvid inside avi using RipBot iirc, strange ...
    Quote Quote  
  16. I can see why developers don't like h.264 (or any other out-of-order codec) in AVI but for end users there's no problem since all the players can handle it.

    Of course, it's likely this has nothing to do with the OPs problem.
    Last edited by jagabo; 9th Apr 2012 at 09:19.
    Quote Quote  
  17. but you support Xvid inside avi using RipBot
    but I do not allow avi as output container.
    Quote Quote  
  18. I thought you did,.. my apologies
    Quote Quote  
  19. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    Originally Posted by jagabo View Post
    Why don't you just do the whole thing in VirtualDub?

    1) File -> Open Video File
    2) Video -> Direct Stream Copy
    3) Audio -> Full Processing Mode
    4) Audio -> Compression... select codec, configure
    5) File -> Save as AVI.
    I've tried, it's still not synchronized if I choose H.264/AVC1. But all matching if I choose MPEG-4/XviD.

    Finally, the conclusion I agree with bat999 and Atak_Snajpera that avi container just good & matching with XviD + all, but not to AVC.

    However, thanks to all.
    Leo99
    Quote Quote  
  20. Originally Posted by Leo99 View Post
    Originally Posted by jagabo View Post
    Why don't you just do the whole thing in VirtualDub?

    1) File -> Open Video File
    2) Video -> Direct Stream Copy
    3) Audio -> Full Processing Mode
    4) Audio -> Compression... select codec, configure
    5) File -> Save as AVI.
    I've tried, it's still not synchronized if I choose H.264/AVC1. But all matching if I choose MPEG-4/XviD.
    In the scenario I outlined you are not reencoding the video at all.
    Quote Quote  
  21. Leo99,
    The way I understand it you're trying to convert and AVI to AVI simply to re-encode the audio. Is there any particular reason why you're converting the video too? You should be able to open the original AVI using VirtualDubMod and use it to re-encode the audio (assuming you have the appropriate encoders installed) while using Direct Stream Copy for the video. Or demux the original audio as you're doing, convert it and then add it to the AVI while resaving it using Direct Stream Copy for the video again.

    I've never converted to AVI using x264 and never encoding using x264 with either of the program's you're using, but if the video sync is wandering out gradually over the entire length of the video, I suspect you have a frame rate problem. If that's the case, I'm not sure why but it can't hurt to check.
    If you open the original video with VDM and use the Video/Frame Rate menu I assume it's 29.970? What about when you open the converted AVI with VDM and look at the frame rate? Is it still 29.970? Even if it is, try changing the frame rate very slightly.... 29.969 or 29.971 etc just to see what happens, then resave the AVI using Direct Stream Copy for the video.

    PS Another thought..... if you open the encoded AVI with VDM and it displays 29.970 as the frame rate, try specifying 29.970 in the "change frame rate" box and resaving the AVI using Direct Stream Copy for the video. As odd as it sounds, I'm sure I've had video in the past where the correct frame rate was displayed, but it was actually out just enough to put the audio out of sync over a long duration. I assume some software "rounds" the frame rate to the nearest .001fps, but it can still be slightly off. Well in fact I've confirmed it by opening video while using ffdshow to decode and it's On Screen Display to show the frame duration. Sometimes two videos with a 23.976 frame rate can actually have frame durations which differ marginally, but over an hour or two it seems to add up. Maybe sometimes the differences are compensated for when muxing.. I'm not sure.

    As an example, I just opened an MKV and the AVI I'd encoded using the MKV as a source. According to ffdshow:
    Original MKV: 41.7083ms frame duration, 23.976 frame rate.
    Encoded AVI: 41.7084ms frame duration, 23.975 frame rate.

    I opened the AVI with both VirtualDubMod and VirtualDub, specified a 23.976 frame rate and resaved it as new AVIs. According to ffdshow:
    VirtualDubMod saved AVI: 41.708ms frame duration, 23.976 frame rate.
    VirtualDub saved AVI: 3 frames of 41.7084ms followed by one frame of 41.7083ms, 23.976 frame rate.

    Obviously VirtualDub tries to be as accurate as possible with frame rates while VirtualDubMod does a lot more "rounding". Anyway..... try playing with the frame rate a little and resaving the AVI to see if one of the programs involved in the conversion is taking liberties....
    Last edited by hello_hello; 9th Apr 2012 at 22:39.
    Quote Quote  
  22. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    @hello_hello: OK, I'm an experiment to change the frame rate step by step. I will report later!
    Leo99
    Quote Quote  
  23. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    Hey hello_hello, I have found the Best solution to convert AVI/H.264 AVC without any delays.

    Here I share my trials:
    1. It's going crazy if you force to change the frame rate, I've tried from 29.960 till 29.980, but all errors caused desynchronization to be getting worse. This making me mad, and loosing time overnight - useless!
    2. Now, you need an AVC Converter (I use 4Videosoft AVC Converter, I don't know is it the same with XMedia Recode for freeware).
    3. Unfortunately, this AVC Converter has only one MP3 encoder for Audio, it's okay and continue on even converting to MP3. At the same time, I reduce the video bitrate to 1200Kbps
    4. Done - Result: all matching till the end!

      So, if you want to change the audio to AC3/6ch for example, needed 2 apps: VDM and delaycut.
      All requires 2min for 1DVD:
    5. Open the first source using VDM (not the result as point4 above) > Streams > Stream list > Save WAV to HDD, then convert it to AC3 using any converters you have (all less than a minute).
    6. Then, use delaycut (AC3 Delay Corrector) to corrects delay. This a small appl that doesn't need to install, just run & process (just need 2seconds).
      PS:
      Everytime I convert to AC3 from WAV or MP3 are always generating delays. It seems this the main cause as the ringleader of a delay in AC3 audio. I don't know..maybe you can tell me, why? Therefore to correct this, please use AC3 delaycut - a small appl but the great results.
    7. Next you will get a new audio_fixed.ac3
    8. Back to VDM then Close video file > Open a new file as point4 above > if asking 'Do you still want to rewrite the header?' > answer to 'No'.
      click Streams > Stream list > Disable/change the current audio with audio_fixed as point7 > OK
    9. Video > choose Direct stream copy > then Save as AVI (less than a half minute to proceed)
    10. Done - Result: an AVI video H.264 AVC + AC3 Dolby 6ch - No delays till the end, Perfect!

    Note:
    Don't use VD/VDM or TMPGEnc to compress AVI/H.264 AVC, because some new frames added as a prefix with the green color. This will increase desynchronization became worse and more complicated!

    Well, that's my test. Any suggestions are welcome, thanks all.
    Last edited by Leo99; 13th Apr 2012 at 18:13.
    Leo99
    Quote Quote  
  24. You're going about this all wrong. You don't reencode your video over and over with different frame rates until you find something that works. You calculate what the proper fix is first. Then you adjust the frame rate to that value. You may not even need to convert your video again, you may be able to set the frame rate at the container level. For example, if you have a 90 minute movie and the audio is 30 seconds behind the video near the end of the movie (you have to eyeball it*):

    audio length: 90 minutes + 30 seconds = 5430 seconds
    video length = 90 minutes = 5400 seconds

    So you need to make the video run 5430/5400 slower. If the frame rate is 29.97 fps change it to 29.97 * 5400 / 5430 = 29.8044.

    For an AVI file you can try using AviFrate to set the frame rate without reencoding. Or open the AVI in VirtualDub, set Video -> Direct Stream Copy, set the source frame rate to 29.8044, and Save as AVI.

    * Many players have an audio delay/advance function. MPCHC, for example.
    Quote Quote  
  25. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    Originally Posted by jagabo View Post
    audio length: 90 minutes + 30 seconds = 5430 seconds
    video length = 90 minutes = 5400 seconds

    So you need to make the video run 5430/5400 slower. If the frame rate is 29.97 fps change it to 29.97 * 5400 / 5430 = 29.8044.
    Yes, there is nice solution in terms of how to calculate the fps values.
    I will note this formula which is very useful someday. Thanks dude!.
    Indeed, it's a crazy work without a clear definition as a criterion for what to do!
    Leo99
    Quote Quote  
  26. Originally Posted by Leo99 View Post
    Hey hello_hello, I have found the Best solution to convert AVI/H.264 AVC without any delays.

    Here I share my trials:
    1. It's going crazy if you force to change the frame rate, I've tried from 29.960 till 29.980, but all errors caused desynchronization to be getting worse. This making me mad, and loosing time overnight - useless!
    2. Now, you need an AVC Converter (I use 4Videosoft AVC Converter, I don't know is it the same with XMedia Recode for freeware).
    3. Unfortunately, this AVC Converter has only one MP3 encoder for Audio, it's okay and continue on even converting to MP3. At the same time, I reduce the video bitrate to 1200Kbps
    4. Done - Result: all matching till the end!
    Thanks for letting us know what worked.
    In your first post you said the audio starts off in sync but then goes out of sync over a period of time. Hence my suggestion to try adjusting the frame rate.


    Normally if the audio just needs a delay amount applied when muxing (it's applied to the whole audio stream), then in theory without it the audio should be out of sync by the same amount from start to finish. It should also be out of sync by the same amount regardless of whether you use the Xvid or x264 encoder. If a single encoding GUI is getting the audio delay correct for Xvid but not for x264 as you described, then I have no idea why. I doesn't make sense.


    It is also possible that as you're converting AVIs, the audio inside the AVI has non-audio or junk data in it, and this data is skipped when converting. If it happens in a few places then each place where it happens can put the audio a little more out of sync. However as you're demuxing the AVI audio as a wave file (it appears) then using the wave file as input for DelayCut, I don't understand how it could be fixing anything. Does DelayCut produce a log file? If so, can you post it?
    And once again, why do you need to use DelayCut when converting with x264 but not Xvid? It makes no sense to me.



    As jagabo pointed out, my suggestion was to encode the video using the original frame rate, then to try adjusting it a little while saving it as a new file. It should only take a minute or two. Encoding the whole video using different frame rates to try to sync the audio would indeed be useless.


    Anyway, while I don't really understand why the method you're using to convert the audio has solved the problem, I guess it's fixed, at least.
    Quote Quote  
  27. Originally Posted by Leo99 View Post
    Originally Posted by jagabo View Post
    audio length: 90 minutes + 30 seconds = 5430 seconds
    video length = 90 minutes = 5400 seconds

    So you need to make the video run 5430/5400 slower. If the frame rate is 29.97 fps change it to 29.97 * 5400 / 5430 = 29.8044.
    Yes, there is nice solution in terms of how to calculate the fps values.
    Except...... it assumes the audio and video streams should be the same length and/or there's no audio delay which should be apoplied. It's very common for their lengths to be slightly different so you can't always fix the audio sync that way. For instance VDM (under video frame rate) has an option to change the frame rate so the audio and video durations match, which is basically the same as using the above calculation. In my experience though, if you have an audio sync problem making the audio and video durations the same rarely fixes it. It can't hurt to try though....
    Quote Quote  
  28. Originally Posted by hello_hello View Post
    It's very common for their lengths to be slightly different so you can't always fix the audio sync that way.
    Using the technique I outlined, it doesn't matter if the lengths of the tracks are different. Since you've determined the A/V desync by watching the video and listening to the audio the total length of the two tracks doesn't matter. That's why I told him to eyeball the sync, not to use tools like MediaInfo. The "audio length" and "video length" I referred to are the lengths at the point the A/V de-sync was measured, not the total length of the tracks.

    Originally Posted by hello_hello View Post
    For instance VDM (under video frame rate) has an option to change the frame rate so the audio and video durations match, which is basically the same as using the above calculation.
    No, it's not the same thing. The A/V sync could be bad even though the length of the two tracks is the same.

    Originally Posted by hello_hello View Post
    In my experience though, if you have an audio sync problem making the audio and video durations the same rarely fixes it. It can't hurt to try though....
    Yes, changing the frame rate or stretching the audio only works well when the change is gradual over the entire film. It's sometimes the case that audio and video from two different version of the movie (eg, a European release and an American release) where the two have different cuts/scenes. Or a capture dropped a bunch of frames in the middle of the movie. In these cases it won't give perfect results.
    Quote Quote  
  29. Originally Posted by jagabo View Post
    Using the technique I outlined, it doesn't matter if the lengths of the tracks are different. Since you've determined the A/V desync by watching the video and listening to the audio the total length of the two tracks doesn't matter. That's why I told him to eyeball the sync, not to use tools like MediaInfo. The "audio length" and "video length" I referred to are the lengths at the point the A/V de-sync was measured, not the total length of the tracks.
    Yes sorry, my mistake. I think I read the quote of your post rather than reading the original properly and assumed from the quote you were referring to video and audio durations.
    Quote Quote  
  30. Member
    Join Date
    Aug 2008
    Location
    at 3rd region
    Search PM
    Originally Posted by hello_hello View Post
    Anyway, while I don't really understand why the method you're using to convert the audio has solved the problem, I guess it's fixed, at least.
    Aha...Same like Jagabo said that I'm not easy to believe what's all written in MediaInfo tools, often do not match.
    So, to make sure I always test by watching the result from start till the end. Finally, all perfect without any delays.

    I repeat details conversion:
    • Firstly, I use VDM with FFDS codec to convert AVI/XviD audio PCM to AVI/H.264 AVC audio AC3. The result was delays between video and audio (the lips speak less synchron with image). The same thing happens even changing PCM audio to MP3, I don't know why. Then, I post here as post #1 above.
      If I look via TMPGEnc 4.0 XPress, there are new frames added as a prefix, it tells 41 frames with the green color! But all the same as overall Total of 183727 frames, I look the end frame is shorter than the original. It seems shifted to the start frame. Also don't know why, can you explain me?
    • Finally, I decided to use 4Videosoft AVC Converter. Firstly convert successful with MP3 audio (as seen post #23 on point4) = 183729 frames.
      But when I wanna change the audio with AC3 by using VDM, desynchronization occurs! Then, I use delaycut to corrects it and it's been succeeded as seen on my post #23 point10. Tested all perfect till the end with AC3 audio = 183728 frames. Therefore, I'd venture to ensure that AC3 audio is causing delays on this case.

    That's my conversions history and hope you can understand now.
    Last edited by Leo99; 15th Apr 2012 at 08:09.
    Leo99
    Quote Quote  



Similar Threads