gpt4 book ai didi

audio - 使用ffmpeg转码后,我发现音频码率不是我期望的值

转载 作者:行者123 更新时间:2023-12-03 01:45:29 25 4
gpt4 key购买 nike

我使用 ffmpeg 将一些文件转码为新格式并使用某些参数。转码后发现有些输出文件的元数据不是我想的,输出的值和我在cmd中设置的不一样。

在转码之前,我检查输入文件的媒体信息:

ffmpeg -i dz2015082000010.mpg

ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
configuration: --enable-static --enable-memalign-hack --enable-libx264 --enable-gpl --enable-pthreads --enable-version3 --enable-avisynth --enable-bzlib --enable-iconv --enable-zlib --enable-nonfree --extra-cflags=-I/usr/local/include/ --extra-ldflags=-L/usr/local/lib --enable-debug=3 --disable-optimizations --enable-nonfree --enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, mpeg, from 'dz2015082000010.mpg': Duration: 00:01:49.30, start: 0.685389, bitrate: 15723 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s At least one output file must be specified



接下来,使用 cmd 行进行转码:
ffmpeg -i dz2015082000010.mpg -vcodec libx264 -b:v 4000k -s 1920x1080 -r 25 -g 25  -vprofile main -acodec aac -strict -2 -b:a 128k -ac 2 -ar 44100 -y output.ts

转码后,我检查输出文件的媒体信息:
ffmpeg -i output.ts    

ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9) configuration: --enable-static --enable-memalign-hack --enable-libx264 --enable-gpl --enable-pthreads --enable-version3 --enable-avisynth --enable-bzlib --enable-iconv --enable-zlib --enable-nonfree --extra-cflags=-I/usr/local/include/ --extra-ldflags=-L/usr/local/lib --enable-debug=3 --disable-optimizations --enable-nonfree --enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, mpegts, from 'full-2.ts': Duration: 00:01:49.30, start: 1.456778, bitrate: 4455 kb/s Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 4 kb/s At least one output file must be specified



我不知道为什么转码后音频比特率变为4 kb/s,我之前用-b:a设置了128k的值,有人可以帮助我吗?顺便说一句,输出文件听起来不错。

最佳答案

native 编码器不会在静音部分浪费位。而且它不做严格的 CBR。如果您确实需要输出接近目标比特率,则可以混合非常低的噪声水平。

关于audio - 使用ffmpeg转码后,我发现音频码率不是我期望的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43993000/

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