Looking at the output of ffplay, it's reporting a time_base of 0.000011, and
I can't immediately see why our two values would be different,
I'm saving the time base immediately after opening my audio and video
codecs:

  // Try opening audio/video codecs
  if (!fail) {
    audio_codec_ctx_ = p_format_ctx_->streams[audio_stream_]->codec;
    video_codec_ctx_ = p_format_ctx_->streams[video_stream_]->codec;

    // Find decoders
    audio_codec_     = avcodec_find_decoder(audio_codec_ctx_->codec_id);
    video_codec_     = avcodec_find_decoder(video_codec_ctx_->codec_id);

    // And open
    if (!audio_codec_ || (avcodec_open(audio_codec_ctx_, audio_codec_) < 0))
{
      fail         = true;
      fail_message = "Couldn't open audio codec.";
    }

    if (!video_codec_ || (avcodec_open(video_codec_ctx_, video_codec_) < 0))
{
      fail         = true;
      fail_message = "Couldn't open video codec.";
    }
  }

  // Save time base of video stream
  time_base_ =
av_q2d(p_format_ctx_->streams[video_stream_]->codec->time_base);

Which is in the constructor of this particular object.  I thought perhaps I
was grabbing the time_base at the wrong time, but the value seems to be a
consistent
0.016683 regardless of where I examine it.  At least my code and ffplay
agree on PTS values.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to