equal
deleted
inserted
replaced
146 |
146 |
147 // put parameters |
147 // put parameters |
148 g_pAudio->sample_fmt = AV_SAMPLE_FMT_S16; |
148 g_pAudio->sample_fmt = AV_SAMPLE_FMT_S16; |
149 g_pAudio->sample_rate = g_Frequency; |
149 g_pAudio->sample_rate = g_Frequency; |
150 g_pAudio->channels = g_Channels; |
150 g_pAudio->channels = g_Channels; |
|
151 |
|
152 // set time base as invers of sample rate |
|
153 g_pAudio->time_base.den = g_pAStream->time_base.den = g_Frequency; |
|
154 g_pAudio->time_base.num = g_pAStream->time_base.num = 1; |
151 |
155 |
152 // set quality |
156 // set quality |
153 g_pAudio->bit_rate = 160000; |
157 g_pAudio->bit_rate = 160000; |
154 |
158 |
155 // for codecs that support variable bitrate use it, it should be better |
159 // for codecs that support variable bitrate use it, it should be better |
252 g_pVideo->height = g_Height & ~1; // make even |
256 g_pVideo->height = g_Height & ~1; // make even |
253 /* time base: this is the fundamental unit of time (in seconds) in terms |
257 /* time base: this is the fundamental unit of time (in seconds) in terms |
254 of which frame timestamps are represented. for fixed-fps content, |
258 of which frame timestamps are represented. for fixed-fps content, |
255 timebase should be 1/framerate and timestamp increments should be |
259 timebase should be 1/framerate and timestamp increments should be |
256 identically 1. */ |
260 identically 1. */ |
257 g_pVideo->time_base.den = g_Framerate.num; |
261 g_pVideo->time_base.den = g_pVStream->time_base.den = g_Framerate.num; |
258 g_pVideo->time_base.num = g_Framerate.den; |
262 g_pVideo->time_base.num = g_pVStream->time_base.num = g_Framerate.den; |
259 //g_pVideo->gop_size = 12; /* emit one intra frame every twelve frames at most */ |
263 //g_pVideo->gop_size = 12; /* emit one intra frame every twelve frames at most */ |
260 g_pVideo->pix_fmt = AV_PIX_FMT_YUV420P; |
264 g_pVideo->pix_fmt = AV_PIX_FMT_YUV420P; |
261 |
265 |
262 // set quality |
266 // set quality |
263 if (g_VQuality > 100) |
267 if (g_VQuality > 100) |