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.
Stream to vlc #2124
Stream to vlc #2124
Comments
|
Sorry, I don't understand. Could you elaborate and provide some context? You can run vlc just fine on the downloaded files, or output the video to stdout with |
|
if you want to stream youtube directly to vlc, without a temporary file, just use the built in support for it in vlc: for example: |
|
If you are running a GNU/Linux system, you can stream videos directly to your favorite media player by using You can also set up a function in your
and run it like Side note to the devs: maybe this should be made a command line switch? Like If you're not interested maybe this ticket can be closed. |
|
[quote] for example: I believe that you have to use the "real" URL with VLC, not the "Web URL". |
|
The "point" is to use youtube-dl as a wrapper for streams which uses a token. |
|
I second @nodiscc regarding the --stream option, and had a particular use-case in mind. |
|
A --stream option would be great |
|
I'm trying the "-o -" solution, but with some websites (e.g. periscope) it doesn't work: I get the stream saved to a file named "-". Is this expected behaviour (due to limitations of some website or video format), or is it a bug in that particular extractor? |
|
+1 to the last question |
|
This feature indeed needs some extra codes for live streams. (m3u8 from periscope, etc.) |
|
this patch will make them work as well: diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py
index 30277dc..cda39fe 100644
--- a/youtube_dl/downloader/external.py
+++ b/youtube_dl/downloader/external.py
@@ -225,7 +225,7 @@ class FFmpegFD(ExternalFD):
args += ['-i', url, '-c', 'copy']
if protocol == 'm3u8':
- if self.params.get('hls_use_mpegts', False):
+ if self.params.get('hls_use_mpegts', False) or tmpfilename == '-':
args += ['-f', 'mpegts']
else:
args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
@@ -235,7 +235,10 @@ class FFmpegFD(ExternalFD):
args += ['-f', EXT_TO_OUT_FORMATS.get(info_dict['ext'], info_dict['ext'])]
args = [encodeArgument(opt) for opt in args]
- args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
+ if tmpfilename == '-':
+ args.append('pipe:1')
+ else:
+ args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
self._debug_cmd(args)tested with mplayer, mpv in urls that return encrypted or live m3u8 manifests (should work with others):
|
[downloader/external] enable piping for FFmpegFD(closes #2124)
|
Any updates about this? Would love to get 60FPS livestreams pumped directly into VLC, as livestreamer doesn't support DASH. |
|
DASH should be supported. Any problems/errors? |
|
For livestreamer? I'm just not sure of any way to select qualities other than the usual "audio_webm, audio_mp4, 144p (worst), 240p, 360p, 720p (best)" options. These are all the general <30FPS choices. |
|
Which video are you trying? Please give a concrete URL. |
|
Here's one 720p60 example: https://www.youtube.com/watch?v=brDB5lk3G3A |
|
I was wrong - such DASH support is not implemented yet. Please follow #5563 instead for that. |
|
Is there no option to stream and save the video at the same time? |
Could you try: |
|
@yan12125 thanks, it works but I would like the output file named "replay.mp4" instead of "replay.mp4.part" while I stream. Is there a way to do this? |
|
@baptx Thanks, that what I needed, it seems that your solution is the only one that:
It can be shortened to: Does anyone know how to not have to start VLC separately while keeping the two beforementioned properties? |
|
Try this: |
|
@yan12125 VLC is still reading only from stdin and therefore can't move forward and backward in the video. |
|
@tuxayo I see your problem. Such a need is complicated and I guess a script is inevitable: import subprocess
import youtube_dl
player_run = False
p = None
def hook(status):
global player_run, p
if not player_run:
player_run = True
p = subprocess.Popen(['vlc', status['filename']])
opts = {
'format': 'best',
'nopart': True,
'progress_hooks': [hook],
'verbose': True,
}
with youtube_dl.YoutubeDL(opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=oHg5SJYRHA0'])
p.wait() |
|
@yan12125 Awesome thanks! Great to see that youtube_dl is so flexible. |
|
Hi everyone, I wondering if it is possible to stream a playlist to vlc? |
|
zsh function ytvlc() {
URLS=(${(ps:\n:)"$(youtube-dl "$1" --get-url)"})
vlc "${URLS[1]}" --input-slave "${URLS[2]}"
}bash DL_OUTPUT=$(youtube-dl "$1" --get-url);
URLS=($(echo "$DL_OUTPUT" | tr ',' '\n'))
vlc "${URLS[0]}" --input-slave "${URLS[1]}" |
Streaming video to vlc.