开发者

ffmpeg encode mpeg

开发者 https://www.devze.com 2023-03-26 16:42 出处:网络
I\'m attempting to create a 1s clip from a mp4 file into mpeg using ffmpeg, but I get an error: ffmpeg -i /tmp/myfile.mp4 -y -ss 00:00:01 -t 00:00:01.000 /tmp/myfilesplit.1.mpg

I'm attempting to create a 1s clip from a mp4 file into mpeg using ffmpeg, but I get an error:

ffmpeg -i /tmp/myfile.mp4 -y -ss 00:00:01 -t 00:00:01.000 /tmp/myfilesplit.1.mpg

ffmpeg version N-31716-g318fd9d, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug  1 2011 16:10:33 with gcc 4.4.5
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx
  libavutil    51. 11. 1 / 51. 11. 1
  libavcodec   53.  9. 0 / 53.  9. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 27. 5 /  2. 27. 5
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 0 codec frame rate differs from container frame rate: 18.75 (1706/91) -> 18.75 (75/4)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/myfile.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.93.0
  Duration: 00:14:29.70, start: 0.000000, bitrate: 530 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 400 kb/s, 9.38 fps, 18.75 tbr, 853 tbn, 18.75 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
[buffer @ 0x19cee60] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[mpeg1video @ 0x19cf4a0] MPEG1/2 does not support 15/1 fps
Output #0, mpeg, to '/tmp/myfilesplit.1.mpg':
    Stream #0.0(und): Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k 开发者_运维百科tbn, 15 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: mp2, 44100 Hz, stereo, s16, 64 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

How can I resolve the error [mpeg1video @ 0x19cf4a0] MPEG1/2 does not support 15/1 fps ? Adding empty P-frames somehow, or similar? I am attempting to get this done using any input, so I'm looking for a generic way I can program into my php script.


You should use ntsc-vcd target. So your can use command like this

 ffmpeg  -t 00:00:01 -i /tmp/myfile.mp4 -target ntsc-vcd /tmp/myfilesplit.1.mpg
0

精彩评论

暂无评论...
验证码 换一张
取 消