不使用ffmpeg将flv文件转换为mp4文件

Not converting flv file to mp4 file using ffmpeg

我为我的 centos 安装了 ffmpeg server.then 我通过使用 ffmpeg.But 它创建 0 字节错误 mp4 文件将我的 flv 文件转换为 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/test1.flv -strict -2 ffmpeg/test1.mp4

它会起作用。