19

What are the ideal settings to take advantage of the hardware decode abilities of the processor and still steer clear of any features that would require software decode or inability to correctly decode in hardware?

For example, I know that B-Frames are often not handled well (or at all) on many mobile devices and the same is true for the CABAC encoding scheme.

6
  • Well your question is ambiguous. Asking it on Raspbery Pi Q&A we will give you and answer for the best settings for the Pi.. not mobile phones or any other devices. Please edit your question.Still a very good question!
    – Piotr Kula
    Commented Aug 18, 2012 at 21:56
  • 3
    I am asking specifically for the Raspberry Pi and the RaspBMC distro - I simply provided the mobile references as context for features that may not be available as the hardware is rather similar.
    – Goyuix
    Commented Aug 18, 2012 at 22:14
  • 1
    I just ran a test with a 720p source and the "High Profile" default settings. That included both B-Frames and CABAC encoding. It played just fine on RaspBMC. I'll keep investigating some other options.
    – Goyuix
    Commented Aug 19, 2012 at 0:34
  • That is really great. I think th Pi should be able to handle most standard encoding defined in handbrake. How do you test it? I am going to try some 1080p encodin
    – Piotr Kula
    Commented Aug 19, 2012 at 11:19
  • I think the first step would be to find out what your decoder can and will do using hardware.
    – XTL
    Commented Aug 20, 2012 at 6:06

2 Answers 2

7

To answer your question, any H.264 encoding will work perfectly on the Raspberry Pi. So you have to select (whatever profile you pick, best high profile or normal) the H.264 option in the tab Video under Video codec. For audio use AAC (supported) and pick stereo (Dolby surround doesn't work).

Using those settings (tested it myself) everything plays nice and smooth, no problems at all. Other options like frame rate can influence the movie a lot, a guide on frame rate: https://trac.handbrake.fr/wiki/FramerateGuide

I think that will help you, remember video codec on H.264 and audio on stereo AAC. Check your frame rate and other options will generally affect the size of the video.

5
  • 1
    Don forget to enable optimize for web in handbrake. Really got for skipping forward/back in the stream or streaming via HTTP to HTML5 video plays.. My Pi is a PiTube
    – Piotr Kula
    Commented Sep 21, 2012 at 11:36
  • 3
    I was really hoping for a more detailed discussion on specific x264 settings - I specifically mentioned B-Frames and CABAC encoding - that would be acceptable. Perhaps my question is too vague... for example I would pick different settings if I was using it primarily over the composite video out instead of HDMI, but I don't feel like I can accept your answer as it stands today. The notes on stereo AAC audio are perfect. I was hoping for something similar with the x264 advanced options as well.
    – Goyuix
    Commented Sep 26, 2012 at 15:45
  • I think you don't really get the concept of the extra options like B-Frames. For all the settings and explanations (and what they do) mewiki.project357.com/wiki/X264_Settings For example B-frames are "B-frames are similar to P-frames, except they can use motion prediction from future frames as well. This can lead to significantly better efficiency in terms of compression ratio." This has nothing to do with playing the video on the raspberry pi but rather with compression size. Don't really know if it you need more processing for HDMI out or composite out.
    – DanFritz
    Commented Sep 26, 2012 at 20:12
  • 1
    My experience has been that low powered devices (smart phones / iOS devices primarily) is that videos encoded with x264 that employ B-Frames or that utilize CABAC encoding will not play back properly due to hardware / software limitations. There is definitely a sweet spot between efficiency as you mentioned and a file that won't play back due to some advanced feature not be supported by the decode engine. I am hoping to find that "sweet spot" for the Raspberry Pi. My own testing has been very positive so far (High Profile with lots of bells and whistles enabled), though not definitive.
    – Goyuix
    Commented Sep 29, 2012 at 17:56
  • "any H.264 encoding will work perfectly on the Raspberry Pi." - is unfortunately NOT true. See this for a good example. What is even worse the 4.1 level, which should supposedly be supported w/o problems seems to have them too. At least I've got a 4.1 file that doesn't play at all in Kodi on Rpi.
    – silverdr
    Commented Nov 19, 2016 at 19:26
2

For future reference of anyone who's looking a detailed answer to this same question, please refer to this post on the Raspberry Pi forums: https://www.raspberrypi.org/forums/viewtopic.php?f=2&t=4668

Summary: The RPi supports H.264 Level 4.1 High Profile. If you select these options on the Video page of handbrake, the Pi should play them.

You should make sure that the audio is encoded with AC3 rather than DTS, or you might run into playback issues: see this question: Difference between H.264 and x264 and how to play it

Cheers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.