FFmpeg在转换期间冻结

时间:2016-05-02 23:37:18

标签: ffmpeg mp4 m4a fluent-ffmpeg

我正在尝试在mp4视频和m4a音频文件之间运行合并。其他几个是正确生成的,但是这个开始并在时间00:02:54.08冻结。如果我在几分钟后停止它(ctrl + c),则output.mp4文件有0个字节。我没有很多线索为什么会发生这种情况。有人经历过类似的事吗?

[]# ffmpeg  -i 91dff482-213e-45f7-84ea-a176f255c118.mp4 -i 91dff482-213e-45f7-84ea-a176f255c118.m4a -c:v copy -strict -2 -c:a aac -b:a 160k  output.mp4


 ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
   configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
   libavutil      54. 20.100 / 54. 20.100
   libavcodec     56. 26.100 / 56. 26.100
   libavformat    56. 25.101 / 56. 25.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 11.102 /  5. 11.102
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '91dff482-213e-45f7-84ea-a176f255c118.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1iso6mp41
     encoder         : Lavf56.25.101
   Duration: 00:05:00.00, start: 0.133333, bitrate: 30 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 29 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc (default)
     Metadata:
       rotate          : 90
       handler_name    : VideoHandler
     Side data:
       displaymatrix: rotation of -90.00 degrees
 Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '91dff482-213e-45f7-84ea-a176f255c118.m4a':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2iso6mp41
     encoder         : Lavf56.25.101
   Duration: 00:05:00.15, start: 0.000000, bitrate: 14 kb/s
     Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 13 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
 [aac @ 0x1b761a0] Too many bits per frame requested, clamping to max
 Output #0, mp4, to 'output.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1iso6mp41
     encoder         : Lavf56.25.101
     Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 29 kb/s, 15 fps, 15 tbr, 15360 tbn, 15360 tbc (default)
     Metadata:
       rotate          : 90
       handler_name    : VideoHandler
     Side data:
       displaymatrix: rotation of -90.00 degrees
     Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
       encoder         : Lavc56.26.100 aac
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #1:0 -> #0:1 (aac (native) -> aac (native))
 Press [q] to stop, [?] for help
 frame= 2612 fps= 33 q=-1.0 size=    1568kB time=00:02:54.08 bitrate=  73.8kbits/s    

1 个答案:

答案 0 :(得分:0)

运行

ffmpeg -ss 02:50 -i video -ss 02:50 -i audio -c:v copy -strict -2 -c:a aac -b:a 160k  test.mp4.

如果在几秒钟后停止,则其中一个比特流中存在一些异常,您将不得不重新输入一个或两个输入文件,然后重试,即

ffmpeg -i video -c copy -an newvideo.mp4

ffmpeg -i audio -c copy -vn newaudio.mp4