VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Hi,
    is this some known problem about encoding/playback in certain h264 avi files:

    It seems several players (latest vlc, latest k-lite, ffdshow, windows media..) can't play a constant frame rate, at least at 18fps?
    Instead the fps seems to fluctuate - overall keeping roughly an average of 18fps - but it doesn't look so good obviously.
    Only MPlayer (MPUI) so far plays the files perfectly smooth.
    The faulty playback becomes pretty obvious in slow motion - e.g. at 1/8 speed - where some frames are displayed much longer than others.

    All players and other tools say the files are 18.0 fps, so I can't see a problem why players just cant't play them with constant rate. The processor load (double-core) keeps below 20%.

    In case it matters:
    I encoded the files from single (jpg) frames from mjpg, using mencode, then from mjpg to h264-avi using virtualdub. No audio stream.
    Quote Quote  
  2. Member edDV's Avatar
    Join Date: Mar 2004
    Location: Northern California, USA
    Search Comp PM
    18 fps is incompatible with most computer (60Hz) or TV (50/60Hz) displays. It must be converted. Why are you using it?

    Legacy super8 film used 18 fps. The typical method to sync 18 fps to 60Hz (without judder) is to slow projection to 15 fps then project each frame 4x to equal 60. Downside is the video will run at 83% speed.

    A second approach is to repeat frames in a compatible sequence to build to 60fps but these techniques produce uneven fps playback.
    Recommends: Kiva.org - Loans that change lives.
    http://www.kiva.org/about
    Quote Quote  
  3. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    I'm not playing on TV screen but on a PC. The movie was filmed 18 fps so I'm replaying 18 fps - which is generally not a problem.
    Quote Quote  
  4. Originally Posted by streamsaver View Post
    It seems several players (latest vlc, latest k-lite, ffdshow, windows media..) can't play a constant frame rate, at least at 18fps?
    Every player I know of can play 18 fps reasonably well, with 3:3:4 frame repeats. Of course, that's inherently jerky because of the low frame rate, and has a slight judder from the uneven frame duration. If you're seeing something worse than that there's something wrong with your file or the way your computer is set up.

    Are you making these files yourself? And they're h.264 in AVI? AVI is an unusual container for h.264 video. Try turning on or off the "VirtualDub Hack" if you're making the files yourself. Or remux into another container like MKV. Try the attached files. The Xvid AVI is there as a reference -- it's more likely to play properly.
    Attached Files
    Last edited by jagabo; 27th May 2012 at 11:40.
    Quote Quote  
  5. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Thanks, all 3 test files play smoothly in all of my players. Also in any 1/2, 1/4, 1/8 slow-mo they keep stable fps as it should be.
    Since it is only a single stream, no sound - could it still be a mux problem?
    I wonder if it could be related to the high res 1080p that cause a problem for some players under certain conditions.
    Quote Quote  
  6. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    I wonder if it could be related to the high res 1080p that cause a problem for some players under certain conditions.
    what are your computer specs ?
    Quote Quote  
  7. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Ok, we can skip some things. The problem seems to be specifically in the x264 codec I'm using. I made some tests reencoding

    with another XVID encoder --> now playback OK

    so back again reencoding with x264...

    to VGA resolution --> no change (instable)
    with VirtualDubHack unchecked --> no change
    with --tune zerolatency --> playback OK!
    with --fps 18, --force-cfr --> no change

    so maybe related to frame type/order messed up or something where MPlayer doesn't rely on?
    Quote Quote  
  8. Try the latency options at the end of this page:

    http://mewiki.project357.com/wiki/X264_Encoding_Suggestions

    That should help you isolate the problem.
    Quote Quote  
  9. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Yep, after a lot of testing: it only works with bframes disabled i.e. --bframes 0. Don't have any clue what's wrong with those B-frames however.
    Quote Quote  
  10. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    b frames can give many problems in AVI container - so called "bframe decoder lag" - hence the use for hacks , and green frames with other decoder problems

    did you try remuxing the same problem video into different container as suggested? (mkv or mp4 for example)

    why the convoluted mencoder to mjpeg then vdub using x264 vfw route ? why not do it in 1 step ? (mencoder can encode, and vdub can read image sequence, so either should work)

    what version of x264vfw are you using ?
    Quote Quote  
  11. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Yea I tried the x264 options --mux mkv/mp4 in vdub with no success.
    The mjpg files are stored as lossless 'master copy' of the films.
    The libx264 core 122 r2184bm probably came with the K-Lite pack. I had a standalone one before, I think!?

    What would be the cost of disabling B-frames?
    Quote Quote  
  12. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by streamsaver View Post
    Yea I tried the x264 options --mux mkv/mp4 in vdub with no success.
    The mjpg files are stored as lossless 'master copy' of the films.
    The libx264 core 122 r2184bm probably came with the K-Lite pack. I had a standalone one before, I think!?
    I guess the question is why are you using vdub at all? Why not encode with mencoder as well ?



    What would be the cost of disabling B-frames?
    Loss of compression efficiency

    So it will depend on the source characteristics and encoding settings. If you were using lower bitrates(higher quantizer): there will be more quality loss; but at high bitrates less quality loss . At very high bitrates relative to source complexity, quality will actually be slighty better without b frames at a given bitrate



    This obviously doesn't occur using bframes with mp4 or mkv for everyone else, so I think something else is going on here

    Did you try mkvtoolnix/mkvmerge ? or mp4box/yamb to remux ?

    The latest VLC versions are reported to be problematic, and WMP depends on your system directshow configuration (which may or may not be configured properly).

    Mplayer and GUI's around Mplayer (SMplayer) can work more consistently because they run independent of your system config

    Try something like MPCHC using it's internal decoder configuration, with a mkvtoolnix rewrapped file (or encode to mkv or mp4 in the first place with x264 CLI)
    Last edited by poisondeathray; 27th May 2012 at 20:50.
    Quote Quote  
  13. I personally use r1629 version of x264vfw which always worked perfectly. The newer versions cause problems and tangle up the frames on playback. I never investigated why, just switched back to r1629 like I always do when installing the latest K-lite.
    Quote Quote  
  14. Member
    Join Date: Jul 2008
    Location: Germany
    Search Comp PM
    Yep, I just noticed that older h264-avi videos I encoded with different x264 versions behave better in this question. On some of them only VLC stutters, even older ones run smooth on any decoder. However there's no way back in long term.

    Thanks for the hints! After some more hours of testing, some more results:
    Changing splitters/muxers had no effect here. Some players/decoders just want to see the h264 track in a mkv or mp4 container for some reason. E.g. MPlayer, LAV-decoder don't care about the container format but VLC, libavcodec produce stutter.
    Changing the container to mp4 or mkv didn't produce working results with avidemux but mkvtoolnix, mp4box did the job so the films run smoothly with any decoder software after all.
    Last edited by streamsaver; 29th May 2012 at 10:30.
    Quote Quote  



Similar Threads