readOneFrame error
pavan4 opened this issue · 7 comments
I am gettign the following error when I run vqmt
readOneFrame: cannot read 1280 bytes from the input file, unexpected EOF.
Am I doing something wrong
I launched the tool using ./vqmt video1.mp4 video2.mp4 720 1280 80 1 results SSIM
The way you launch it is correct. The error comes probably from the fact that your video may not be truly 720x1280.
To be honest, VQMT deserves a bit of ❤️ but I don't have much time available these days.
I made the video using ffmpeg tool.Do we ahve to use some specific encoding parameters?
I checked the code....
for (int i=0; i<comp_height[j]; i++) {
if (read(file, ptr_data, static_cast<size_t>(read_size)) != read_size) {
fprintf(stderr, "readOneFrame: cannot read %d bytes from input file, unexpected EOF.\n", read_size);
return false;
}
ptr_data += read_size;
This is where its failing in readOneFrame of VideoYUV.cpp
read_size is 1280 and the value is 420. Idk why though!
Well, I'm not sure why right now, I'd have to investigate.
However, yes, the video might not be in any format. As stated in the README, it as to be a "raw YUV video file, progressively scanned, and 8 bits per sample". As it seems you gave mp4 as input, it might not be correct ;)
How could I encode as per the stated format ? Any pointers would be so helpful :)
This is a raw format, aka uncompressed. Be aware that uncompressed videos can become huge files quite quickly.
You can convert any video to raw YUV using ffmpeg
(and probably other tools as well).
For instance:
ffmpeg -i video1.mp4 -c:v rawvideo -pix_fmt yuv420p video2.yuv
that works 👍 Could we add the functionality for reading mp4 encoded yuv420p with libx264 ?
I think this is going beyond the scope of VQMT. If I am to support this then I'll need to support many other format conversion as well for no real benefit I believe since other tools can provide conversion to YUV.