Needs review
Project:
FFmpeg Wrapper
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2009 at 18:31 UTC
Updated:
11 Oct 2012 at 14:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
arthurf commentedThis is a good idea, however, what I'd like to do is have the function accept audio or video as an argument- so maybe something like:
what do you think?
Comment #2
mfbsounds good to me
Comment #3
arthurf commentedOk, here's a first go. There are some other changes in here from a few other patches...
Comment #4
mfbYou will probably have some problems with PHP notices re: undefined variables and undefined indexes.. e.g. $file_data['audio']['codec'], $file_data['video']['codec'], $can_audio_decode, $can_video_decode might not be set.
Comment #5
chadj commentedAlso, I think these two lines in the patch are wrong:
Since $types will have values of 'video' and 'audio', not keys. Should be
I've attached a modified patch.
Comment #6
mfbJust wanted to ping this issue as I've had to use a custom-hacked ffmpeg_wrapper.module to transcode audio files.
Audio-only transcoding is still broken at least with Media Mover since Media Mover doesn't pass in a $types argument. Also, in the 6.x-2.x branch, function can_decode_file() is missing a $types parameter so there'd be a problem even if it did.
Comment #7
arthurf commentedmfb - are you using the 1 or 2x version of ffmpeg for you audio encoding? What changes have you made to make it work correctly? I'm happy to get this fixed, I just need more direction since I haven't done any testing with audio. Also what harvest/process functions are you using with media mover that are broken?
Comment #8
mfbCurrently I'm still using the 1.x branch in production, but I could do some testing on the 2.x branch.
Not sure what will work for everyone (and with modules that use FFmpeg Wrapper, like Media Mover), but what I'm doing now is returning TRUE as long as there is something in the file that can be decoded:
For the audio files, I am using mm_node to harvest WAV and AMR files from the upload module and mm_ffmpeg to transcode to MP3.
Comment #9
discipolo commentedgot the same problem. mediamover beta7 and ffmpeg_wrapper beta2.
temporary workaround deleting line 384 "&& $can_video_decode" now audio is converted. thanx for leading me on the right track!
Comment #10
delykj commentedI modified Media Mover to fix this:
Here is the modified part of mm_ffmpeg_video function (in mm_ffmpeg.module):
Comment #11
discipolo commentedthat works! here's #10 as a patch against the 6.x-1.0-beta7 version
Comment #12
hongpong commentedsubscribing - seems to still be a problem?
Comment #13
arthurf commentedWhat version of ffmpeg are you using?
Comment #14
hongpong commentedHi thanks for responding - FFmpeg version SVN-r13582
libavutil version: 49.7.0
libavcodec version: 51.58.0
libavformat version: 52.16.0
libavdevice version: 52.0.0
libavfilter version: 0.0.0
I can convert AIFFs WAVs etc from the command line but it gives in the log
FFmpeg can not decode this file type: sites/default/files/1/ajax.wav
etc. It converts video files all right but can't do wav or aiff. Tried setting a custom FFMpeg command like
-i %in_file -vn -ar 44100 -ac 2 -ab 192000 -f mp3 -acodec libmp3lame %out_file
-edit: this could be a problem from FFMpeg_converter not ffmpeg_wrapper . if so, sorry.
Comment #15
arthurf commentedcan you swap the %infile for your sites/default/files/1/ajax.wav and %outfile for test.mp3 and see if it works with that command?
Comment #16
hongpong commentedOddly even with setting that file input %infile to the specific existing file, i get errors from ffmpeg_converter like
FFmpeg can not decode this file type: sites/default/files/1/bottle.aiff
So i think maybe the calls from ffmpeg_converter are where the no-video problem is at. I think I should try using mediamover again instead. It seems like ffmpeg wrapper is not the problem, since ffmpeg_wrapper_can_decode has already been patched for this kind of situation. Hmmm :-/
-edit: this command line is fine from the server -
ffmpeg -i ajax.wav -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 ajax3.mp3
Comment #17
hongpong commentedMaybe this is it. mismatch in the ffmpeg_converter function at hand.
versus ffmpeg_converter.module v 1.47 2010/11/02 07:59:54 zoo33
that If statement is missing types i think.
Comment #18
hongpong commentedI scratched out 'return false' in ffmpeg_converter and that lets it continue to process files, at least until this quirk gets cleaned up one way or another.... I think it would help to give more debugging options to show what these functions return under these tricky circumstances.
Comment #19
tebb commentedFollowing.
Comment #20
eggthing commentedfollowing