我想要执行HLS分割,并在分离的文件中获得音频和视频的每个片段从.mp4视频与音频。不需要调整比特率,因为这会导致额外的延迟。
我试着用
ffmpeg -i videoInput.mp4 -c:v复制-c:a复制-hls_segment_type mpegts -map a:0 -map v:0 -hls_time 1 out.m3u8 audio.ts
它完美地生成视频文件,但只生成一个音频文件。
谢谢。
发布于 2022-10-09 20:32:44
从FFmpeg文档中我了解到:
When there are two or more variant streams, the output filename
pattern must contain the string "%v", this string specifies the
position of variant stream index in the output media playlist
filenames. The string "%v" may be present in the filename or in the
last directory name containing the file. If the string is present
in the directory name, then sub-directories are created after
expanding the directory name pattern. This enables creation of
variant streams in subdirectories.“”“
对我来说:
ffmpeg -hide_banner -t 5:00 -i "$IN" -c copy -map a:0 -map v:0 -hls_segment_type mpegts -hls_time 1 -f hls -var_stream_map "a:0 v:0" v_%v/file.m3u8在v_0 & v_1中创建两个流。
发布于 2020-08-17 08:49:28
我不知道确切的解决方案,但作为一种解决办法,您可以先用以下方法提取音频:
ffmpeg -i video.mp4 -c:a copy -vn audio.aac 然后分别对视频和音频文件进行分段。
音频:
ffmpeg -i audio.aac -c:a copy -hls_segment_type mpegts -map a:0 -hls_time 1 out_aud.m3u8视频:
ffmpeg -i video.mp4 -c:v copy -hls_segment_type mpegts -map v:0 -hls_time 1 out_vid.m3u8https://stackoverflow.com/questions/63413237
复制相似问题