ffmpeg FLV到FLV转换失败

时间:2013-04-22 23:57:34

标签: php ffmpeg clipbucket

我正在使用ClipBucket。我已经设置了ffmpeg,我可以毫无问题地将AVI,WMV文件转换为FLV视频文件,但现在我正在尝试将FLV视频文件转换为具有不同视频质量的FLV视频文件。

但是,转换时出错。有人能帮帮我吗?

日志:

Preparing file...
Unknown file details - Unable to get video details using FFMPEG 

Converting Video
Conversion Command : /usr/local/bin/ffmpeg -i /home/myspace86/myspace86.com/files/conversion_queue/136667418894906.flv -f flv -vcodec libx264 -r 30 -vf 'movie=/home/myspace86/public_html/player_logo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]' -ab 320000 /home/myspace86/myspace86.com/files/videos/136667418894906.flv 2> /home/myspace86/myspace86.com/files/temp/136667424191b8e.tmp

转换详情

ffmpeg version N-52385-g6d7ec4f Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 22 2013 16:08:27 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
configuration: --prefix=/usr/local --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libx264 --enable-libxvid
libavutil 52. 27.100 / 52. 27.100
libavcodec 55. 5.100 / 55. 5.100
libavformat 55. 3.100 / 55. 3.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 60.101 / 3. 60.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, flv, from '/home/myspace86/myspace86.com/files/conversion_queue/136667418894906.flv':
Metadata:
metadatacreator : Yet Another Metadata Injector for FLV - Version 1.4
hasKeyframes : true
hasVideo : true
hasAudio : true
hasMetadata : true
canSeekToEnd : false
datasize : 40992128
videosize : 37546219
audiosize : 3247153
lasttimestamp : 728
lastkeyframetimestamp: 727
lastkeyframelocation: 40978250
Duration: 00:12:08.16, start: 0.000000, bitrate: 450 kb/s
Stream #0:0: Video: vp6f, yuv420p, 648x459, 409 kb/s, 29.97 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: mp3, 22050 Hz, mono, s16p, 32 kb/s
[libx264 @ 0x146d900] height not divisible by 2 (648x459)
Output #0, flv, to '/home/myspace86/myspace86.com/files/videos/136667418894906.flv':
Metadata:
metadatacreator : Yet Another Metadata Injector for FLV - Version 1.4
hasKeyframes : true
hasVideo : true
hasAudio : true
hasMetadata : true
canSeekToEnd : false
datasize : 40992128
videosize : 37546219
audiosize : 3247153
lasttimestamp : 728
lastkeyframetimestamp: 727
lastkeyframelocation: 40978250
Stream #0:0: Video: h264, yuv420p, 648x459, q=-1--1, 90k tbn, 30 tbc
Stream #0:1: Audio: none, 22050 Hz, mono, s16p
Stream mapping:
Stream #0:0 -> #0:0 (vp6f -> libx264)
Stream #0:1 -> #0:1 (mp3 -> libmp3lame)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


Unknown file details - Unable to get output video details using FFMPEG 


Time Took : 0.3056 seconds

conversion_status : completed

1 个答案:

答案 0 :(得分:1)

[libx264 @ 0x146d900] height not divisible by 2 (648x459)

那是你的错误。通常,在处理任意输入时,您可能希望包含一个缩放器,该缩放器强制输出可被2整除,例如,以下,其中高度固定为460:

scale=trunc(oh*a*2)/2:460

或者您之前解析输入文件,看看是否需要重新缩放。另见:ffmpeg/avconv force scaled output to be divisible by 2