Why does not the video working from ffmpeg in matlab?

6 views (last 30 days)
I encoding video with program HandBrake. Then I read this video in Matlab and everything works properly. I encoding video with program ffmpeg. Matlab reads only black frames. Both encoders are h.264 (mp4). Both videos play fine in VLC.
ffmpeg code:
ffmpeg -i Barrier.avi -c:v libx264 -b:v 500k outputt5.mp4

Accepted Answer

Muhammad
Muhammad on 5 Sep 2018
Use the video filter for making sure that your output is in YUV420 format (in FFMPEG: -vf format=yuv420p). When you use the yuv444 or yuv422 formats then MATLAB is unable to read the videos properly.
FYI: Did this on MATLAB 2016b and 2017b.
Hope it helps!

More Answers (1)

Walter Roberson
Walter Roberson on 7 Mar 2016
Historically there have been some problems with videos that sometimes seem to go away if you use a video editing tool to delete the first frame. No promises.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!