54ac / stream-detector

A Firefox addon for keeping track of manifests used by various streaming protocols and downloading media files.
https://addons.mozilla.org/en-US/firefox/addon/hls-stream-detector/
Mozilla Public License 2.0
634 stars 93 forks source link

yt-dlp command line unsuitable for live-stream .m3u8 #118

Closed nkomarov closed 1 year ago

nkomarov commented 2 years ago

It might be not a bug of this plugin but I still wanted to post in case you wish to make a workaround.

I used the "command for youtube-dl" option to capture live streams from bongacams. A .m3u8 playlist there only gives a 3-second .ts file, youtube-dl keeps requesting .m3u8 to get the next .ts, and it goes until being cancelled.

When I use "command for yt-dlp" it only saves one .ts from the .m3u8 and doesn't fetch for the next ones. So it's always just a 3-sec video.

I guess some of the default behaviour of yt-dlp is different so some other option has to be passed to command line. Not sure which one. So if you know which argument to pass to yt-dlp in order to make it work the same as youtube-dl you might modify the command line.

54ac commented 2 years ago

This is a yt-dlp thing I'd imagine. I would generally advise to use ffmpeg for downloading m3u8 streams, but if anyone knows the appropriate command line option to add/change, let me know.

candrapersada commented 2 years ago

and why no Multi-threaded fragment downloads: Download multiple fragments of m3u8/mpd videos in parallel. Use --concurrent-fragments (-N) option to set the number of threads used in yt-dlp

54ac commented 2 years ago

Sure. Although I think it'd be good enough to implement a sane default (e.g. 4) rather than have an entire new option considering yt-dlp is the only software including multithreading I believe, unless I'm mistaken.

54ac commented 2 years ago

Four concurrent fragments are now used in yt-dlp commands as of v2.10.13.

vitusson commented 2 years ago

With this commit you accidently (I guess) also added the "-N 4" option to the youtube-dl commandline https://github.com/rowrawer/stream-detector/commit/1fc33e7fedc4551fcda333095ef6f308a166bd27 Only there is no such option in youtube-dl and therefore the copied command doesn't work youtube-dl: error: no such option: -N

54ac commented 2 years ago

My bad, I thought youtube-dl supported this option. Might just remove youtube-dl support, since yt-dlp is a better fork and is being kept up to date, unless youtube-dl has unique use cases.

candrapersada commented 1 year ago

is there an option to switch from 4 to 3 or 5 Multi-threaded?

54ac commented 1 year ago

No, 4 is hardcoded. Would that make a significant difference? I might implement an option for the number of yt-dlp threads.

candrapersada commented 1 year ago

No, 4 is hardcoded. Would that make a significant difference?

because it can change according to internet conditions

candrapersada commented 1 year ago

Would that make a significant difference?

reducing the chance of file corruption if download is interrupted.

54ac commented 1 year ago

Would that make a significant difference?

reducing the chance of file corruption if download is interrupted.

I suppose so. I'll consider adding an option related to the multithreading.

54ac commented 1 year ago

There will be an option to specify the amount of threads in yt-dlp in v2.10.19.