Hi
I have set up Drupal Flash video following the instructions on the website.
However, when I upload a video I get the message "conversion failed".
I have enabled FFMPEG database logging and get the following message in the database:
Command: /usr/local/bin/ -y -i "/home/swimm7/public_html/swb/sites/default/files/P4300403.AVI" -vframes 1 -ss "00:00:02" -an -vcodec mjpeg -f rawvideo -s ""130x100"" "/home/swimm7/public_html/swb/sites/default/files/P4300403.AVI_22.jpg"
Data: sh: /usr/local/bin/: is a directory
I know the path is correct, because if I try a different path I get a message saying /usr/local/bin/ffmepg: is not a directory.
Interestingly, when I have upload a video, the node displays that it has a location of:
...sites/default/files/
which is NOT my input or output directory.
I had to create the input/output directories myself under sites/default/files/, as Drupal was not creating them.
When I created the directories, I made sure I set permissions to 777.
Other background information
Before I created the input/output directories, when uploading movie files it would say:
• FlashVideo successfully created: Movie_37.jpg
• FlashVideo successfully created: Movie_37.flv
However, I would also get this error message:
warning: rename(/home/swimm7/public_html/swb/sites/default/files/v1_0.avi,/home/swimm7/public_html/swb/sites/default/files/videoorignal/v1_0.avi) [function.rename]: No such file or directory in /home/swimm7/public_html/swb/sites/all/modules/flashvideo/flashvideo.module on line 1103.
The video would not display. The attachment on the node would say the video had been uploaded to the input/output directories, even though those directories did not exist (and so the jpg and flv files were no where on the server)!
Since creating the input/out directories I now only get a message saying conversion failed (see above).
Comments
Comment #1
Andrew Kaufmann commentedI believe (though I could be wrong) that you're getting that error because you've specified the directory ffmpeg sits in, but not the executable itself. Try setting the path to be to the executable, and not the directory it sits in.
Comment #2
big_smile commentedWould that be /usr/local/bin/ffmpeg.exe ?
Comment #3
big_smile commentedI found out that it is actually just /usr/local/bin/ffmpeg.
But now I get this in my MySQL database, and I'm not sure what it means:
I thought it might have something to do with the MP3 encoder and followed the instructions Here , but still no joy.
Comment #4
attheshow commentedSounds like you don't have your FFMPEG binary setup/compiled correctly.
Comment #5
pobster commentedIsn't it because your audio encoder is not called 'mp3' and probably called 'libmp3lame' (obviously without the quotes)??? Change it in your ffmpeg settings for your content type.
Pobster
Comment #6
big_smile commentedIn my input I have:
ffmpeg Command:
Is this correct? - it doesn't work!
Comment #7
big_smile commentedI received this message from the host:
I'm not sure what this means - could some one give me some pointers?
Comment #8
attheshow commentedMy best advice is to try running FFMPEG conversion commands from the command line (ssh). When you get the conversion working from the command line successfully, then all you have to do is modify your FlashVideo module's FFMPEG settings to match. You can find out more about the individual parameters of FFMPEG commands here: http://ffmpeg.org/ffmpeg-doc.html
Comment #10
big_smile commentedAfter playing around I have found out that the video uploads fine if it is the same dimensions as the Flash Player settings.
E.g. If Flash video is set to convert video to 320 x 240 and I upload a 320 x 240 video, everything is fine.
If I upload a video that is a different dimension, the conversion fails.
Does anyone have any ideas?
Comment #11
big_smile commentedAfter playing around I have found out that the video uploads fine if it is the same dimensions as the Flash Player settings.
E.g. If Flash video is set to convert video to 320 x 240 and I upload a 320 x 240 video, everything is fine.
If I upload a video that is a different dimension, the conversion fails.
Does anyone have any ideas or at least how I would start to troubleshooting this?
Comment #12
attheshow commentedThe first place to start is to try running the FFMPEG conversion command from the command line and see if your server's installation of FFMPEG can successfully run the conversion for you. If it can't complete the conversion successfully from the command line, then FlashVideo won't be able to succeed with the conversion process either.
Comment #13
big_smile commentedI can't access the command line myself, but I have contacted the host and they inform that they are able to convert video of any size (and showed me some test conversions to prove it).
Comment #14
attheshow commentedAre you able to confirm that the command that they're running is the same as what's being run by the module?
Comment #15
big_smile commentedYes, it is.
If I resize the videos to first, then they upload correctly. But obviously, that removes most of the convince of using this module!
Comment #16
attheshow commentedCan you please post the message you're receiving when the conversion fails? I'm not sure if any further details might be included there...
Comment #17
big_smile commentedHi
The message is:
I have tried creating a brand new website from scratch, but the same problem happens.
Comment #18
attheshow commentedThis has to be something to do with your FFMPEG configuration. It would be easier to test on a server where you had more control, but it sounds like you're pretty limited in what you can do with this host. I would recommend either trying to get them to give you SSH access so that you can test conversions yourself from the command line, or, unfortunately, move the site over to another host.
Comment #19
big_smile commentedThis seems to be working now with the newest update of Flash Video.
I don't know what the problem was, but I'm glad it is fixed, although I am sorry that my experience couldn't help anyone else.
Comment #20
vip_sa commentedI have installed a Drupal 6.13 site. I have installed these modules:
cck 2.5
filefield 3.1
imagefield 3.1
flashvideo 1.5 rc3
token 6.x 1.12
I have created three cck field in my content type video:
video
converted
thumbnail
I have enabled the video content type in flashvideo and set the command for ffmpeg to libmp3lame. The path to ffmpeg is usr/bin/ffmpeg
When trying to create a video it says conversion falied and it gives to lines of error messages
conversion failed (presumably the video)
conversion failed (presumably the thumbnail)
The conversion worked fine on a previous site so I cannot think that there is something wrong with the ffmpeg binary
Can someone help me please?
Comment #21
vip_sa commentedComment #22
pobster commentedLook under Flashvideo Settings -> Universal Settings and check the logging checkbox. It'll tell you exactly what the problem is - no-one can guess what's wrong from what you've written above.
Pobster
Comment #23
vip_sa commentedI have done like you said. Now how do I get the data you need so you can tell me what's wrong? I know I have to look in the ffmpeg_data table but which entry do you need the data from?
On my other site it doesn't even say conversion failed it just shows nothing. There is no data in the database but the files I uploaded are there. What will be wrong in this case please?
Comment #24
pobster commentedThe fid of the ffmpeg_data table will match the fid of the file you're trying to convert (look in the files table). Post that here...
As for the other conversion failing, it sounds like it's either an flv or an mp4? They're not converted in Flashvideo, they're bypassed straight to JW Player which handles them just fine assuming they don't need resizing or anything.
Pobster
Comment #25
vip_sa commentedHi
Hope this is the right information you are looking for:
Command: /usr/local/bin/ffmpeg -i "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/corne/blond_goes_to_work_after_many_years.wmv" -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/[user]/blond_goes_to_work_after_many_years_1.flv"
Data: FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
libavutil version: 49.7.0
libavcodec version: 51.62.0
libavformat version: 52.18.0
libavdevice version: 52.0.0
built on Jul 12 2009 08:25:49, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/corne/blond_goes_to_work_after_many_years.wmv':
Duration: 00:00:01.46, start: 3.100000, bitrate: 1087 kb/s
Stream #0.0: Audio: wmav2, 32000 Hz, stereo, 32 kb/s
Stream #0.1: Video: wmv1, yuv420p, 320x240, 314 kb/s, 25.00 tb(r)
Could not open '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/[user]/blond_goes_to_work_after_many_years_1.flv'
That is what I found in the ffmpeg_data table.
_____________________________________________
As for the other conversion NO I am trying to convert a wmv file and all it does is nothing. I upload the file (and it uploads perfectly) and then I click save. Then it says it created the video but there is no word about the conversion faling or succeeding or anything. It just shows the title of the video but no video and if you look in the database it says this:
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0002 sec)
So there are no rows in the ffmpeg_data table. How do I fix this?
On another note:
Do you know where I can get support for my websites in the form of a Drupal developer? Are you a developer?
Thanks for the help
Comment #26
pobster commentedThis is the important bit;
You can google that and get all sorts of answers, but what it boils down to is that your audio codec isn't supported (correctly?) on your system - which would be wmav2...
The other issue is a mystery, for which I can only recommend going over your set up *very* carefully again. It could be a missing folder, no folder set in the CCK field, bad ffmpeg install, etc, etc... Sounds like you're better off looking at your syslogs rather than your Drupal logs.
And yes, I'm a developer but I'm not interested in helping people out individually. I help on here when I can and that's actually quite a lot added together... I barely get any free time as it is!
Pobster
Comment #27
vip_sa commentedHow do I fix the codec not supported? What do I have to do or install or change? Please help.
The other problem it seems like I am going to have to reinstall the whole site. I have installed it about four times already and everytime there is a new issue that's keeping me back
It's a pity you're not interested in taking on clients. I could sure do with some help from someone like you. Pity you don't get any free time. One needs free time to do what you like!
Thanks very much for your help here!
Comment #28
travist commented/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/[user]/blond_goes_to_work_after_many_years_1.flv is not a valid directory.
I am almost positive that your output files directory has "[user]" when FlashVideo does not support the Token module. Try just changing your output directory to just "videos" and see if that works.
Thanks,
Travis.
Comment #29
vip_sa commentedThank you! I didn't know that flashvideo does not support the token module. How do I fix the codec not supported issue?
Thanks a lot for the help here.
I changed the directories but the conversion still fails. So the codec not supported is the problem then. How do I fix that?
Comment #30
pobster commentedJust recompile ffmpeg (preferably using the latest svn), you never know it may work anyway using the standard wma decoder.
Pobster
Comment #31
vip_sa commentedThe problem is I have asked my hosting company to test ffmpeg and they say it works fine. So how what do I tell them why do they need to recompile ffmpeg and what version do they need to use or whatever else information do I need to give them please?
what is the latest svn? What is svn?
Comment #32
pobster commentedIf you do not have control over the installation of ffmpeg then your only choice is to not allow the upload of wmv's. Have you tested converting any avi files? Are your errors reading just the same as before?
Pobster
Comment #33
vip_sa commentedI have asked the hosting company to recompile ffmpeg and they said they will do it. I have not tested avi files but will do so and post the result here! And as soon as what the hosting company have recompiled ffmpeg I will also post the result of the tests here. I hope it works!
Thanks a great deal for all your help and input.
Comment #34
vip_sa commentedThey have recompiled my ffmpeg and still the conversion fails. I have tried many formats and they all fail. the format .mpe doesn't give me any error messages though but the rest all give conversion failed. It also doesn't say it created the file .flv or the thumbnail
This is the database entry:
Command: /usr/local/bin/ffmpeg -i "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/video/tvc7.mpg" -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/converted/tvc7_7.flv"
Data: FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
libavutil version: 49.7.0
libavcodec version: 51.62.0
libavformat version: 52.18.0
libavdevice version: 52.0.0
built on Jul 12 2009 08:25:49, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)
Input #0, mpeg, from '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/video/tvc7.mpg':
Duration: 00:00:30.62, start: 1.321678, bitrate: 132 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 160x120 [PAR 1:1 DAR 4:3], 92 kb/s, 24.00 tb(r)
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 32 kb/s
Could not open '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/converted/tvc7_7.flv'
What could be wrong this time?
On the other file type wmv it gives the following:
Command: /usr/local/bin/ffmpeg -i "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/corne/sillon.wmv" -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 "/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/[user]/sillon_2.flv"
Data: FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
libavutil version: 49.7.0
libavcodec version: 51.62.0
libavformat version: 52.18.0
libavdevice version: 52.0.0
built on Jul 12 2009 08:25:49, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)
Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 15.00 (15/1)
Input #0, asf, from '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/corne/sillon.wmv':
Duration: 00:00:04.48, start: 5.000000, bitrate: 237 kb/s
Stream #0.0: Audio: wmav2, 16000 Hz, mono, 16 kb/s
Stream #0.1: Video: wmv3, yuv420p, 320x240, 134 kb/s, 15.00 tb(r)
Could not open '/home/gigguide/public_html/hosted/nationalgigguide.co.za/sites/default/files/[user]/sillon_2.flv'
Comment #35
vip_sa commentedComment #36
vip_sa commentedSo I suppose I should forget about having flashvideo on my site.
Comment #37
pobster commentedSee, this is exactly why I don't offer my services to individuals... I can't reply every day, I can't read these threads when I please - I simply don't get the time... You have to have a little patience.
You still appear to be using tokens;
As for the other file though, you're no longer getting the 'Seems stream 1 codec frame rate differs from container frame rate' error message. I assume you've checked that the
sites/default/files/converted/folder actually exists and that it has appropriate permissions? I'd perhaps for the sake of discounting permissions, temporarily change them to 777 on the converted folder to see if that makes a difference.Pobster
Comment #38
vip_sa commentedApologies for being a little impatient. I did as you stated above and it works finally. Thank you so very much! Sorry again but like everyone else I would also like to have a working website and I don't have a degree in php so I have to depend on good people like you. Thank you ! Thank you thank you!
Comment #39
attheshow commentedMarking as fixed.
Comment #41
Marek_R commentedToday, when you add a movie to a server, jumped me an error.
Conversion failed.
Conversion failed.
Wpis Konkurs Marathon (Film) został zaktualizowany.
warning: rename(/var/www/tv/sites/default/files/filmy/film_converted/marathon1_0_1436.flv) [function.rename]: failed to open stream: Read-only file system in /var/www/tv/sites/all/modules/flashvideo/flashvideo.module on line 980.
warning: rename(/var/www/tv/sites/default/files/marathon1_0.flv,/var/www/tv/sites/default/files/filmy/film_converted/marathon1_0_1436.flv) [function.rename]: Success in /var/www/tv/sites/all/modules/flashvideo/flashvideo.module on line 980.
What could be switched?
Comment #42
Marek_R commentedtest
Comment #43
travist commentedYou need to go to your ffmpeg_data table and get the command that was used to create this video. Then copy and paste that command in Shell and see what error it gives you. this is most likely not an issue with Flashvideo.
Comment #44
ghiley commentedHi, I wanted to post my solution closely related to this 'conversion failed' error that @big_smile had.
Problem:
FlashVideo and FFMpeg all setup and working correctly but the thumbnail images simply were not being created. I was receiving the illusive 'Conversion failed' error from Drupal. As with @big_smile I found that if I changed my video settings all to 320x240 it worked but wouldn't work at the resolution of 548x365 that I require.
Solution:
FFMpeg was reporting a "Frame size must be a multiple of 2" error and consequently failing to produce the JPG (I found this following above comments about turning on debugging in FlashVideo -> Universal Settings then checkin out the ffmpeg_data table in the database). Not sure of the ins and outs of this... but it basically means that I needed to change the resolution of my output from 548x365 to an even number... 548x366.
Hot tip of the day:
Definitely checkout the FFMpeg errors that are being produced (as explained above). This issue was dumb and cryptic, took me hours to debug. I hope this helps some other chump some day.
Bang.