12bit lossless encoding or decoding problem

Issue #174 resolved
Selur created an issue

just did some tests with 12bit lossless encoding

ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv420p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --no-open-gop --lossless --no-deblock --colormatrix bt470bg --output "h:\Temp\i420_11_09_37_5310_01.265"

and noticed that either libav (tried ffplay, mplayer, mpc-hc) can't handle 12bit lossless encoding atm. or there is something off with the encoding.

-> is it same to encode 12bit lossless content now (since it's only a libav problem) or should I hold back (since it might be a x265 problem)

Comments (7)

  1. Deepthi Nandakumar

    x265 encode should be safe, probably slow. Were you able to decode successfully (maybe with the HM decoder)?

    We havent tried libav playback yet.

  2. Selur reporter

    Will have to do some additional testing, just encoded another clip with the same (different resolution) settings and I could decode it without a problem. -> will do some additional testing and redo my initial encodes (and report back once that is done)

  3. Selur reporter

    I encoded a clip (test.avi), using:

    HEVC encoder version 1.7+431-f63273fa3137
    build info [Windows][GCC 5.2.0][64 bit] 12bit
    
    ffmpeg version N-74406-g8a8aee3 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 5.2.0 (Rev3, Built by MSYS2 project)
    

    and the following calls:

    i420_lossless:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv420p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --no-open-gop --lossless --no-deblock --colormatrix bt470bg --output "H:\Output\i420_lossless_14_30_44_2610_01.265"
    

    i422__lossless:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv422p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --input-csp i422 --no-open-gop --lossless --no-deblock --colormatrix bt470bg --output "H:\Output\i422_lossless_14_30_59_6810_01.265"
    

    i444_lossless:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv444p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --input-csp i444 --no-open-gop --lossless --no-deblock --colormatrix bt470bg --output "H:\Output\i444_lossless_14_31_14_0310_01.265"
    

    i420:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv420p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --no-high-tier --no-open-gop --psy-rd 1.000 --cu-lossless --colormatrix bt470bg --output "H:\Output\i420_14_31_43_3810_01.265"
    

    i422:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv422p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --input-csp i422 --no-high-tier --no-open-gop --psy-rd 1.000 --cu-lossless --colormatrix bt470bg --output "H:\Output\i422_14_31_55_2810_01.265"
    

    i444:

    ffmpeg -y -loglevel fatal -threads 8 -i "F:\TestClips&Co\test.avi" -map 0:0 -an -sn -vsync 0 -r 25 -strict -1 -pix_fmt yuv444p12le -f rawvideo - | x265 --pmode --pme --input - --output-depth 12 --input-depth 12 --input-res 640x352 --fps 25 --input-csp i444 --no-high-tier --no-open-gop --psy-rd 1.000 --cu-lossless --colormatrix bt470bg --output "H:\Output\i444_14_32_05_6210_01.265"
    

    Playing back i420, i422, i444 is no problem with latest libav (in example through ffplay, mpc-hc,..), but playback of the X_lossless clips is broken.

    Uploaded the clips (input&output) to my google drive: https://drive.google.com/folderview?id=0B_WxUS1XGCPASUZibG5XZkRfeTg&usp=sharing (~188MB - twelveBitTests.7z)

    Strange thing is that I also encoded a 1080p source and for that the 12bit lossless encodes all play fine. -> so, this might be at least indirectly be related to the resolution

    Cu Selur

  4. Deepthi Nandakumar

    Oh ok. There's a parallel issue on lossless, no doubt related. Likely the qg-size fix needs more tweaking.

  5. Deepthi Nandakumar

    Has this issue been fixed at your end? We're not aware of any more bugs with lossless mode.

  6. Log in to comment