0

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?

asendjasni
  • 963
  • 1
  • 16
  • 36

1 Answers1

1

Use

ffmpeg -i in.h265 out.y4m

If you need to pipe it,

ffmpeg -i in.h265 -f yuv4mpegpipe -
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • I used the second command `ffmpeg -i galleon_422_cif_out.h265 -f yuv4mpegpipe out.y4m` The size of thz original video was : 73 MB. The size of the output after encoding and decoding is : 869,8 MB. Is that normal ? – asendjasni Mar 15 '17 at 12:47
  • Yes, Y4M is uncompressed full raster. – Gyan Mar 15 '17 at 12:57
  • Sorry to bother you with another question, could you explain more, the original and the final output are in the same format, so why there is a large difference in size ? 73 <<<< 869,8 – asendjasni Mar 15 '17 at 13:03
  • Show the full console output of the Y4M -> 265 and 265 -> Y4M encodes. Although I see that you rescaled the input when encoding to 265. – Gyan Mar 15 '17 at 13:13
  • The console output is too long for a comment, do you want me to add it in the question ? – asendjasni Mar 15 '17 at 18:06
  • Yes, that's the usual method. Use code formatting. – Gyan Mar 15 '17 at 18:10
  • Sorry couldn't edit it, I just create a repo on github for this, so please take a look at this link [encoding output](https://github.com/sendja-3360/test/blob/master/console_output). – asendjasni Mar 15 '17 at 18:35
  • 1
    Your source is 352x288 and 265 output is 1600x900. So, you should expect a 1600*900/352/288 = 14.20x increase – Gyan Mar 15 '17 at 18:56
  • Ok I understand? If I may another question, what did you mean by **pipe**. – asendjasni Mar 15 '17 at 19:08
  • ffmpeg can output to stdin of another app if it accepts such input. No file creation needed. – Gyan Mar 15 '17 at 19:30
  • Didn't understand at 100%, but thanks for your answers and your time, I really appreciate it. – asendjasni Mar 15 '17 at 19:43