gpt4 book ai didi

ffmpeg Stream map 'a:0' 不匹配任何流

转载 作者:行者123 更新时间:2023-12-04 22:52:51 26 4
gpt4 key购买 nike

我尝试使用 ffmpeg 将 mp4 转换为 hls

ffmpeg -i test_video.mp4 -y
-preset veryslow -keyint_min 100 -g 100 -sc_threshold 0 -r 25 -c:v libx264 -pix_fmt yuv420p
-map v:0 -s:0 960x540 -b:v:0 2M -maxrate:0 2.14M -bufsize:0 3.5M
-map v:0 -s:1 416x234 -b:v:1 145k -maxrate:1 155k -bufsize:1 220k
-map v:0 -s:2 640x360 -b:v:2 365k -maxrate:2 390k -bufsize:2 640k
-map v:0 -s:3 $768x432 -b:v:3 730k -maxrate:3 781k -bufsize:3 1278k
-map v:0 -s:4 768x432 -b:v:4 1.1M -maxrate:4 1.17M -bufsize:4 2M
-map v:0 -s:5 1280x720 -b:v:5 3M -maxrate:5 3.21M -bufsize:5 5.5M
-map v:0 -s:6 1280x720 -b:v:6 4.5M -maxrate:6 4.8M -bufsize:6 8M
-map v:0 -s:7 1920x1080 -b:v:7 6M -maxrate:7 6.42M -bufsize:7 11M
-map v:0 -s:8 1920x1080 -b:v:8 7.8M -maxrate:8 8.3M -bufsize:8 14M
-map a:0 -map a:0 -map a:0 -map a:0 -map a:0 -map a:0 -map a:0 -map a:0 -map a:0 -c:a aac -b:a 128k -ac 1 -ar 44100
-f hls -hls_time 4 -hls_playlist_type vod -hls_flags independent_segments
-master_pl_name hls_multi/hls.m3u8
-hls_segment_filename hls_multi/stream_%v/s%06d.ts
-strftime_mkdir 1
-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2 v:3,a:3 v:4,a:4 v:5,a:5 v:6,a:6 v:7,a:7 v:8,a:8" hls_multi/stream_%v.m3u8


但我收到了这条消息

Stream map 'a:0' matches no streams. To ignore this, add a trailing'?' to the map.


所以我尝试使用以下命令来做到这一点:

ffmpeg -i test_video.mp4 -y
-preset veryslow -keyint_min 100 -g 100 -sc_threshold 0 -r 25 -c:v libx264 -pix_fmt yuv420p
-map v:0 -s:0 960x540 -b:v:0 2M -maxrate:0 2.14M -bufsize:0 3.5M
-map v:0 -s:1 416x234 -b:v:1 145k -maxrate:1 155k -bufsize:1 220k
-map v:0 -s:2 640x360 -b:v:2 365k -maxrate:2 390k -bufsize:2 640k
-map v:0 -s:3 $768x432 -b:v:3 730k -maxrate:3 781k -bufsize:3 1278k
-map v:0 -s:4 768x432 -b:v:4 1.1M -maxrate:4 1.17M -bufsize:4 2M
-map v:0 -s:5 1280x720 -b:v:5 3M -maxrate:5 3.21M -bufsize:5 5.5M
-map v:0 -s:6 1280x720 -b:v:6 4.5M -maxrate:6 4.8M -bufsize:6 8M
-map v:0 -s:7 1920x1080 -b:v:7 6M -maxrate:7 6.42M -bufsize:7 11M
-map v:0 -s:8 1920x1080 -b:v:8 7.8M -maxrate:8 8.3M -bufsize:8 14M
-map a:0? -map a:0? -map a:0? -map a:0? -map a:0? -map a:0? -map a:0? -map a:0? -map a:0? -c:a aac -b:a 128k -ac 1 -ar 44100
-f hls -hls_time 4 -hls_playlist_type vod -hls_flags independent_segments
-master_pl_name hls_multi/hls.m3u8
-hls_segment_filename hls_multi/stream_%v/s%06d.ts
-strftime_mkdir 1
-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2 v:3,a:3 v:4,a:4 v:5,a:5 v:6,a:6 v:7,a:7 v:8,a:8" hls_multi/stream_%v.m3u8


并收到此消息:

[hls @ 0x7f9e59808200] Unable to map stream at a:0 [hls @0x7f9e59808200] Variant stream info update failed with status ffffffeaCould not write header for output file #0 (incorrect codec parameters?): Invalid argument Error initializing output stream 0:8 --


命令:

ffprobe -i test_video.mp4


给了我这个输出:

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.62)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1 --enable-shared--enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 /58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 /3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_video.mp4': Metadata:major_brand : mp42minor_version : 0compatible_brands: mp42mp41isomavc1creation_time : 2016-10-29T07:22:11.000000Z Duration: 00:01:00.12, start: 0.000000, bitrate: 2394 kb/sStream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2392 kb/s, 25 fps, 25tbr, 25 tbn, 50 tbc (default)Metadata:creation_time : 2016-10-29T07:22:11.000000Zhandler_name : L-SMASH Video Handlerencoder : AVC Coding


有什么建议么?
谢谢

最佳答案

如果这是完整输出,则没有音频流。从 -var_stream_map 中删除所有对音频流的引用.

关于ffmpeg Stream map 'a:0' 不匹配任何流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64265666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com