在 ffmpeg 中执行 HLS 打包和响度标准化的命令是什么样的?
我有一个执行打包的命令:
ffmpeg -i $filepath -filter_complex "[0:v]split=2[v1][v2]; [v1]scale=w=854:h=854[v1out]; [v2]scale=w=640:h=640[v2out]" -map [v1out] -c:v:0 libx265 -b:v:0 3M -maxrate:v:0 3M -minrate:v:0 3M -bufsize:v:0 3M -g 48 -sc_threshold 0 -keyint_min 48 -map [v2out] -c:v:1 libx265 -b:v:1 1M -maxrate:v:1 1M -minrate:v:1 1M -bufsize:v:1 1M -g 48 -sc_threshold 0 -keyint_min 48 -map a:0 -c:a:0 aac -b:a:0 128k -ac 2 -map a:0 -c:a:1 aac -b:a:1 96k -ac 2 -f hls -hls_time 10 -hls_allow_cache 1 -hls_playlist_type vod -hls_segment_type fmp4 -hls_segment_filename $segment_path -hls_fmp4_init_filename $init_file -master_pl_name $master_pl -var_stream_map "v:1,a:1 v:0,a:0" $stream_path
还有一个能达到 Loudnorm 效果的:
ffmpeg -i /path/to/input.wav -af loudnorm=I=-16:TP=-1.5:LRA=11 -f null -
但如何将两者结合起来呢?
答案1
好吧,我应该先试一下。我有点怀疑,因为根据我的经验,HLS 过滤有点不直观,我觉得某人那里肯定之前写过这个命令,但我的尝试似乎工作正常:
ffmpeg -i $filepath -filter_complex "[0:v]split=2[v1][v2]; [v1]scale=w=854:h=854[v1out]; [v2]scale=w=640:h=640[v2out]" -map [v1out] -c:v:0 libx265 -b:v:0 3M -maxrate:v:0 3M -minrate:v:0 3M -bufsize:v:0 3M -g 48 -sc_threshold 0 -keyint_min 48 -map [v2out] -c:v:1 libx265 -b:v:1 1M -maxrate:v:1 1M -minrate:v:1 1M -bufsize:v:1 1M -g 48 -sc_threshold 0 -keyint_min 48 -map a:0 -c:a:0 aac -b:a:0 128k -ac 2 -map a:0 -c:a:1 aac -b:a:1 96k -ac 2 -af loudnorm=I=-16:TP=-1.5:LRA=11 -f hls -hls_time 10 -hls_allow_cache 1 -hls_playlist_type vod -hls_segment_type fmp4 -hls_segment_filename $segment_path -hls_fmp4_init_filename $init_file -master_pl_name $master_pl -var_stream_map "v:1,a:1 v:0,a:0" $stream_path