Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Twitch ads break recorded audio #21985
Comments
|
Post a specific URL where ads are served. |
|
There is no such thing as a specific URL where ads are served. Twitch embeds ads into all live streams (not sure if it also does this for VODs?), so it can happen with any live stream URL, and it does so at random - sometimes there are ads, sometimes there are none. So you can't easily reproduce this. In fact, I have yet to reproduce it again, but then again I don't use youtube-dl that often. |
|
if we can't reproduce the problem then how are we supposed to fix it. |
|
You can't easily reproduce it. The best way to reproduce it is probably keep restarting youtube-dl on a stream URL until Twitch decided to serve you ads. |
Checklist
Verbose log
Not available.
Description
I'm downloading audio-only of a live stream like this:
This works great when Twitch doesn't insert ads and results in:
However, when Twitch inserts ads in the beginning, the resulting
--extract-audiofile has a video (!) stream in it that lasts about 30 seconds that consists of Twitch ads. The actual stream audio after that 30-second segment is all broken -- the audio has silent segments every few milliseconds, i.e. it keeps skipping, as tested in VLC and mpv. VLC and mpv have hard time playing it too, it takes seconds for them to seek in the file, sometimes they even hang. Also, the resulting audio has incorrect frequency set as reported by ffmpeg: 44100 Hz, when it should be 48000 Hz as in theout1.m4aoutput from above - the streamer streams audio in 48000 Hz. (It might be worth noting that in the first 30 seconds, the Twitch ad part, the audio is fine, it's the stream's audio after that that is broken.) Here is what ffmpeg reporting on it:Video stream duration: 30 seconds:
Audio stream duration: 6+ hours:
The expected behavior is that with
--extract-audiothe output file will contain only the audio (having audio from the ad is fine) and that the stream audio will not be broken.