[libtheora @ 0x1a5c480]theora_encode_init failed
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
CommentFileSizeAuthor
#3 video_theora_framesize-1920798-3.patch3.21 KBiva2k
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iva2k’s picture

Digging the net I found this: http://eatmytux.com/convert-to-theora-with-ffmpeg
which says that video size should be multiples of 16 for theora.

Size of the video in question is '640x360'. I copied command line from the error log, tried it on the server's command line to get the same error. Then I changed to "... -s '640x368' ..." (multiples of 16), and the command worked ok.

It looks like for libtheora caller needs to adjust the size to be multiples of 16.

iva2k’s picture

This document contains suggestion on how to deal with frame sizes that are not in 16-multiples:
http://www.theora.org/doc/libtheora-1.2/structtheora__info.html

Encoded theora frames must be a multiple of 16 in width and height. To handle other frame sizes, a crop rectangle is specified in frame_height and frame_width, offset_x and * offset_y. The offset and size should still be a multiple of 2 to avoid chroma sampling shifts. Offset values in this structure are measured from the upper left of the image.

[UPDATED]
e.g. "... -s 640x360 ..." can be adjusted to "... -s 640x360 -padtop 4 -padbottom 4 ..."

I tried that on the same example as in #1 and it also works. Now to the working code patch...

iva2k’s picture

Status: Active » Needs review
FileSize
3.21 KB

Here's a patch that fixes the frame size to be multiples of 16x16 for libtheora.

brycefisherfleig’s picture

Issue summary: View changes
Issue tags: +7.x-2.11 roadmap
heshanlk’s picture

Status: Needs review » Fixed

  • heshanlk committed 599231f on 7.x-2.x authored by iva2k
    Issue #1920798 by iva2k: ffmpeg fails with libtheora
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.