<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>In AVR (Audio Visual Receivers) DSPs the incoming I2S sample rate
      (left right clock) of DTS 96/24 is 48Khz, compressed audio.  After
      decoding (now PCM), the output I2S sample rate is 96khz.</p>
    <p>Jon<br>
    </p>
    <div class="moz-cite-prefix">On 2021-09-18 1:24 p.m., Kitchen PC
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+OZ6eLWtbWg3GkZyW5EQcB20ORmcgmEXxbbw1iwPpwvnW1m=w@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,<br>
        <br>
        I've got a .dts file, which I'm decoding using FFmpeg libraries.<br>
        The file is detected as DTS 96/24, which would be fine, but the
        thing is that only some first frames have sample_rate 96000
        while all the rest ones have sample_rate 48000.<br>
        As a result the decoded audio is assumed to be 96000, but in the
        reality it's 48000 and it plays back at wrong speed.<br>
        <br>
        FFmpeg handles this file fine, the result output is 96Khz audio,
        played at a proper speed.<br>
        <br>
        My question is how to handle files like this? Do I need to
        re-sample those frames to the 96000 or that can be handled via
        FFmpeg automatically?<br>
        <br>
        I modified ffprobe to print the sample_rate for each frame, as
        it does not it by default, and the output is like this:<br>
        <br>
        ffprobe.exe -v debug -show_frames -show_format file.dts<br>
        <br>
        ...<br>
        up until this all frames are 96000<br>
        ...<br>
        media_type=audio<br>
        stream_index=0<br>
        sample_rate=96000 -- !<br>
        key_frame=1<br>
        pts=132480<br>
        pts_time=1.472000<br>
        pkt_dts=132480<br>
        pkt_dts_time=1.472000<br>
        best_effort_timestamp=132480<br>
        best_effort_timestamp_time=1.472000<br>
        pkt_duration=960<br>
        pkt_duration_time=0.010667<br>
        pkt_pos=277794<br>
        pkt_size=2013<br>
        sample_fmt=fltp<br>
        nb_samples=1024<br>
        channels=6<br>
        channel_layout=5.1(side)<br>
        [SIDE_DATA]<br>
        side_data_type=AVMatrixEncoding<br>
        [/SIDE_DATA]<br>
        [/FRAME]<br>
        <br>
        And starting from here, all the following frames have
        sample_rate 48000<br>
        <br>
        [FRAME]<br>
        media_type=audio<br>
        stream_index=0<br>
        sample_rate=48000 -- !<br>
        key_frame=1<br>
        pts=133440<br>
        pts_time=1.482667<br>
        pkt_dts=133440<br>
        pkt_dts_time=1.482667<br>
        best_effort_timestamp=133440<br>
        best_effort_timestamp_time=1.482667<br>
        pkt_duration=960<br>
        pkt_duration_time=0.010667<br>
        pkt_pos=279807<br>
        pkt_size=2013<br>
        sample_fmt=fltp<br>
        nb_samples=512<br>
        channels=6<br>
        channel_layout=5.1(side)<br>
        [SIDE_DATA]<br>
        side_data_type=AVMatrixEncoding<br>
        [/SIDE_DATA]<br>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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="https://ffmpeg.org/mailman/listinfo/libav-user">https://ffmpeg.org/mailman/listinfo/libav-user</a>

To unsubscribe, visit link above, or email
<a class="moz-txt-link-abbreviated" href="mailto:libav-user-request@ffmpeg.org">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".
</pre>
    </blockquote>
  </body>
</html>