用以下命令合成mp4文件后 苹果相册和微信里都能正常播放 但是到了剪辑软件就不行了
ffmpeg -i /data/test1.mp3 -i /data/audio.png -vf scale=640x480,setsar=sar=3/4,setdar=dar=1/1 -avoid_negative_ts 1 -y -vcodec libx264 -crf 18 -pix_fmt yuvj420p -qcomp 0.8 -preset medium -acodec aac -b:a 400k -x264-params ref=4 -profile:v High -level 4.1 -movflags +faststart /data/t.mp4
以下是linux执行后的结果 求大神解答
ffmpeg version 4.4.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[mp3 @ 0x6cc2180] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/data/test1.mp3':
Duration: 00:00:09.61, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 16000 Hz, mono, fltp, 128 kb/s
Input #1, png_pipe, from '/data/audio.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 128x128, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #1:0 -> #0:0 (png (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[swscaler @ 0x6d19900] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x6cda980] using SAR=3/4
[libx264 @ 0x6cda980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x6cda980] profile High, level 4.1, 4:2:0, 8-bit
[libx264 @ 0x6cda980] 264 - core 164 r3075 66a5bc1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=18.0 qcomp=0.80 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[aac @ 0x6cd7780] Too many bits 25600.000000 > 6144 per frame requested, clamping to max
Output #0, mp4, to '/data/t.mp4':
Metadata:
encoder : Lavf58.76.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuvj420p(pc, progressive), 640x480 [SAR 3:4 DAR 1:1], q=2-31, 25 fps, 12800 tbn
Metadata:
encoder : Lavc58.134.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 96 kb/s
Metadata:
encoder : Lavc58.134.100 aac
[mp4 @ 0x6cd4c80] Starting second pass: moving the moov atom to the beginning of the file
frame= 1 fps=0.0 q=21.0 Lsize= 93kB time=00:00:09.60 bitrate= 79.6kbits/s speed=52.9x
video:6kB audio:85kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.194508%
[libx264 @ 0x6cda980] frame I:1 Avg QP:15.28 size: 5430
[libx264 @ 0x6cda980] mb I I16..4: 36.6% 55.4% 8.0%
[libx264 @ 0x6cda980] 8x8 transform intra:55.4%
[libx264 @ 0x6cda980] coded y,uvDC,uvAC intra: 15.4% 22.2% 15.4%
[libx264 @ 0x6cda980] i16 v,h,dc,p: 81% 10% 9% 0%
[libx264 @ 0x6cda980] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 24% 22% 1% 1% 0% 4% 1% 3%
[libx264 @ 0x6cda980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 31% 21% 2% 3% 1% 5% 1% 3%
[libx264 @ 0x6cda980] i8c dc,h,v,p: 74% 12% 13% 1%
[libx264 @ 0x6cda980] kb/s:1086.00
[aac @ 0x6cd7780] Qavg: 65536.000
[root@S172-16-10-161 ffmpeg]#
生成的mp4文件信息如下
[root@S172-16-10-161 ffmpeg]# ffmpeg -i /data/t.mp4
ffmpeg version 4.4.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/t.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Duration: 00:00:09.68, start: 0.000000, bitrate: 78 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 640x480 [SAR 3:4 DAR 1:1], 1224 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 72 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
At least one output file must be specified
[root@S172-16-10-161 ffmpeg]#