0

I want to convert a video from one format to another using ffmpeg. I try lots of code but it does not convert the video.

For example:

exec("ffmpeg -i mickey.flv -ar 22050 -ab 32 -f avi -s 320x240 mickey.avi ");

This code does not convert the video, it does not show any error, it is loading continuously.

Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
Meena
  • 957
  • 5
  • 19
  • 35
  • 1
    I do not think that this is really programming-related. Your problem is how to use ffmpeg. – jwueller Jan 07 '11 at 10:30
  • 1
    The command "ffmpeg -y -i from.avi -ar 44100 -f flv -b 919k to.flv" works fine for me – Igor Jan 07 '11 at 10:33
  • Try to run the same command from the shell and see what error you get. It can take hours to convert a video, maybe you should just wait? – Silver Light Jan 07 '11 at 10:34
  • it may am unaware about ffmpeg is there any other link that give information about the ffmpeg means please suggest me – Meena Jan 07 '11 at 10:34
  • ffmpeg is an external program (that you are executing using the php `exec()` function). Information about it is here: http://www.ffmpeg.org/ – Spiny Norman Jan 07 '11 at 10:36
  • is it possible to spead up the time bcoz i wait nearly 1 hr but no response. i am working in this neearly 1 week still i unable to solve this . please guide me – Meena Jan 07 '11 at 10:46

2 Answers2

1

It is impossible to pinpoint the problem, because you are executing an external application and any number of things could be going wrong in the process.

See this question for a number of very good hints to debug exec() commands.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • i did not find what i missed out ok atlast i decided to do change the extension of the vedio. for example if my user wants to convert the flv videos into avi just change the flv vedio extention into avi .if i did that it may rise any problem – Meena Jan 07 '11 at 11:23
  • @Meena it won't work for players that can't deal with AVI videos. You'll have to properly convert it – Pekka Jan 07 '11 at 11:44
1

Display FFMPEG Error Output:

Command Line:

$command = "ffmpeg -i mickey.flv -ar 22050 -ab 32 -f avi -s 320x240 mickey.avi ";

exec($command . ' 2>&1', $output);

print_r($output);
Çetin
  • 11
  • 3