【问题标题】:Not converting flv file to mp4 file using ffmpeg不使用 ffmpeg 将 flv 文件转换为 mp4 文件
【发布时间】:2015-10-04 13:51:44
【问题描述】:

我为我的 centos 服务器安装了 ffmpeg。然后我使用 ffmpeg 将我的 flv 文件转换为 mp4。但是它创建了 0 字节错误 mp4 文件。 转换代码

shell_exec('/usr/local/bin/ffmpeg -i ffmpeg/test1.flv-c copy -copyts ffmpeg/test.mp4');

ffmpeg 版本是

ffmpeg version N-75682-g5fa5e73 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  configuration:
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.102 / 57.  2.102
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  9.101 /  6.  9.101
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfi     
le}...

运行后我得到以下输出

ffmpeg version N-75682-g5fa5e73 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  configuration:
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.102 / 57.  2.102
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  9.101 /  6.  9.101
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
Input #0, flv, from 'ffmpeg/test1.flv':
  Metadata:
    starttime       : 0
    totalduration   : 67
    totaldatarate   : 354
    bytelength      : 2954448
    canseekontime   : true
    sourcedata      : BD075F34AHM1443878448533564
    purl            :
    pmsg            :
    httphostheader  : r7---sn-xupn5a5u-4wge7.googlevideo.com
  Duration: 00:01:06.63, start: 0.000000, bitrate: 354 kb/s
    Stream #0:0: Video: flv1, yuv420p, 426x240, 288 kb/s, 30 fps, 30 tbr, 1k tbn                                                                                                                                                             , 1k tbc
    Stream #0:1: Audio: mp3, 22050 Hz, mono, s16p, 65 kb/s
[aac @ 0x2b4b640] The encoder 'aac' is experimental but experimental codecs are                                                                                                                                                              not enabled, add '-strict -2' if you want to use it.

【问题讨论】:

  • 你应该在调用 /usr/local/bin/ffmpeg -i ffmpeg/test.avi -c copy -copyts ffmpeg/test.mp4 时发布 ffmpeg 的确切输出/堆栈跟踪
  • 现在可以工作了....感谢 seba.wagner 的帮助

标签: php ffmpeg centos


【解决方案1】:

请试试这个

/usr/local/bin/ffmpeg -i ffmpeg/test1.flv -strict -2 ffmpeg/test1.mp4

它会起作用的。

【讨论】:

  • 感谢 Basil 的宝贵回答
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-06-02
  • 2012-01-20
  • 2017-02-16
  • 2014-11-04
  • 2016-01-14
  • 2013-03-18
  • 2021-02-07
相关资源
最近更新 更多