views:

515

answers:

1

Hi, I'm converting MP4 videos to FLV using ffmpeg-php on my CentOS server (without intervention from flvtool2 because it's not installed).

The FLV videos are created, but no player is capable of retrieving the video duration, this creates serious issues when trying to seek the video. I'm using the player created by Moyea's Flash Video MX Pro, but the problem also happens with other FLV players as well, so I'm sure that ffmpeg-php is not createing the FLV with the proper length data.

My MP4 videos are compatible because ffmpeg-php CAN get the video length properly from then, yet it does not apply that length information into the FLV file. I assume flvtool2 is ONLY to retrieve meta-data and has nothing to do with the output FLV video length, let me know if this is correct.

This command I use for conversion:

$command = "ffmpeg -i myvideo.mp4 -ar 22050 -ab 64k -f flv -s 320x240 -y myvideo.flv";
$result = @shell_exec($command);

This is my ffmpeg-php version:

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --extra-cflags=-fPIC --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-x11grab
  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
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jul 24 2009 01:40:27, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)

Any help on this issue will be greatly appreciated.

+1  A: 

Once the video is converted use

flvtool2 -U filename.flv

You should install this package before u can use it

sudo apt-get install flvtool2 ( ubuntu )
kishore