reading a samsung recorded h.264 video [closed]
Hi, I have an issue with reading h264 encoded video recorded by my samsung S5 mini phone camera in OpenCV 3 (on my PC).
I get errors like this:
[h264 @ 0xc5e900] AVC: nal size 555455581
[h264 @ 0xc5e900] AVC: nal size 555455581
[h264 @ 0xc5e900] no frame!
and lot of visual artifacts on most of the frames. The strange think is, that vlc and mplayer can play the video OK and converting frames to images with ffmpeg works nice as well. Any suggestions how to fix that?
update: As Tetragramm suggested, I have tried to play the video in vlc and look at the statistics. I get no corruptions, but (probably) depending on my current cpu load I get either 0 or quite a lot Lost frames in video section. The visual artifacts are the same as in OpenCV.
So it seems that the video file is not corrupted. The question now is how to read it with OpenCV. I don't need to process it in realtime, so is there a way to read it as slow as necessary not to get lost frames?
From the VLC codec info about the video:
Codec: H264 - MPEG-4 AVC (part 10) (avc1)
Resolution: 1920x1080
Frame rate: 30.009816
Decoded format: Planar 4:2:0 YUV
In VLC, open the file and click Tools>Codec Information>Statistics tab. Check to see if frames are being corrupted or lost. It's possible that VLC is papering over any errors by interpolating forward and backward as best it can.
Thanks for the suggestion. It seems that the video is not corrupted. I have updated my question with the details.
Do you have the OpenCV ffmpeg dll? Also, try using the OpenH264 codec and see if that helps. Install instructions are HERE.