0

I am using fileuploader.js to upload a video file. Now i want to convert the video format to .mp4. I have used ffmpeg and php to convert the video to .mp4 after upload. The sample segment i used is

$converted = "uploads/".$uniqid.".mp4"; //$uniqid is the id for the video after upload
$cmd = "$ffmpeg -i $sourceUrl -f mp4 $converted"; //$sourceUrl is the path of the video

I have tried to convert .flv video file to .mp4 format and it does but the problem is i cannot see the video only hear the sound after converting. Is the conversion line used in $cmd incorrect. Please help.

user850234
  • 3,373
  • 15
  • 49
  • 83

1 Answers1

1

Just ffmpeg -i source.flv output.mp4 should be enough, it will use default codecs for mp4. Can you paste the ffmpeg response to the above command?

d33pika
  • 1,997
  • 14
  • 24
  • I tried this but its not working for me. I tried the same in my local system and i am able to see the video but in server its not working. In my server ffmpeg version is 0.6 and in my local the version is 0.8. Is this the issue? Can you please tell how can i upgrade ffmpeg version in server from terminal. – user850234 Jul 18 '12 at 11:11
  • Can you ssh into the server? If yes, follow these steps to upgrade: http://ubuntuforums.org/showthread.php?t=1438052 – d33pika Jul 19 '12 at 05:53
  • Thanks but after running the third command i.e. `sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev` it is showing `E: Unable to locate package libxvidcore4-dev` and exit the installation – user850234 Jul 19 '12 at 13:06
  • Search for libxvidcore4 using sudo apt-cache search libxvidcore , does this throw any options? May be a higher version is available now. – d33pika Jul 20 '12 at 03:10