关闭。这个问题是off-topic .它目前不接受答案。
想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。
9年前关闭。
Improve this question
使用 ffmpeg
我将 FLV 文件转换为 MP4 文件。但是 MP4 文件有 0 个字节。我用来转换的命令是
ffmpeg -i sample.flv -b 1104k -ab 122k sample.mp4
这是我为上述 ffmpeg 命令得到的输出:
ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
built on Jan 24 2013 18:01:36 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[flv @ 0x64f7a0] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from '/home/kirthiga/Desktop/videopine/test.flv':
Metadata:
creationdate : Thu Mar 28 12:46:29
Duration: 00:00:09.82, start: 0.000000, bitrate: N/A
Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: nellymoser, 22050 Hz, mono, s16
[buffer @ 0x64f720] w:320 h:240 pixfmt:yuv420p
encoder 'aac' is experimental and might produce bad results.
Add '-strict experimental' if you want to use it.
最佳答案
首先,您使用的 ffmpeg
的版本过时、名称错误且损坏。这实际上不是来自 FFmpeg,而是来自 Libav,一个 FFmpeg 分支。 Read this for more .
错误是您的版本(出于某种原因)似乎没有配置任何其他库,因此您将很难以适当的质量实际转换为任何有用的东西。
要使您的命令正常工作,请使用 -strict experimental
应该做,但我建议你要么 download a recent static build FFmpeg 或 compile it yourself具有诸如 libfdk_aac
之类的依赖项和 libx264
.
然后你可以这样做:
ffmpeg -i in.flv -crf 23 -c:v libx264 -c:a libfdk_aac -vbr 4 out.mp4
在 18 和 28 之间更改 CRF 参数以控制质量。越少越好,默认为 23。对于音频,使用 VBR 选项设置质量,4 提供大约 128 kBit/s 的立体声,值从 1 到 5(越高意味着越好)。
如果您真的必须使用恒定比特率,请尝试以下操作:
ffmpeg -i in.flv -c:v libx264 -b:v 1104K -c:a libfdk_aac -b:a 122k out.mp4
见x264 encoding guide和 AAC encoding guide在 FFmpeg wiki 上获取更多选项。
关于ffmpeg - 使用 ffmpeg 将 FLV 转换为 MP4 格式后,MP4 文件有 0 个字节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15677900/