FFMPEG : Conversion Failed Error when trying tryin

2019-03-04 16:24发布

问题:

Goal is to create stream for facebook from image and audio file.

This is my command:

ffmpeg \
-re -y \
-loop 1 \
-f image2 \
-i ./maxresdefault.jpg \
-i ./audio-loop.mp3 \
-ar 44100 \
-b:a 128k \
-vcodec libx264 \
-vf scale=800:600 \
-b:v 1000k -minrate 1000k -maxrate 1000k -bufsize 500k \
-f flv 'rtmp://rtmp-api.facebook.com:80/rtmp/...'

I get error like:

Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[flv @ 0x1637d00] Packets are not in the proper order with respect to DTSkbits/s    
av_interleaved_write_frame(): Invalid argument   <<< --------
[flv @ 0x1637d00] Failed to update header with correct duration.
[flv @ 0x1637d00] Failed to update header with correct filesize.
frame=   57 fps= 22 q=-1.0 Lsize=    1325kB time=00:01:21.60 bitrate= 133.0kbits/s    
video:26kB audio:1276kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.749549%
[libx264 @ 0x1644760] frame I:1     Avg QP:17.89  size: 26318
[libx264 @ 0x1644760] frame P:14    Avg QP:10.39  size:  7242
[libx264 @ 0x1644760] frame B:42    Avg QP:13.38  size:   118
[libx264 @ 0x1644760] consecutive B-frames:  1.8%  0.0%  0.0% 98.2%
[libx264 @ 0x1644760] mb I  I16..4:  6.7% 61.2% 32.1%
[libx264 @ 0x1644760] mb P  I16..4:  0.2%  0.1%  0.3%  P16..4: 29.3%  2.3%  4.9%  0.0%  0.0%    skip:62.9%
[libx264 @ 0x1644760] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  8.3%  0.0%  0.0%  direct: 0.0%  skip:91.7%  L0: 5.1% L1:94.9% BI: 0.0%
[libx264 @ 0x1644760] 8x8 transform intra:58.0% inter:41.3%
[libx264 @ 0x1644760] coded y,uvDC,uvAC intra: 69.4% 65.4% 52.4% inter: 4.5% 4.2% 2.9%
[libx264 @ 0x1644760] i16 v,h,dc,p: 13% 57% 11% 18%
[libx264 @ 0x1644760] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 27% 10%  4%  6%  7%  7%  6%  8%
[libx264 @ 0x1644760] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 40% 28%  9%  3%  5%  4%  4%  3%  3%
[libx264 @ 0x1644760] i8c dc,h,v,p: 58% 24% 16%  3%
[libx264 @ 0x1644760] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1644760] ref P L0: 93.5%  0.6%  4.8%  1.1%
[libx264 @ 0x1644760] ref B L0: 69.3% 29.3%  1.5%
[libx264 @ 0x1644760] ref B L1: 95.5%  4.5%
[libx264 @ 0x1644760] kb/s:465.47
Conversion failed!

I've been searching for about 4 hours. I believe it's something to do with Sound.

回答1:

I was having the same problem, ended up switching my audio encoding to libvo_aacenc instead of libmp3lame...

I have not tested if the audio still works however the stream is no longer dying.