Effacer les filtres
Effacer les filtres

Reading video file compressed losslessly with x264

11 vues (au cours des 30 derniers jours)
Till
Till le 27 Nov 2014
Réponse apportée : Walter le 19 Juin 2019
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 commentaire
Gaszton
Gaszton le 29 Jan 2016
Hi!
i just ran into the exact same problem.
Must be a bug.

Connectez-vous pour commenter.

Réponses (2)

Sergey Salishev
Sergey Salishev le 24 Mai 2018
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 le 19 Juin 2019
THe recommendation by Sergey did not work for me on R2018a

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by