我在我的CentOS服务器上使用ffmpeg-php将MP4视频转换成FLV (没有flvtool2的干预,因为它没有安装)。
FLV视频已创建,但没有播放器能够检索到视频时长,这会在尝试查找视频时产生严重问题。我正在使用Moyea的Flash Video MX Pro创建的播放器,但这个问题也发生在其他FLV播放器上,所以我确信ffmpeg-php没有创建具有适当长度数据的FLV。
我的MP4视频是兼容的,因为ffmpeg-php可以从那里获得正确的视频长度,但它不会将该长度信息应用到FLV文件中。我假设flvtool2只是检索元数据,与输出的FLV视频长度无关,请让我知道这是否正确。
我使用这个命令进行转换:
$command = "ffmpeg -i myvideo.mp4 -ar 22050 -ab 64k -f flv -s 320x240 -y myvideo.flv";
$result = @shell_exec($command);这是我的ffmpeg-php版本:
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)在这个问题上的任何帮助都将非常感谢。
发布于 2009-12-22 19:18:52
视频转换完成后,使用以下命令:
flvtool2 -U filename.flv在Ubuntu上安装此软件包的命令为:
sudo apt-get install flvtool2https://stackoverflow.com/questions/1532703
复制相似问题