Search code examples
matlabffmpegvideo-processingdecodinglibx265

Decode a h265/HVEC bitstream to rawvideo(Y4M)


I encoded a raw video in Y4M format with the following command on Matlab

system(['ffmpeg -i ' videoNameIn, videoTypeIn, ' -s ' num2str(width),'x',num2str(height), ' -r ', num2str(frameRate), ' -c:v libx265 -preset ultrafast',  videoNameOut, videoTypeOut]);

The output is in .h265. Now I want to decode it to the original format which means Y4M, how can I do that?


Solution

  • Use

    ffmpeg -i in.h265 out.y4m
    

    If you need to pipe it,

    ffmpeg -i in.h265 -f yuv4mpegpipe -