<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Kevin,<div><br></div><div>I also used the .den and .num param and this led to synch issues in my project.</div><div>I tried numerous workarounds without any success.</div><div>I finally solved the synch issues by using the av_packet_rescale_ts() function that sets the timestamps based on time_base (get from streams infos).</div><div><br></div><div>This is my chunk of code that does it:</div><div><div>                avcodec_encode_video2(out_stream->codec, &styl_pkt, yuv_pix->av_frame, &got_something);</div><div>                if(!got_something)</div><div>                {</div><div>                    INFO(stderr, ":-( Unable to encode yuv frame.\n");</div><div>                    exit(0);</div><div>                }      </div><div>                //convert timestamps from in time_base to out time_base</div><div>                av_packet_rescale_ts(&styl_pkt, in_stream->time_base, out_stream->time_base);</div><div><br></div><div>                //log_packet(in_video_ctx->format_ctx, &orig_pkt, "Video orig. pkt");</div><div>                //log_packet(out_video_ctx->format_ctx, &styl_pkt, "Video styl. pkt");</div><div>                ret = av_write_frame(out_video_ctx->format_ctx, &styl_pkt);</div><div>                if (ret < 0)</div><div>                {</div><div>                    INFO(stderr, "Error muxing packet\n");</div><div>                    break;</div><div>                }</div></div><div><br></div><div>Hope that helps.</div><div><br></div><div><div><div>Le 2 juil. 2015 à 17:13, Kevin J. Brooks <<a href="mailto:kbrooks@r2c-ss.com">kbrooks@r2c-ss.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    This is were I am setting up the codec context and format:<br>
    <br>
    <span style=" color:#646482;"> </span><span style="
      font-weight:600;">m_videoCodecCTX</span>-><span style="
      font-weight:600;">codec_id</span> = AV_CODEC_ID_WMV2;
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">bit_rate</span> = 400000;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">width</span> = 640;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">height</span> = 480;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_video_st</span>.<span style=" font-weight:600;">st</span>-><span style=" font-weight:600;">time_base</span>.<span style=" font-weight:600;">num</span> = 1;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_video_st</span>.<span style=" font-weight:600;">st</span>-><span style=" font-weight:600;">time_base</span>.<span style=" font-weight:600;">den</span> = 25;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">time_base</span> = <span style=" font-weight:600;">m_video_st</span>.<span style=" font-weight:600;">st</span>-><span style=" font-weight:600;">time_base</span>;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">gop_size</span> = 12;</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    <span style=" font-weight:600;">m_videoCodecCTX</span>-><span style=" font-weight:600;">pix_fmt</span> = AV_PIX_FMT_YUV420P;</pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></pre>
    <br>
    m_video_st.st is a AVStream pointer.  m_videoCodecCTX is a
    m_videoCodecCTX pointer.<br>
    <br>
    <div class="moz-signature">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <title></title>
      Sincerely,<span style="font-size:12.0pt;color:#0070C0"><br>
        Kevin J. Brooks<o:p></o:p></span><span style="font-size:12.0pt;color:#0070C0"><br>
        Senior Software Engineer<o:p></o:p></span><span style="font-size: 14pt;"><br>
        R2C Support Services<o:p></o:p></span><span style="font-size: 14pt;"><br>
        200 West Side Square Suite 604<o:p></o:p></span><span style="font-size: 14pt;"><br>
        Huntsville, AL 35801</span><span style="font-size: 14pt;"><br>
        Office: 256-684-8383 ext. 104<o:p></o:p></span> <br>
      <br>
      <span><sdvosb.png></span><br>
    </div>
    <div class="moz-cite-prefix">On 7/2/2015 9:59 AM, Talgorn
      François-Xavier wrote:<br>
    </div>
    <blockquote cite="mid:DF005040-62FE-4843-8D41-D0207EC13961@yahoo.fr" type="cite">
      <pre wrap="">Hi,

Frames/second shouldn't be an issue in itself. It might be because of time_base parameter.
To help you better, could you provide the code used ?

Le 2 juil. 2015 à 16:41, Kevin J. Brooks <a class="moz-txt-link-rfc2396E" href="mailto:kbrooks@r2c-ss.com"><kbrooks@r2c-ss.com></a> a écrit :

</pre>
      <blockquote type="cite">
        <pre wrap="">Hi all,

I am successfully saving video in a wmv format, capturing from a video capture card.  However, the play back in windows media is just a bit fast.  I am attempting to save at 25 frames per second, but the properties on the wmv file states it is 30 fps.  What should I be looking at to get this set up right?

Thanks,
Kevin
_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>

</pre>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>http://ffmpeg.org/mailman/listinfo/libav-user<br></blockquote></div><br></div></body></html>