IntelLabs / vdms

VDMS: Your Favorite Visual Data Management System
MIT License
84 stars 31 forks source link

Transcoding file with mp4 container to h263 encoding fails #115

Closed primkey7607 closed 1 month ago

primkey7607 commented 5 years ago

When using AddVideo to load an mp4 file and transcode it into h263, I get the error:

[Exception] OpenFailed at src/vcl/Video.cc:383 on the server side, and {u'info': u'Internal Server Error: VCL Exception at QH\n', u'status': -1} on the client side

This seems to happen regardless of the video being transcoded, as long as the video is an mp4 file, and it is being transcoded to h263.

luisremis commented 5 years ago

Apparently, h.263 implementation in OpenCV/ffmpeg (u263) expects the frame size to be of a particular size:

OpenCV: FFMPEG: tag 0x33363255/'U263' is not supported with codec id 5 and format 'mp4 / MP4 (MPEG-4 Part 14)' [h263 @ 0x7f324082fda0] The specified picture size of 720x528 is not valid for the H.263 codec. Valid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try H.263+. Could not open codec 'h263': Unspecified error

I tried setting the size to (720x528, using the resize operation in VDMS), and it almost worked. I got another error instead:

OpenCV: FFMPEG: tag 0x33363255/'U263' is not supported with codec id 5 and format 'mp4 / MP4 (MPEG-4 Part 14)' [mp4 @ 0x7fe886a30e60] Could not find tag for codec h263 in stream #0, codec not currently supported in container

It seems OpenCV/ffmpeg do not support using h263 coded videos using mp4 container.

Then I tried h263, resizing, and changing the container to “avi” and the transcoding worked fine.

We can explore and see whether we can add a different h263 implementation in OpenCV that allows any size and mp4 container.

luisremis commented 5 years ago

@mahircg Something interesting to look at at some point.

ifadams commented 1 month ago

@cwlacewe closing as stale.