Hi, I've built a stream with ffmpeg with the following command line : ffmpeg -y -s hd1080 -i HD/HP/h264/HP6_1080.mov -vstats_file /tmp/stats_HP_6_S3.log -psnr -acodec libfaac -ab 128k -vcodec libx264 -vpre hq -vpre main -b 10000000 -bt 10000000 -threads 0 -level 31 -s hd480 -r 30 /tmp/HP6_S3.mp4 When I gather information on the created stream with ffprobe I get : Duration: 00:01:41.03, start: 0.000000, bitrate: 7277 kb/s Stream #0.0(eng): Video: h264, yuv420p, 852x480, 7143 kb/s, 23.99 fps, 30 tbr, 30 tbn, 60 tbc Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s And when I look at the vstats_file I see that the bitrate fluctuates (a lot) between 45000 kb/s and 0 kb/s. The mean is : 9095.1 kb/s and the standard deviation is 8501.50. What those values mean ? How are they related together ? thanks, Maxime -- Maxime Louvel +33 6 85 91 05 30 3 rue charreton 38000 Grenoble France
Date: Wed, 17 Mar 2010 13:32:26 +0100 From: maxime louvel <m.louvel at gmail.com> Sender: ffmpeg-user-bounces at mplayerhq.hu
Hi,
I've built a stream with ffmpeg with the following command line : ffmpeg -y -s hd1080 -i HD/HP/h264/HP6_1080.mov -vstats_file /tmp/stats_HP_6_S3.log -psnr -acodec libfaac -ab 128k -vcodec libx264 -vpre hq -vpre main -b 10000000 -bt 10000000 -threads 0 -level 31 -s hd480 -r 30 /tmp/HP6_S3.mp4
When I gather information on the created stream with ffprobe I get :
Duration: 00:01:41.03, start: 0.000000, bitrate: 7277 kb/s Stream #0.0(eng): Video: h264, yuv420p, 852x480, 7143 kb/s, 23.99 fps, 30 tbr, 30 tbn, 60 tbc Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
And when I look at the vstats_file I see that the bitrate fluctuates (a lot) between 45000 kb/s and 0 kb/s. The mean is : 9095.1 kb/s and the standard deviation is 8501.50.
What those values mean ? How are they related together ?
You are generating a VBR (variable bit-rate) output file, which is normal. The codec continually adjusts the bit-rate continuously to maximize quality while maintaining an average bit-rate near that specified. The process is statistical and, especially with single-pass transcoding, requires making assumptions about the data not yet read from the input data. The result was a 9.1 Mbps average bit-rate with a standard deviation of 8501.50. I am not sure fi the deviation is Kbps or bps, but I assume it is bps. If it is Kbps, something is really weird. If you want a specific bit rate, like 10 Mbps, I would suggest doing a 2-pass transcode. That lets the codec know what is coming so it can "guess" at the best bit-rate more accurately and this should both improve quality and hit the desired average bit-rate more closely. (It will never be right at 10Mbps, though.) -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman at es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751
Thanks for the answers, actually the standard deviation is in Kbps but the average bitrate is much more stable I'm going to encode the stream in two pass an see what happens maxime On Wed, Mar 17, 2010 at 6:22 PM, Kevin Oberman <oberman at es.net> wrote:
Date: Wed, 17 Mar 2010 13:32:26 +0100 From: maxime louvel <m.louvel at gmail.com> Sender: ffmpeg-user-bounces at mplayerhq.hu
Hi,
I've built a stream with ffmpeg with the following command line : ffmpeg -y -s hd1080 -i HD/HP/h264/HP6_1080.mov -vstats_file /tmp/stats_HP_6_S3.log -psnr -acodec libfaac -ab 128k -vcodec libx264 -vpre hq -vpre main -b 10000000 -bt 10000000 -threads 0 -level 31 -s hd480 -r 30 /tmp/HP6_S3.mp4
When I gather information on the created stream with ffprobe I get :
Duration: 00:01:41.03, start: 0.000000, bitrate: 7277 kb/s Stream #0.0(eng): Video: h264, yuv420p, 852x480, 7143 kb/s, 23.99 fps, 30 tbr, 30 tbn, 60 tbc Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 127 kb/s
And when I look at the vstats_file I see that the bitrate fluctuates (a lot) between 45000 kb/s and 0 kb/s. The mean is : 9095.1 kb/s and the standard deviation is 8501.50.
What those values mean ? How are they related together ?
You are generating a VBR (variable bit-rate) output file, which is normal. The codec continually adjusts the bit-rate continuously to maximize quality while maintaining an average bit-rate near that specified. The process is statistical and, especially with single-pass transcoding, requires making assumptions about the data not yet read from the input data.
The result was a 9.1 Mbps average bit-rate with a standard deviation of 8501.50. I am not sure fi the deviation is Kbps or bps, but I assume it is bps. If it is Kbps, something is really weird.
If you want a specific bit rate, like 10 Mbps, I would suggest doing a 2-pass transcode. That lets the codec know what is coming so it can "guess" at the best bit-rate more accurately and this should both improve quality and hit the desired average bit-rate more closely. (It will never be right at 10Mbps, though.) -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman at es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751 _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
-- Maxime Louvel +33 6 85 91 05 30 3 rue charreton 38000 Grenoble France
participants (2)
-
m.louvel@gmail.com -
oberman@es.net