5

I'm trying to create a screencast for playback on the web. Would like to use h.264, webm, and ogg. The source files are in the Apple Animation codec, and they look perfectly accurate. However when I try to convert to mp4 using ffmpeg lossless settings, there is some definite degradation. It seems to be because the source is RGB and ffmpeg auto-selects yuv420p instead.

Incompatible pixel format 'rgb24' for codec 'libx264', auto-selecting format 'yuv420p'

Anyone know how to get the same color accuracy with mp4/h.264 as with Apple Animation?

Thanks

3 Answers 3

4

H.264 does support true lossless compression (see 'Lossless mode' on this page). It seems that to avoid chroma format conversion, you need to encode using the Hi444PP profile, which accepts RGB pixels. However, a cursory search indicates that x264 doesn't support Hi444PP (yet), whereas some commercial codecs like MainConcept do.

2
  • Seems like maybe a high bitrate would be a good alternative. Of course the OP has long since dealt with this problem one way or another by now. Commented Feb 25, 2013 at 21:28
  • That page you report says something different, h264 lossless exists using an option like -qp 0 and also h264rgb could be achieved for example in libx264rgb. A question could arise: Do this kind of video compatible everywhere and played correctly? Depends, often no unless they support all the range of possible decoding, all softwares based on ffmpeg and ffshow can however, including VLC. Commented Nov 5, 2015 at 9:20
0

If you need something less complicated try rec, which is mine :) https://sites.google.com/site/joopeter/

It is also free, lossless but more efficient and accurate!

2
  • It works only on Windows Commented Nov 11, 2014 at 5:04
  • @Peter You could improve your answer by giving a little more detail about what rec is and how it works.
    – stib
    Commented Feb 18, 2015 at 6:17
0

if you want yuv444p try something like this: "-vcodec libx264 -pix_fmt yuv444p"

LosslessH.264 seems to imply that lossless (or practically lossless) is available via -qp 0

2
  • You can also use -crf 0 with 8-bit builds of x264. The only reason -qp is used instead is because 10-bit builds of x264 uses different values for -crf (I believe -crf -12 for 10-bit would be lossless) to achieve a similar visual quality.
    – llogan
    Commented Jan 16, 2014 at 18:42
  • just a note about yuv444p, it's not as widely supported as yuv420 so depending on what you're doing with the video next, this can cause issues (e.g. Apple Quicktime, iMovie, and devices can't handle yuv444) Commented Jan 9, 2015 at 1:53

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.