I successfully obtain a streaming URL from the Twitch VOD, which prompts a download of an m3u8 file. However, when I run the ffmpeg command to convert it to MP4, there’s no output file created, and it simply displays <bound method run of output(filename='result.mp4')[None]>. I attempted using both the direct link and the downloaded m3u8 file, but the issue persists. Can someone provide guidance on this?
You’re not calling the run method - you’re just referencing it. See how you have .run instead of .run() at the end? That’s why you’re getting the bound method output instead of actual execution.
Change it to:
process = (
ffmpeg
.input('vod.m3u8')
.output('result.mp4')
.run()
)
Also, there’s another problem here. You downloaded the m3u8 file locally, but m3u8 files just contain references to video segments that are still hosted remotely. Pass the original streaming URL directly to ffmpeg instead. Use your vod_link variable as the input rather than the local m3u8 file.
You’ve got two main issues here. First, you’re missing parentheses after .run - without them, you’re not actually executing the ffmpeg command, just getting a method reference. Second, urllib.request.urlretrieve only downloads the playlist metadata, not the actual video. The m3u8 file just points to video segments that are still sitting on Twitch’s servers. When ffmpeg tries to process your local m3u8 file, it can’t reach those remote segments. I’ve hit this same problem with HLS streams before. Skip downloading the playlist file entirely - just pass the vod_link URL directly to ffmpeg.input() and don’t forget those parentheses in .run(). Let ffmpeg handle the segment downloading and stitching automatically. Way more reliable for Twitch VODs.
You’re downloading the m3u8 playlist file locally when you should just use the stream URL directly. When you save the m3u8 to disk, you only get the playlist manifest - not the actual video segments it references. Those segments are still sitting on Twitch’s servers with their own URLs. Skip the urllib.request.urlretrieve step completely and feed the streaming URL straight into ffmpeg:
I’ve used this method for archiving streams and it works great. Just make sure your connection’s stable since you’re downloading potentially huge files directly from Twitch’s CDN.
Classic mistake - you forgot the parentheses on .run so it’s not executing. But honestly, skip the urllib step entirely. You’re just downloading an empty playlist file. Pipe the vod_link straight into ffmpeg instead.