New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio stream segments not of identical duration #1177
Comments
Hi, the audio sampling rate and audio frame size from the encoder results in an audio frame duration that in sum doesn't fit exactly the 2s segment duration. Try to use in ffmpeg audio sampling rate 48kh and audio frame size samples 480 or multiple. |
@nunocorreiavargas Hi, thanks, but I tried the following FFmpeg command to extract the audio with the characteristics you mentioned, and then fed it to Shaka Packager, same result, the durations aren't identical:
Unless I'm doing something wrong? |
Hi,
Can you confirm the audio frames size with ffprobe? Ex: ffprobe -i udp://
239.193.11.21:5502 -v error -hide_banner -select_streams a:0 -show_frames
There's the packet duration and samples
…On Thu, Mar 16, 2023 at 2:18 PM Arad Alvand ***@***.***> wrote:
@nunocorreiavargas <https://github.com/nunocorreiavargas> Hi, thanks, but
I tried the following FFmpeg command to extract with the characteristics
you mentioned, and then fed it to Shaka Packager, same result, the
durations aren't identical:
ffmpeg -i input.mp4 -vn -c:a aac -b:a 192k -ar 48000 -ac 1 -af "aformat=channel_layouts=mono,asetnsamples=n=480" audio.mp4
—
Reply to this email directly, view it on GitHub
<#1177 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHTR2XCQ56IFJO2KTTHM7ODW4MOJVANCNFSM6AAAAAAVBMYZKE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@nunocorreiavargas I have similar problem. DASH playlists look great for video streams, but audio has most segments listed, because duration is changing almost every segment. I've tried ffprobe on output and for the fields I think are most important I get same results.
then analysis by ffprobe:
so I have one more packet...
and DASH (that is the worst part)
instead of one, shiny My ffmpeg command only chooses codec and audio bitrate, no channels, sampling or other filters. packager has no special flags, just simple path templates and init definition. I'm here to test different options if you are still interested ;) |
System info
Operating System: Ubuntu 22.04
Shaka Packager Version: shaka-packager version v2.6.1-634af65-release
Issue and steps to reproduce the problem
I have an MP4 video on which I've done a
-force_key_frames
using FFmpeg prior to feeding it to Shaka Packager:This creates a keyframe every two seconds, which means that when the video is then fed to Shaka Packager, it can create segments that have perfectly consistent durations.
And it works, when I run Shaka Packager on this file and set the
--segment_duration
to2
, here's the playlist that gets generated for the video stream:However, the audio stream segments still don't have equal durations and their durations don't match those of their counterparts in the video stream. I can't figure out why:
What is the expected result?
The audio segments should be exactly "2.000" seconds in duration.
What happens instead?
The durations differ slightly.
The text was updated successfully, but these errors were encountered: