[FFmpeg-user] mpeg2video bitrate is low in MPEG-TS?

Vladimir Grishchenko vladgri at hotmail.com
Thu Apr 30 23:50:55 EEST 2020


Hello,

I'm trying to make sense of the video ES bitrate I'm getting in a simple MPEG-TS containing mpeg-2 at 2000kbps/mp2 at 128kbps program created with ffmpeg 3.4.7. I'm using 8% overhead for the muxrate for the total of (2000 + 128) * 1.08 =  2298k. This is the cmdline I use, the input.mp4 is a h264/aac video:

ffmpeg -i input.mp4 -c:v mpeg2video -pix_fmt yuv420p -g 15 -b:v 2000k -minrate:v 2000k -maxrate:v 2000k -bufsize:v 1000k -aspect 4:3 -vf "scale=640:-2,pad=640:480:(ow-iw)/2:(oh-ih)/2" -r 29.97 -c:a mp2 -b:a 128k -ar:a 44100 -program program_num=5:st=0:st=1 -f mpegts -muxrate 2298k -pcr_period 20 test4.ts

All goes well, but analysis of the TS reveals that video bitrate is less than 1700kbps which is well below the 2000k I'm aiming for and there is a good amount of padding in the TS presumably as a result of the video rate undershoot. Is this normal? Is my logic for the muxrate calculation flawed perhaps? Thanks for any info.

-Vlad

===============================================================================
|  SERVICES ANALYSIS REPORT                                                   |
|=============================================================================|
|  Global PID's                                                               |
|  TS packets: 9,673, PID's: 3 (clear: 3, scrambled: 0)                       |
|-----------------------------------------------------------------------------|
|     PID  Usage                                     Access          Bitrate  |
|   Total  Global PID's ................................. C      484,260 b/s  |
|   Subt.  Global PSI/SI PID's (0x00-0x1F) .............. C       19,324 b/s  |
|  0x0000  PAT .......................................... C       16,320 b/s  |
|  0x0011  SDT/BAT ...................................... C        3,003 b/s  |
|  0x1FFF  Stuffing ..................................... C      464,936 b/s  |
|=============================================================================|
|  Service: 0x0005 (5), TS: 0x0001 (1), Original Netw: 0xFF01 (65281)         |
|  Service name: Service01, provider: FFmpeg                                  |
|  Service type: 0x01 (Digital television service)                            |
|  TS packets: 36,229, PID's: 3 (clear: 3, scrambled: 0)                      |
|  PMT PID: 0x1000 (4096), PCR PID: 0x0100 (256)                              |
|-----------------------------------------------------------------------------|
|     PID  Usage                                     Access          Bitrate  |
|   Total  Digital television service ................... C    1,813,738 b/s  |
|  0x0100  MPEG-2 Video (640x480p, @24 Hz, 4:3, 4:2:0) .. C    1,665,701 b/s  |
|  0x0101  MPEG-1 Audio (eng, Audio layer II, 128 kb/s,   C      131,716 b/s  |
|  0x1000  PMT .......................................... C       16,320 b/s  |
|          (C=Clear, S=Scrambled, +=Shared)                                   |
===============================================================================


More information about the ffmpeg-user mailing list