フィルターのクリア

Reading video file compressed losslessly with x264

11 ビュー (過去 30 日間)
Till
Till 2014 年 11 月 27 日
回答済み: Walter 2019 年 6 月 19 日
As the title suggests, I have a problem reading video frames from a video file compressed losslessly with x264. I am using MATLAB 2014b.
I have used x264 lossless compression in VirtualDub. The result is a video file that plays fine in VLC and can also be reopened in VirtualDub. I can also succesfully create a VideoReader object referencing to this video file. The VideoReader object gives me the correct video properties like FrameRate, Width, Height, and so forth. It even has the correct NumberOfFrames property.
However, when I first try to read frames from the object, MATLAB generates an error:
Error using VideoReader/readFrame (line 105)
No more frames available to read from file.
The same happens when I try the older command "read" and explicitly refer to frames I want to read (i.e. the first frame or the last frame, using Inf).
Interestingly, when I compress the same source video file with x264 and use the highest quality setting, i.e. almost lossless while keeping the other settings the same, then MATLAB is able to read frames from the compressed video.
Is that a bug? Do I need to adjust some settings in my codecs or is there another workaround?
Thanks in advance!
Till
  1 件のコメント
Gaszton
Gaszton 2016 年 1 月 29 日
Hi!
i just ran into the exact same problem.
Must be a bug.

サインインしてコメントする。

回答 (2 件)

Sergey Salishev
Sergey Salishev 2018 年 5 月 24 日
It seems that the problem is due to pixel format yuv444.
I converted using the ffmpeg with the following command line and it magically works
ffmpeg -i %1.mkv -c:v libx264 -pix_fmt yuv420p -map 0:v:%2 %1_%2.mkv

Walter
Walter 2019 年 6 月 19 日
THe recommendation by Sergey did not work for me on R2018a

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by