View Single Post
Old 30th December 2019, 01:37   #11  |  Link
leandro
Registered User
 
Join Date: Feb 2017
Posts: 13
Quote:
Originally Posted by MasterNobody View Post
Code:
MB rate = (width+15)/16 * (height+15)/16 * tb.den / (tb.num * ticks) = (1920+15)/16 * (1080+15)/16 * 15360 / (1 * 1) = 120 * 68 * 15360 = 125337600
So you should specify average fps (or if you source is hybrid CFR than max fps section) in fr.num and fr.den to change it to:
Code:
MB rate = (width+15)/16 * (height+15)/16 * fr.num /  fr.den
Thanks I'm gonna try to set up the encoder avg_framerate, since you point that it could be a timming issue (with your help I build this logging timing specifics) I wrote a debugger that is showing:

Code:
LOG: Video
LOG: =================================================
LOG: decoder
LOG: 	AVFormatContext
LOG: 		start_time=0 duration=10022000 bit_rate=2631572 start_time_realtime=0
LOG: 	AVCodecContext
LOG: 		bit_rate=2228686 ticks_per_frame=2 width=1920 height=1080 gop_size=12 keyint_min=25 sample_rate=0 profile=100 level=42
LOG: 		avc->time_base=num/den 0/2
LOG: 		avc->framerate=num/den 0/1
LOG: 		avc->pkt_timebase=num/den 0/1
LOG: 	AVStream
LOG: 		index=0 start_time=0 duration=153600
LOG: 		avs->time_base=num/den 1/15360
LOG: 		avs->sample_aspect_ratio=num/den 1/1
LOG: 		avs->avg_frame_rate=num/den 60/1
LOG: 		avs->r_frame_rate=num/den 60/1
LOG: =================================================
LOG: Video
LOG: =================================================
LOG: encoder
LOG: 	AVFormatContext
LOG: 		start_time=0 duration=0 bit_rate=0 start_time_realtime=0
LOG: 	AVCodecContext
LOG: 		bit_rate=0 ticks_per_frame=1 width=1920 height=1080 gop_size=-1 keyint_min=-1 sample_rate=0 profile=-99 level=-99
LOG: 		avc->time_base=num/den 1/15360
LOG: 		avc->framerate=num/den 0/1
LOG: 		avc->pkt_timebase=num/den 0/1
LOG: 	AVStream
LOG: 		index=0 start_time=0 duration=0
LOG: 		avs->time_base=num/den 1/15360
LOG: 		avs->sample_aspect_ratio=num/den 0/1
LOG: 		avs->avg_frame_rate=num/den 0/0
LOG: 		avs->r_frame_rate=num/den 0/0
LOG: =================================================


LOG: =================================================
LOG: Audio
LOG: =================================================
LOG: decoder
LOG: 	AVFormatContext
LOG: 		start_time=0 duration=10022000 bit_rate=2631572 start_time_realtime=0
LOG: 	AVCodecContext
LOG: 		bit_rate=393736 ticks_per_frame=1 width=0 height=0 gop_size=0 keyint_min=0 sample_rate=48000 profile=1 level=-99
LOG: 		avc->time_base=num/den 1/48000
LOG: 		avc->framerate=num/den 0/1
LOG: 		avc->pkt_timebase=num/den 0/1
LOG: 	AVStream
LOG: 		index=1 start_time=0 duration=480000
LOG: 		avs->time_base=num/den 1/48000
LOG: 		avs->sample_aspect_ratio=num/den 0/1
LOG: 		avs->avg_frame_rate=num/den 0/0
LOG: 		avs->r_frame_rate=num/den 0/0
LOG: =================================================

LOG: =================================================
LOG: Audio
LOG: =================================================
LOG: encoder
LOG: 	AVFormatContext
LOG: 		start_time=0 duration=0 bit_rate=0 start_time_realtime=0
LOG: 	AVCodecContext
LOG: 		->NULL
LOG: 	AVStream
LOG: 		index=1 start_time=0 duration=0
LOG: 		avs->time_base=num/den 0/0
LOG: 		avs->sample_aspect_ratio=num/den 0/1
LOG: 		avs->avg_frame_rate=num/den 0/0
LOG: 		avs->r_frame_rate=num/den 0/0
LOG: =================================================

Last edited by leandro; 30th December 2019 at 01:45.
leandro is offline   Reply With Quote