OpenCV 2.3.1 cannot save *.m4v / *.mp4 (Bug #1736)


Added by Vadim Kantorov almost 13 years ago. Updated over 12 years ago.


Status:Cancelled Start date:2012-04-02
Priority:Normal Due date:
Assignee:Alexander Reshetnikov % Done:

0%

Category:highgui-video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I built OpenCV to use ffmpeg compiled with x264 (following the tutorial at http://mitchtech.net/opencv-ubuntu/)

I create VideoWriter as follows:
VideoWriter (VideoWriter out("test2.m4v", CV_FOURCC('X','2','6','4'), 25, Size(640,480),1);),

About the hundredth frame makes ffmpeg die and spit "Floating point exception". If I use ffmpeg directly, export to *.m4v / *.mp4 also works.

Full code can be found at: http://paste.pocoo.org/show/573168/
The video is accessible at (to be renamed in test.m4v after downloading): http://media1.setere.com/47706a66-47cf-11e1-a42d-f0def1c12720_1330869588-1330876758_2fb9221f-1c6d-4cc7-be65-8148fecafc9f.m4v or http://narod.ru/disk/44624463001.0bdbf2b307db14c1d75912dae926c93a/test.m4v.html

Saving to *.avi and *.mkv works well.


Associated revisions

Revision 0442b3ea
Added by Alexander Reshetnikov almost 13 years ago

Updated diagnostic messages in VideoWriter (for ticket #1736)

Revision dd942df0
Added by Andrey Pavlenko over 11 years ago

Merge pull request #1736 from alalek:ocl_fix_corner_memory_access

History

Updated by Alexander Reshetnikov almost 13 years ago

  • Assignee set to Alexander Reshetnikov

Updated by Joel Mckay almost 13 years ago

Typically mp4/m4v is an ffmpeg issue, but I too have encountered intermittent issues with this third party lib.

I would suggest a partial recompile of OpenCV, but leave "xine" option and built-in libraries disabled.

Trying nonlinear frame access under linux can be entertaining as well... =)

Good luck,
J

Updated by Vadim Kantorov almost 13 years ago

Yeah, it's definitely ffmpeg-connected issue, or even avformat-related issue. What's weird is that ffmpeg on its own does the reading and writing completely fine which suggests it's either their external interface that's broken or it's OpenCV that's using it a bit incorrectly.

Updated by Vadim Kantorov almost 13 years ago

Vadim Kantorov wrote:

Yeah, it's definitely ffmpeg-connected issue, or even avformat-related issue. What's weird is that ffmpeg on its own does the reading and writing completely fine which suggests it's either their external interface that's broken or it's OpenCV that's using it a bit incorrectly.

Also, Ilya Lysenkov could repro the bug.

Updated by Andrey Kamaev almost 13 years ago

  • Category set to highgui-images

Updated by Alexander Reshetnikov almost 13 years ago

Vadim, this issue cannot be fixed in common case because h264 codec isn't included into default ffmpeg. Also it has gpl licence. So I've changed error messages in r8040 (in both wrappers) for this and similar cases.

  • Status changed from Open to Cancelled
  • Target version set to 2.4.0

Updated by Andrey Kamaev over 12 years ago

  • Category changed from highgui-images to highgui-video

Updated by Vadim Kantorov over 12 years ago

Alexander, I'm not sure if I understood you correctly (please correct me if I'm wrong), but I reported that H.264 writing breaks while using OpenCV compiled with ffmpeg compiled with x264 which means that H.264 was included in my case.

Unfortunately, I won't work on that project again any time soon, but I wonder if the issue still remains in the modern versions of OpenCV and ffmpeg.

Also available in: Atom PDF