VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Member
    Join Date
    Mar 2014
    Location
    Brazil, Rio de Janeiro
    Search Comp PM
    I love the x264 codec and I use it to record my games. I'd like to keep using it, but I read on several places people saying it's a "hack" even though it works for me. When I record the videos, I leave the settings like this:



    I read that leaving it on "Single pass - lossless" and "Zero Latency" checked, fixes the "hack" problem. But I'd like to know you guys' opinion on it. Are those settings ok? or should I change something?
    Quote Quote  
  2. It is but so is Xvid in an AVI if it uses B-Frames. That's the problem.... the VFW system works on a one frame in, one frame out basis, and I don't think the AVI container has the ability to store information regarding the type of frames. When B-Frames are used the frame display order and the encoding/storage order might be different, so I think for AVC it's the same as Xvid. To get around the problem frames are packed together as a single frame or several frames have to be decoded before any can be displayed, causing a slight delay. The hacks are well supported though, especially for mpeg4 (Xvid, Divx etc). I don't know about AVC as I've not used it in an AVI for anything but an intermediate file for re-encoding on occasion.

    The ultra fast preset doesn't use B-Frames so I assume the ultra fast preset on it's own would be enough to avoid any hackery. I'm not sure about the lossless mode. I don't think it uses B-Frames but I'm not certain.

    Are you stuck with using the VFW version of x264 for a reason, or forced to use AVI rather than a more modern container such as MP4 or MKV? Playback support for h264 in an AVI is well supported on a PC but it's probably somewhat uncommon for standalone hardware players.
    Last edited by hello_hello; 8th Nov 2016 at 06:20. Reason: spelling
    Quote Quote  
  3. Like hello_hello said, it is kind of a hack but without b frames you are mostly safe.

    Your options:
    1. switch "Output mode" from "VFW" to "File". This will write to an extra file without AVI but VirtualDub will still create a dummy (or audio-only) AVI file. So you need to mux the video file and the audio-only avi back together later using e.g. mkvmerge.
    2. switch to using the https://forum.videohelp.com/threads/367446-Virtualdub-External-Encoder-feature feature of VirtualDub. It supports encoding and muxing without AVI but is more difficult to set up initially. Since you are talking about capturing: I don't know if it possible to use it with VirtualDub capture mode.
    3. continue using the hack. If it works for you .. why not?

    Originally Posted by hello_hello View Post
    The ultra fast preset doesn't use B-Frames so I assume the ultra fast preset on it's own would be enough to avoid any hackery. I'm not sure about the lossless mode. I don't think it uses B-Frames but I'm not certain.
    x264 lossless does indeed not use b frames.
    Last edited by sneaker; 8th Nov 2016 at 02:51.
    Quote Quote  
  4. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    AFAIK, only MPEG-4 ASP (DivX, Xvid) may use "packed bitstream". AFAIK, there is no "packed bitstream" for H.264 video in an AVI container (probably because nobody wanted to implement the idea ).

    H.264 video in AVI is, essentially, the same thing as H.264 video in a transport stream. For the VfW "interface" (so to speak), the problem now is not only the B-frames, but also the multiple reference frames, the B-pyramids, etc. But the ancient and obsolete Video-for-Windows is not the only way to access an AVI file. Windows Media Player itself does not use VfW, except as a "last resort". Both MPC-HC and MPC-BE use DirectShow for dealing with AVI files. Also, keep in mind that the ASF container (pseudo-renamed to "WMV" by Microsoft) is just a glorified AVI, and is as unsuitable as AVI for storing video formats that use B-frames

    http://forum.doom9.org/showthread.php?t=120407

    http://forum.doom9.org/showthread.php?p=1523574#post1523574
    Last edited by El Heggunte; 8th Nov 2016 at 05:14. Reason: one more URL :-)
    Quote Quote  
  5. The word "hack" does not mean it is bad. The order of frames in AVI must be extracted from avc stream. So what? There is enough software that does it.
    The "VirtuaDub hack" option is another story (extension for delayed output from codec) and is not just for VirtualDub, any program may implement it. If it works use it.
    Quote Quote  
  6. I wasn't sure if "packed bitstream" had ever been implemented for AVC in an AVI. Thanks for the info El Heggunte. It's good to know for certain it hasn't.
    Quote Quote  
  7. Originally Posted by shekh View Post
    The word "hack" does not mean it is bad. The order of frames in AVI must be extracted from avc stream. So what? There is enough software that does it.
    I'd agree in principle. I have lots of AVIs with Xvid encoded video and packed bitstreams. Hardware player support is so universal it's almost hard to think of it as being a hack any more.... it's just how it works..... but not so much for AVC in an AVI. If you're only ever going to be using a PC for playback it doesn't matter too much, but still.... even if I was writing AVC to an AVI file when encoding I'd probably want to remux it as an MP4 or MKV at some stage so it can be played using a device that isn't a PC.
    Quote Quote  
  8. I suspect OP is using it as intermediate anyway.
    Quote Quote  
  9. Member
    Join Date
    Mar 2014
    Location
    Brazil, Rio de Janeiro
    Search Comp PM
    So... from what I gather, if I use x264's lossless mode I will be safe?
    Quote Quote  
  10. Originally Posted by synnchan View Post
    So... from what I gather, if I use x264's lossless mode I will be safe?
    not necessarily ; it depends on how it's going to be used and what programs

    By default, x264's lossless mode --qp 0 (or --crf 0) uses long gop with b-frames to increase compression . So that will lead to the same problems with decoding in susceptible programs ( green frames, black frames, out of order frames, out of sync...) . Some programs will have no problems

    Also, many programs cannot decode AVC lossless mode properly

    Using all I-frames (instead of long gop) will make out of order decoding less likely in AVI container . But that will significantly reduce compression efficiency .

    Some people suggest disabling b-frames, but even p-frames can cause problems in some programs (e.g. vegas) with out of order decoding (mixed up frames). You can find many threads on this on various forums.
    Quote Quote  
  11. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by El Heggunte View Post
    ...Also, keep in mind that the ASF container (pseudo-renamed to "WMV" by Microsoft) is just a glorified AVI, and is as unsuitable as AVI for storing video formats that use B-frames
    Not quite true. Whatever it's faults, ASF/WMV is a completely reworked container format and uses both extensible GUID headers/metadata and DOES fully support B-frames. It was built with streaming in mind (in answer to RealMedia), which makes use of extended runs of B-frames. Couldn't say whether multi-reference or pyramid features are there, though.

    Of course, for best use of AVC & HEVC, I'd suggest using MP4 or MKV containers, both of which have much more thorough & robust support for complex codecs than AVI (as well as better modern player support).

    Scott
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    By default, x264's lossless mode --qp 0 (or --crf 0) uses long gop with b-frames to increase compression.
    It does? My tests say it doesn't use b frames at all. Please re-check.
    Quote Quote  
  13. Originally Posted by sneaker View Post
    Originally Posted by poisondeathray View Post
    By default, x264's lossless mode --qp 0 (or --crf 0) uses long gop with b-frames to increase compression.
    It does? My tests say it doesn't use b frames at all. Please re-check.
    You're right, I,P only in lossless mode . For both CLI and VFW
    Quote Quote  
  14. Member
    Join Date
    Mar 2014
    Location
    Brazil, Rio de Janeiro
    Search Comp PM
    Okay guys, so this is what I did:

    1) Capture the game in VFW H264 - Superfast preset (beause Ultrafast fails on certain games) - Keep/Accept only RGB - Single pass lossless - Zero Latency checked.

    2) Drag and Drop the .avi into VirtualDub - use the Resize Filter to increase the video's resolution by 8x - Select x264vfw as video compression method (select Convert to YUV 4:2:0 under x264vfw configuration instead of RGB so the video will play everywhere) - Save as AVI.

    3) Drag and Drop the new .avi into Avidemux - Select "Copy" as Video Output - Select "AAC (Faac)" as Audio Output - Select "MP4 Muxer" as Output Format - Save the .mp4.

    And that's all. Since the final video will be stored into .mp4 instead of .avi, will things be fine then?

    P.S. Here is a video showing my whole process step by step: https://www.youtube.com/watch?v=6LI9HmzNBdA
    Quote Quote  
  15. Yes, remuxing it into a suitable container will fix the problems associated with AVC in AVI, but not all programs or devices accept lossless AVC. So it still depends on how you 're going to be using it
    Quote Quote  
  16. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by Cornucopia View Post
    Originally Posted by El Heggunte View Post
    ...Also, keep in mind that the ASF container (pseudo-renamed to "WMV" by Microsoft) is just a glorified AVI, and is as unsuitable as AVI for storing video formats that use B-frames
    Not quite true. Whatever it's faults, ASF/WMV is a completely reworked container format and uses both extensible GUID headers/metadata and DOES fully support B-frames. It was built with streaming in mind (in answer to RealMedia), which makes use of extended runs of B-frames. Couldn't say whether multi-reference or pyramid features are there, though.

    Of course, for best use of AVC & HEVC, I'd suggest using MP4 or MKV containers, both of which have much more thorough & robust support for complex codecs than AVI (as well as better modern player support).

    Scott
    Hmmmm, some moons ago, a Doom9 moderator, namely foxyshadis, wrote more or less the same things you said here today. But apparently he forgot to stress that the full features of the ASF container were defined only for the second version of the ASF specification... which almost nobody uses — with Micro$oft themselves not being the exception to the rule.

    P.S.:

    Originally Posted by benwaggoner
    When I was at Microsoft we made an official decision not to support H.264 in ASF as ASF was not a friendly container for content where the display and decode order was different. Even supporting B-frames in VC-1 for ASF was quite the hack.

    That was a primary reason why Smooth Streaming used fMP4 from the get-go instead of ASF.
    source: http://forum.doom9.org/showthread.php?p=1654802#post1654802
    Last edited by El Heggunte; 8th Nov 2016 at 18:36. Reason: add P.S.
    Quote Quote  
  17. Member
    Join Date
    Mar 2014
    Location
    Brazil, Rio de Janeiro
    Search Comp PM
    Just to clarify: if a program/device/whatever doesn't support it, the video won't even play at all, right? or will it still play but bugged/glitched or something?
    Quote Quote  
  18. Originally Posted by synnchan View Post
    Just to clarify: if a program/device/whatever doesn't support it, the video won't even play at all, right? or will it still play but bugged/glitched or something?
    Yes, it won't even play if it's not supported
    Quote Quote  



Similar Threads

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