<div dir="ltr">Pardon me, I hit send-button too fast, w/o double check. <div><br></div><div>Actually I got wrong value, here is what I'm doing:</div><div>----------------------------------</div><div>avformat_open_input<br></div><div>avformat_find_stream_info<br></div><div>loop_through_all_streams:</div><div>if(video)</div><div>{</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>avcodec_find_decoder<br></div><div>avcodec_alloc_context3<br></div><div>avcodec_parameters_to_context<br></div><div>avcodec_open2 <------------ after that time_base = {0,2}<br></div></blockquote></div><div>}</div><div>av_dump_format (missing tbc)</div><div>Stream #0:0(und), 2, 1/30000: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 960x540, 0/1, 2142 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)</div><div>------------------------------------</div><div><br></div><div>ffprobe -show_streams  (shows 59.94)</div><div><div>Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 2142 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)</div></div><div>and</div><div>codec_time_base=1001/60000<br></div><div><br></div><div>How can I get correct value 1001/60000 ?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 27, 2017 at 11:07 PM, Ivan Kuchin <span dir="ltr"><<a href="mailto:ivan.kuchin@gmail.com" target="_blank">ivan.kuchin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello experts, <div><br></div><div>   I'm building transcoder and sometimes avcodec_open2 returns decoder.time_base = {0, 1} for src video, although "ffmpeg -i xxx" and "ffprobe -show_stream " returns correct tbc and codec_time_base.</div><div><br></div><div>   Problem: in some cases codec_time_base != (AVRational) {1, framerate} (in my case codec_time_base=1/60, but framerate=30). </div><div><br></div><div>   I'm aware about example transcode.c and I tested it and it is not working too. </div><div><br></div><div>   Question: how can I get correct codec_time_base in API ? </div><div><br></div><div>JFYI: Ubuntu + 7:3.3.1-1~16.04.york0</div><div><br></div><div>Thanks a lot </div></div>
</blockquote></div><br></div>