-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
[Bug]: Video Ends Early While Audio Continues Repeating in Decrypted Files #215
Comments
Confirmed. |
Confirmed as well. I have tested in on 2 encrypted files under 5 minutes and both have the same issue. Edit: |
@Puyodead1 Will there be an official fix for this or should I create a PR with my changes? |
Go ahead and make a PR. |
Added -shortest flag to force the shortest stream during multiplexing. This resolves issue Puyodead1#215 on linux.
It seems like yt-dlp --allow-unplayable-formats --enable-file-urls -F file://$(pwd)/index_${ID}.mpd It displays the following tracks:
I also ran: ffmpeg -i index_${ID}.mpd It displays the following tracks:
ffmpeg \
-loglevel verbose \
-i index_${ID}.mpd \
-map 0:p:0:6 \
-c copy \
ffmpeg.m4a # 1.05MB
yt-dlp \
-f 7 \
--allow-unplayable-formats \
--enable-file-urls \
file://$(pwd)/index_${ID}.mpd \
-o yt-dlp.m4a # 6.78MB Basically, |
what's strange is that I don't have this issue while some others do. also maybe yt-dlp is filtering out the other audio tracks because they are duplicates? idk, if that's not the case, this should be reported to yt-dlp devs |
maybe it would be a good idea to use N_M3U8DL-RE because it allows you to download with key provided, decrypts and muxes automatically |
What happened?
Description
The script downloads the audio and video files for each lesson and decrypts them correctly. However, when multiplexing, the issue arises because the script concatenates the audio four times within the same track in the video container, instead of just once. This behavior differs from the video track, which is multiplexed correctly with just one iteration.
The result is a single decrypted video file with two tracks: the first is the video track (which works correctly), and the second is the audio track, containing the original decrypted audio but concatenated four times. This means that when playing the file, the video stops after the expected duration, but the audio continues playing three more times, even though the video has stopped.
Example to Illustrate the Issue:
If an encrypted lesson has a total duration of 5 minutes, the script, after decrypting and multiplexing, creates a video file with a duration of 20 minutes. After the first 5 minutes, the video stops because it's complete, but the audio starts again. This repeats at 10, 15, and 20 minutes, because the audio track is concatenated four times.
This problem only occurs with encrypted lessons and seems to affect all DRM-based courses. I have tested this with three different courses and encountered the same result.
Desktop:
Python: v3.9.1
Expected Result
The script should download, decrypt, and multiplex the audio and video files for each lesson correctly. The resulting video file should contain one track for the video and one track for the audio, each with the expected duration and without repetition or errors.
When playing the final video file, both the video and audio should end at the same time, without any repeated or redundant audio tracks.
Branch
master/main
What operating systems are you seeing the problem on?
Alma Linux 8.9, Windows
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: