Hello

I've been using the module and been having problems with the preset for "Theora(ogv) (ffmpeg2theora)".

It seems like there are 2 parameters being added to the command:
-padtop 46 -padbottom 44 Which are not supported by ffmpeg2theora. Seems to me it is caused by setting a video encoding size which doesn't match the original aspect ratio.

There is also a problem with
!videobitrate It passes no value to the command, so it ends up being empty and the command that gets executed is something like:
Executing command: ffmpeg2theora --videobitrate --max_size 640x480 --output (...) and I get an error:
Video conversion failed for preset html5_ogv. FFMPEG reported the following output: Only positive values are allowed for video bitrate (in kb/s).

For your reference this is what I get from ffmpeg -i for the video I'm using:

FFmpeg version SVN-r25679, Copyright (c) 2000-2010 the FFmpeg developers
  built on Nov  5 2010 09:24:35 with gcc 4.5.1
  configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-version3 --enable-nonfree --enable-runtime-cpudetect --disable-debug
  libavutil     50.32. 6 / 50.32. 6
  libavcore      0.12. 0 /  0.12. 0
  libavcodec    52.94. 3 / 52.94. 3
  libavformat   52.84. 0 / 52.84. 0
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.56. 0 /  1.56. 0
  libswscale     0.12. 0 /  0.12. 0
  libpostproc   51. 2. 0 / 51. 2. 0

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'm4h00137.mp4':
  Metadata:
    major_brand     : MSNV
    minor_version   : 19595353
    compatible_brands: MSNVmp42isom
  Duration: 00:00:15.01, start: 0.000000, bitrate: 5841 kb/s
    Stream #0.0(und): Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 5774 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc
    Stream #0.1(und): Audio: aac, 24000 Hz, mono, s16, 64 kb/s
At least one output file must be specified
CommentFileSizeAuthor
#9 ffmpeg2theora-preset-bug-989896.patch893 bytesfirebus

Comments

firebus’s picture

subscribing. i have this problem in 6.x-4x-beta2 release

it's easy enough to remove the videobitrate parameter, but not sure what to do to get rid of the padding options - ffmpeg2theora seems to think it's some kind of preset call...

hypertext200’s picture

Component: Code » Miscellaneous
Category: bug » support
Status: Active » Fixed

You should install ffmpeg2theora, http://v2v.cc/~j/ffmpeg2theora/

firebus’s picture

Status: Fixed » Active

i did install ffmpeg2theora.

before i installed ffmpeg2theora i got the totally different error, that ffmpeg2theora could not be found.

now that i installed ffmpeg2theora, i get the error listed in this bug.

heshan.lk, could you be a little more verbose in your suggestion? are you saying that the version of ffmpeg2theora that i'm using doesn't support these options, but the one at v2v.cc does? if not, i'm not sure how installing ffmpeg2theora would fix this bug when both reporters already have in installed.

even if there's a version issue around the -padleft and -padright options, i'm not sure how it's possible that ffmpeg2theora will run happily with no argument to the --videobitrate parameter.

if it helps, i'm running ffmpeg2theora 0.24 installed via apt-get on ubunutu 10.04. i see nothing in the release notes at v2v.cc that suggests -pad* options are supported by the current version, 0.27

thanks!

hypertext200’s picture

Do u have already installed the FFMPEG?
To debug, so this.
First go to Theora preset and add the

ffmpeg2theora --videobitrate 20000 --max_size !widthx!height --output !convertfile !videofile

Please add the correct theora path to the ffmpeg2theora, and upload a video file and run the cron.php.

What you can see in logs, can u see a executable command? then copy that command and cd /path/to/drupa/root then run the command.

What you can see post here?

firebus’s picture

thanks for your response!

yes, ffmpeg is installed and working with, for example, the html5_mp4 preset. it's just the ogv preset that's stuck now.

if i hardcode the --videobitrate parameter as you suggest, i still get an error due to the -pad* settings. -p is a preset options for ffmpeg2theora, so when it sees -padleft and -padright in the commandline, it throws an error.

naturally this will only happen if video module (in transcoders/video_ffmpeg.inc) decides that padding is necessary. looking at the man pages for ffmpeg2theora and googling a bit, it looks to me like ffmpeg2theora pads automatically when necessary with no parameters.

i'm currently working around this problem by editing the dimensions function in video_ffmpeg.inc to skip the padding options if it's working with ffmpeg2theora.

here's the command that is causing this error:

ffmpeg2theora --videobitrate 20000 --max_size 476x600 -padleft 162 -padright 162 --output 'sites/all/files/videos/converted/sample_sorenson_0.ogv' 'sites/all/files/videos/original/sample_sorenson.mov' 2>&1

and here's the error:

Unknown preset.

v2v presets:
preview Video: 320x240 if fps ~ 30, 384x288 otherwise
Quality 5 - Sharpness 2
Audio: Max 2 channels - Quality 1

pro Video: 720x480 if fps ~ 30, 720x576 otherwise
Quality 7 - Sharpness 0
Audio: Max 2 channels - Quality 3

videobin Video: 512x288 for 16:9 material, 448x336 for 4:3 material
Bitrate 600kbs
Audio: Max 2 channels - Quality 3

padma Video: 640x360 for 16:9 material, 640x480 for 4:3 material
Quality 5 - Sharpness 0
Audio: Max 2 channels - Quality 3

padma-stream Video: 128x72 for 16:9 material, 128x96 for 4:3 material
Audio: mono quality -1

again, this is because ffmpeg2theora interprets -padleft and -padright as its -p preset parameter.

firebus’s picture

so again, we've got two bugs in one here :)

1) --videobitrate parameter is left empty in the html5_ogv preset. workaround is to hardcode videobitrate in the preset

2) -padleft and -padright parameters are invalid for ffmpeg2theora. workaround is to suppress these options in the video_ffmpeg.inc

firebus’s picture

Title: HTML5 Theora(ogv) (ffmpeg2theora) preset bug » HTML5 Theora(ogv) (ffmpeg2theora) preset bug: --videobitrate parameter blank
Assigned: Unassigned » firebus
Category: support » bug

aha - i'm using the "Use -padtop, -padbottom, -padleft, -padright for padding" ffmpeg padding options, which is incompatible with my version of ffmpeg and also incompatible with ffmpeg2theora.

ffmpeg2theora is happy with the -vf pad version

so, there's maybe a configuration/documentation issue around the ffmpeg padding options - if you're going to use ffmpeg2theroa, then you have to use "-vf pad" and have an ffmpeg that's compatible with that.

this bug should still remain open until there's a patch applied for the --videobitrate parameter problem in the html5_ogv preset...i'll try to generate one later today...

firebus’s picture

Assigned: firebus » Unassigned
Status: Active » Needs review

okay, here's patch that removes the video parameter entirely, which works fine. my ffmeg2theora man page suggests that "20000" is out of range anyway.

looking at how videobitrate *should* be set, it looks like video_ffmpeg.inc tries to create a parameter named videobitrate from

variable_get('video_ffmpeg_helper_auto_cvr_video_bitrate', $this->video_bitrate)

so maybe it would be better to fix the bug in video_ffmpeg.inc that's causing videobitrate to remain unset?

firebus’s picture

StatusFileSize
new893 bytes

oh, the patch

vali hutchison’s picture

I was getting the same error as for jm.federico:

Video conversion failed for preset html5_ogv. FFMPEG reported the following output: Only positive values are allowed for video bitrate (in kb/s).

so I applied the patch in #9 and get this error now:

Video conversion failed for preset html5_ogv. FFMPEG reported the following output: Unknown preset. v2v presets: preview Video: 320x240 if fps ~ 30, 384x288 otherwise Quality 6 Audio: Max 2 channels - Quality 1 pro Video: 720x480 if fps ~ 30, 720x576 otherwise Quality 8 Audio: Max 2 channels - Quality 3 videobin Video: 512x288 for 16:9 material, 448x336 for 4:3 material Bitrate 600kbs Audio: Max 2 channels - Quality 3 padma Video: 640x360 for 16:9 material, 640x480 for 4:3 material Quality 6 Audio: Max 2 channels - Quality 3 padma-stream Video: 128x72 for 16:9 material, 128x96 for 4:3 material Audio: mono quality -1

I'm using video module 6.x-4.2-beta2 on ubuntu server, FFmpeg version SVN-r26402

firebus’s picture

re 10:

right. now you have the "unknown preset" issue from comment 7, which is a configuration problem.

please try changing your ffmpeg padding method settings (in the video conversion field group of the video transcoders configuration page - /admin/settings/video/transcoders)

the default, "Use -padtop, -padbottom, -padleft, -padright for padding" is incompatible with ffmpeg2theora - it misinterprets the -p as a preset parameter.

set it instead to "Use -vf "pad:w:h:x:y:c" for padding. the -padtop version is only necessary for older versions of ffmpeg.

i'll open a new ticket to address this configuration/documentation/incompatibility issue separately

firebus’s picture

created #1107174: default ffmpeg padding configuration is incompatible with ffmpeg2theora and the html5 theora preset to follow the settings incompatibility/documentation issue described in comments 5, 7, 10, 11

hypertext200’s picture

Status: Needs review » Fixed
usr/local/bin/ffmpeg2theora -o !convertfile !videofile

Please add above line to convert videos properly without any issue and I tested and it worked. In D7 version we have editable presets and no recent plan to port it back to D6 so please go and edit to preset file.

hypertext200’s picture

firebus’s picture

heshan, it sounds like you're saying that your preferred solution to the padding issue is to remove the height and width parameters entirely from the ffmpeg2theora preset.

won't this give the wrong size video when the video is being resized as part of processing?

vali hutchison’s picture

Re: #11 and #13 - thanks for the suggestions, i got ogg transcoding working with "Use -vf "pad:w:h:x:y:c" and also 'ffmpeg2theora -o !convertfile !videofile' in the video_preset/html5_ogv.inc file. not tried height or width options though.

hypertext200’s picture

@firebus , this is an issue with the video module and that was a temp solution I can see. when widthxheight are added we will add some other stuff for padding on FFMPEG, so it is same as other convertors, so we will clean it up very soon, or patches to that are welcome.

Status: Fixed » Closed (fixed)

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

dalvir’s picture

Title: HTML5 Theora(ogv) (ffmpeg2theora) preset bug: --videobitrate parameter blank » ffmpeg2theora required

We have FFMPEG installed
do we still need to install ffmpeg2theora?

firebus’s picture

Title: ffmpeg2theora required » HTML5 Theora(ogv) (ffmpeg2theora) preset bug: --videobitrate parameter blank

dalvir, please don't hijack this issue with an unrelated support request.

dalvir’s picture

I did not get what you want to say firebus...Anyway i got answer...

bcobin’s picture

@heshan, re: #13 - this doesn't work - I get the following error:

Video conversion failed for preset html5_ogv. FFMPEG reported the following output: dyld: Symbol not found: ___stack_chk_guard Referenced from: /usr/local/bin/ffmpeg2theora Expected in: /usr/lib/libSystem.B.dylib

I have the command below working, but I get a 200, Stream not found error, despite the fact that the converted file does, indeed, exist where it's supposed to. The file is successfully transcoding and I've tried no shortage of options here, so I assume the error is unrelated to the command string.

I suppose I should open up a separate thread for this, but insofar as this thread deals with .ogv encoding, I assume it's appropriate to post here as well.

Working .ogv command string:

!cmd_path -i !videofile -vcodec libtheora -b 2000k -acodec libvorbis -ac 2 -ab 128k !convertfile

firebus’s picture

bcobin, you have a different problem than the one addressed by this issue, and i humbly suggest that you open a new support issue for this.

bcobin’s picture

Yes, I did.

http://drupal.org/node/1150196

I thought this appropriate to post here for others who might be having problems with .ogv encoding and chance across this thread - as did I. Did not mean to offend... good luck - to all of us!

bcobin’s picture

Revisiting this again after a system upgrade and rebuild of my server environment so that I can now run ffmpeg2theora. With setting -vf "pad:w:h:x:y:c" and 'ffmpeg2theora -o !convertfile !videofile' in the video_preset/html5_ogv.inc file conversion of mp4 and .ogv still results in:

200, Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] 'http://[base_url]/[subdirectory]/sites/default/files/videos/converted/test_vid.ogv''

The file is successfully converted, in the right location and plays in VLC. This post should be on point - I'm doing the same as what is reported as working in #16 with what should be the same setup.

Has no one else been seeing the 200, Stream not found error? Ideas appreciated...

firebus’s picture

i haven't seen it - have you checked file/folder permissions? maybe the user that is running ffmpeg2theory doesn't have access to the file once it is created?

bcobin’s picture

Thank you for responding, firebus, but it doesn't seem to be a permissions issue - I've set permissions to 777 to no effect; same error every time.

I really have no idea what's going on - the file is readable and exactly where it's supposed to be - I'm stumped. *sigh*

jantoine’s picture

Status: Closed (fixed) » Reviewed & tested by the community

This issue is not fixed... requiring a user to edit a file is a workaround, not a fix! Per Drupal standards, I am setting this issue to RTBC as I have tested the patch from #9 and it works. If the module maintainers disagree with the fix in the patch from #9, please submit your own patch for review or apply your own fix to the module. Until one of these actions is taken, the status of this issue should be set to a status that implies further action is still necessary. Setting that status of an issue to fixed when it is not truly fixed confuses users and leads to additional duplicate issues being reported.

Cheers,

Antoine

Jorrit’s picture

Status: Reviewed & tested by the community » Fixed

I have fixed this problem in 6.x-4.x by fixing the bit rate value at 500. Later, probably in 4.7, I will add the option to edit command lines using the Drupal web interface.

Status: Fixed » Closed (fixed)

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