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

Andrew Kaufmann’s picture

I 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.

big_smile’s picture

Would that be /usr/local/bin/ffmpeg.exe ?

big_smile’s picture

I 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:

Command: /usr/local/bin/ffmpeg -i "/home/swimm7/public_html/swb/sites/default/files/JetixNewEpisodesPromo.wmv" -f flv -acodec mp3 -ar 22050 -ab 64k -ac 1 "/home/swimm7/public_html/swb/videooutput/JetixNewEpisodesPromo_56.flv"
Data: FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
 configuration: --enable-libmp3lame --enable-libmp3lame --enable-libvorbis --enable-shared --disable-ffserver --enable-pthreads --disable-demuxer=v4l --disable-demuxer=v4l2
 libavutil     49.15. 0 / 49.15. 0
 libavcodec    52.20. 0 / 52.20. 0
 libavformat   52.31. 0 / 52.31. 0
 libavdevice   52. 1. 0 / 52. 1. 0
 built on Apr 20 2009 23:19:45, gcc: 3.4.6 20060404 (Red Hat 3.4.6-10)

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, asf, from '/home/swimm7/public_html/swb/sites/default/files/JetixNewEpisodesPromo.wmv':
 Duration: 00:00:46.80, start: 3.000000, bitrate: 628 kb/s
   Stream #0.0: Audio: wmav2, 44100 Hz, stereo, s16, 64 kb/s
   Stream #0.1: Video: wmv1, yuv420p, 320x240, 632 kb/s, 25 tbr, 1k tbn, 1k tbc
Unknown encoder 'mp3'

I thought it might have something to do with the MP3 encoder and followed the instructions Here , but still no joy.

attheshow’s picture

Sounds like you don't have your FFMPEG binary setup/compiled correctly.

pobster’s picture

Isn'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

big_smile’s picture

In my input I have:

ffmpeg Command:

-i @input -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 @output

Is this correct? - it doesn't work!

big_smile’s picture

Sounds like you don't have your FFMPEG binary setup/compiled correctly.

I received this message from the host:

There are a few things incorrect in your code statement you submitted. The command line for ffmpeg is where the problem is based. This can be seen from the error you recieve: "stream 1 codec frame rate differs from container frame rate". This means your video frame rate is not the same as what you are attempting to force it to. Also, I found that some of the filepaths did not exist where your command was trying to access/write them.

I was successful using the following command:
/usr/local/bin/ffmpeg -i /home/swimm7/public_html/swb/sites/default/files/JetixNewEpisodesPromo_0.wmv -f flv /home/swimm7/public_html/swb/JetixNewEpisodesPromo_56.flv
Which can be executed from here: http://www.swimmingwithbabies.com/testing.php

Please keep in mind that our support will not be able to assist in most coding issues as source code modification/troubleshooting is far out of the scope of our support service. In this case, it appears correcting the filepaths and omitting the incompatible argument flags resolves the issue. I hope this information has been helpful.

I'm not sure what this means - could some one give me some pointers?

attheshow’s picture

Assigned: Unassigned » attheshow
Status: Active » Fixed

My 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

Status: Fixed » Closed (fixed)

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

big_smile’s picture

After 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?

big_smile’s picture

Status: Closed (fixed) » Active

After 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?

attheshow’s picture

The 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.

big_smile’s picture

I 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).

attheshow’s picture

Are you able to confirm that the command that they're running is the same as what's being run by the module?

big_smile’s picture

Yes, 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!

attheshow’s picture

Status: Active » Postponed (maintainer needs more info)

Can you please post the message you're receiving when the conversion fails? I'm not sure if any further details might be included there...

big_smile’s picture

Hi

The message is:

* Conversion failed.
* Conversion failed.

I have tried creating a brand new website from scratch, but the same problem happens.

attheshow’s picture

Status: Postponed (maintainer needs more info) » Fixed

This 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.

big_smile’s picture

This 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.

vip_sa’s picture

I 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?

vip_sa’s picture

Status: Fixed » Active
pobster’s picture

Look 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

vip_sa’s picture

I 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?

pobster’s picture

The 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

vip_sa’s picture

Hi

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

pobster’s picture

This is the important bit;

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)

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

vip_sa’s picture

How 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!

travist’s picture

/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.

vip_sa’s picture

Thank 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?

pobster’s picture

Just recompile ffmpeg (preferably using the latest svn), you never know it may work anyway using the standard wma decoder.

Pobster

vip_sa’s picture

The 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?

pobster’s picture

If 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

vip_sa’s picture

I 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.

vip_sa’s picture

They 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'

vip_sa’s picture

Priority: Normal » Critical
vip_sa’s picture

Priority: Critical » Minor

So I suppose I should forget about having flashvideo on my site.

pobster’s picture

See, 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;

default/files/[user]/sillon_2.flv

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

vip_sa’s picture

Apologies 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!

attheshow’s picture

Status: Active » Fixed

Marking as fixed.

Status: Fixed » Closed (fixed)

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

Marek_R’s picture

Today, 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?

Marek_R’s picture

Status: Closed (fixed) » Active

test

travist’s picture

Status: Active » Closed (fixed)

You 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.

ghiley’s picture

Component: Miscellaneous » Code
Category: support » bug

Hi, 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.