Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
15th December 2013, 18:01 | #1 | Link |
Registered User
Join Date: Jan 2012
Location: Sweden
Posts: 18
|
x264 crf and Matlab processing
Hi,
Did anyone experienced the following problem or know how to resolve it? 1. I encode a video using the following: >> ffmpeg -i input -c:v libx264 -preset slow -crf 22 -c:a copy output.avi 2. The generated *.avi needs to processed by using Matlab. One reason is to compute VQM metric of it. So, I do like this: >>vid1=VideoReader('*.avi'); >> frame_vid1=read(vid1,1); Following error occurs: Error using VideoReader/read The frame index requested is beyond the end of the file. What can be the solution? |
15th December 2013, 19:17 | #2 | Link |
Registered User
Join Date: Oct 2009
Location: San Francisco, CA
Posts: 99
|
This is most likely due to H.264/AVC being muxed into an AVI file. AVI requires "hacks" to play formats with b-frames as the frames are not stored in the same order that they are displayed. Either ffmpeg doesnt apply these "hacks" or the AVI reader on your system cannot understand these changes (or both).
Does matlab support opening MP4 files or MKV files? If not, you should complain to the matlab people since the AVI format is about 10 years out of date. |
15th December 2013, 20:57 | #3 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Can Matlab not read MP4 files by now? If not, you could first decompress the H.264 file to a lossless format, like HuffYUV. This should work fine from AVI.
BTW: You can calculate VQM with the MSU Video Quality Tool, which supports Avisyth input. So you can easily load pretty much everything, e.g. via FFMS2 plug-in or via DirectShowSource.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 15th December 2013 at 21:58. |
16th December 2013, 18:03 | #5 | Link | |
Registered User
Join Date: Oct 2009
Location: San Francisco, CA
Posts: 99
|
Quote:
I would think they would put in an error message that was a little more descriptive, though. |
|
16th December 2013, 18:26 | #6 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Well, according to the docs they support quite a lot:
Quote:
What technology do they use to decode AVI files? If it's supported on all platforms, it must be an internal decoder. But then only specific formats are supported. The docs don't have any details on this. Maybe they even support "raw" (uncompressed) AVI files only?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 16th December 2013 at 18:31. |
|
17th December 2013, 03:28 | #7 | Link |
Registered User
Join Date: Oct 2009
Location: San Francisco, CA
Posts: 99
|
Its also possible that ssuave isnt running on windows. Matlab does run on unix/linux and OS X.
If thats the case, you might have to poke Mathworks and see if they are willing to maybe add that in to their next version. |
Tags |
matlab, x264 |
|
|