How to decode HEVC files to YUV?

*爱你&永不变心* 提交于 2019-12-01 20:44:30

问题


I would like to decode HEVC encoded files to YUV files.

Is there any simple way to do this yet? An executable would be nice but I would make do with source code that is easily compilable.


回答1:


It's as simple as (guide assumed linux, tweek it to your needs)

  1. Clone the official reference codec (the official-official is a svn-repo found at https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/trunk/ but a read-only git-repo that is kept in sync with the svn is provided by BBC which is so much easier to work with IMHO)

    git clone git://hevc.kw.bbc.co.uk/git/jctvc-hm.git
    
  2. To create the executables:

    cd jctvc-hm/build/linux && make -f makefile
    
  3. Binaries are now placed in

    jctvc-hm/bin
    
  4. Now, to decode a HEVC-encoded binary file into YCbCr, do

    ./TAppDecoderStatic -b encoded_file.bin -o reconstructed.yuv
    

If you are not on a linux system, just goto the build folder and you will hopefully find something you can use for your system:

$ cd jctvc-hm/build && ls
HM_vc10.sln  HM_vc8.sln  HM_vc9.sln  linux/  vc10/  vc8/  vc9/



回答2:


Follow the instructions on https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/branches/HM-9.2-dev/doc/software-manual.pdf, the source code can be downloaded from https://hevc.hhi.fraunhofer.de/svn/svn_HEVCSoftware/trunk/ by using any subversion software.

You can build it on both Windows and Linux based OS. After you built the software, you may run the exe files as it is instructed on the software manual.




回答3:


Alternatively, you can use libde265 as a much faster decoder.

  1. Get the latest version from its github release page.
  2. Configure with ./configure --disable-sherlock265
  3. Compile: make

Generate the YUV file with

./dec265/dec265 hevc-file.bin -o output.yuv -t4

The option -t4 is for multi-threaded decoding. You can also do more things like input NAL-unit streams, dump the headers, directly display the video, or check the SEI hashes.




回答4:


You can download the ffmpeg windows build exe file simply decoding HEVC bitstream.

ffmpeg.exe -i xxx.bin out.yuv


来源:https://stackoverflow.com/questions/19298219/how-to-decode-hevc-files-to-yuv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!