Log in

View Full Version : Why my x264 video sometimes becomes choppy & how to solve it ?


guista
1st January 2011, 20:41
Hi all,

I used to reencode my bluray disks using x264/MeGUI.
I do this so I can play it on my multimedia box. After several tries, I determined that if the input video rate is more than 5500 bps then the video played on my box is choppy.
To be under this limit I reencode my blurays at 5000 bps and it works fine except some (rare) cases when the video becomes choppy for a few seconds.

This happens on some specific scenes of a movie, specially on the rough sea scenes or stormy sky scenes.
I suppose this is because on a rough sea/stormy sky, many pixels are changing from one picture to another so the x264 codec have to increase the bitrate to preserve the quality. Because my box can not work correctly at a vbr greater than 5500 bps, the resulting video is choppy.

* Could you confirm I am right (cf. my x264 command line) ?

I suppose this is because x264 works with a variable bit rate.

* What would happen if I changed the "--vbv-maxrate" to 5000 (equals to "--bitrate 5000") instead of 50000 (the default value set by MeGUI) so I finally set a fixed bit rate ?

Thanks in advance for your help.


My x264 command line:

x264.exe --level 4.1 --preset fast --pass 2 --bitrate 5000 --stats ".stats" --deblock -1:-1 --b-pyramid none --vbv-bufsize 50000 --vbv-maxrate 50000 --no-mbtree --direct auto --subme 4 --trellis 0 --output "output" "input"

nurbs
1st January 2011, 21:02
What is your multimedia box? It's basically impossible to buy hardware these days that can't handle moderate bitrates like 5500 kbps.
I can't confirm that it is a player issue from your command line, but if you are looking for comments use
x264.exe --level 4.1 --preset faster --pass 2 --bitrate 5000 --stats ".stats" --deblock -1:-1 --vbv-bufsize 50000 --vbv-maxrate 50000 --output "output" "input"
That way you don't turn off very useful stuff like mb-tree and will get about the same speed.

Setting --vbv-maxrate to 5000 will not necessarily limit the local bitrate to below 5500 kbps.

Mounir
1st January 2011, 23:42
Let me guess, the video is stored and played from a usb flash drive

nurbs
2nd January 2011, 00:07
And if it was how would that be a problem? Even the cheapest flash drive should manage more than 10 MB/s read speed. That's an order of magnitude more than the average bitrate of that video.

LoRd_MuldeR
2nd January 2011, 00:14
And if it was how would that be a problem? Even the cheapest flash drive should manage more than 10 MB/s read speed. That's an order of magnitude more than the average bitrate of that video.

Well, for continuous playback you need a worst case read speed of at least your movie's bitrate (or more specifically: of at least your VBV MaxRate).

If the flash drive can't guarantee the required minimum read speed, you can get occasional playback stutter, even if the average read speed seems to be perfectly okay.

guista
2nd January 2011, 13:03
What is your multimedia box? It's basically impossible to buy hardware these days that can't handle moderate bitrates like 5500 kbps.

This is my (French) ISP box which can handle TV and video and allow the user to plug a USB hard disk on it.
I put my MKV video on the hard disk and can play it on my TV thanks to the box.

This is a box isssue (or limitation) : if I plug the same hard disk on my computer on play the movie on it, everything is fine. I can play the movie from the begining to the end without any problem.

* Do you confirm that the bit rate is variable and can be higher than my specified bit rate of 5000 bps ?

nm
2nd January 2011, 13:10
* Do you confirm that the bit rate is variable and can be higher than my specified bit rate of 5000 bps ?
Certainly. You have specified an average bitrate of 5000 kbps, and a maximum bitrate of 50 Mbps with a 1 second buffer. The bitrate could easily climb to 10..20 Mbps in a difficult scene.

Try --bitrate 5000 --vbv-bufsize 15000 --vbv-maxrate 15000, or if that doesn't help, lower the vbv settings further.



* What would happen if I changed the "--vbv-maxrate" to 5000 (equals to "--bitrate 5000") instead of 50000 (the default value set by MeGUI) so I finally set a fixed bit rate ?

You'd get CBR and pretty bad quality overall. If your box only has problems in few scenes, I think it can handle at least 8 Mbps.

guista
2nd January 2011, 20:42
The bitrate could easily climb to 10..20 Mbps in a difficult scene.

Thanks for confirming this point.

Try --bitrate 5000 --vbv-bufsize 15000 --vbv-maxrate 15000, or if that doesn't help, lower the vbv settings further.
You'd get CBR and pretty bad quality overall. If your box only has problems in few scenes, I think it can handle at least 8 Mbps.

Following your advices, I am even going to set the max vbv to 8000 so I am sure my box will handle it correctly.