]> git.sesse.net Git - ffmpeg/commit
avformat/mpegtsenc: make first_pcr sync with the first valid dts
authorLimin Wang <lance.lmwang@gmail.com>
Mon, 26 Oct 2020 10:31:07 +0000 (18:31 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Tue, 27 Oct 2020 10:18:24 +0000 (18:18 +0800)
commit6f36eb0da71d22aadf8f056f0966bd86656ea57e
tree3e447b9f0e31f4187387087e34417a75ad40e8d8
parentf3568a33c99aed7326e603b7bff3199bc4686d53
avformat/mpegtsenc: make first_pcr sync with the first valid dts

now first_pts assume dts will start from zero, if it's not true(copyts is enable),
too many null packet will be inserted for cbr output.

Please test with below command, you'll get huge test.ts without the patch:
./ffmpeg -y -copyts -i ../fate-suite/mpegts/loewe.ts  -c:v libx264 -x264opts \
   nal-hrd=cbr:force-cfr=1 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize \
   1000k  -c:a mp2 -muxrate 4500k  -vframes 1000 test.ts

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavformat/mpegtsenc.c