簡體   English   中英

不使用 ffmpeg 將 flv 文件轉換為 mp4 文件

[英]Not converting flv file to mp4 file using ffmpeg

我為我的 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/test1.flv -strict -2 ffmpeg/test1.mp4

它會起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM