Skip to content
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

No stdout streaming for reddit, writes to file instead (-.mp4) #27265

Closed
5 tasks done
darvesh opened this issue Nov 30, 2020 · 5 comments
Closed
5 tasks done

No stdout streaming for reddit, writes to file instead (-.mp4) #27265

darvesh opened this issue Nov 30, 2020 · 5 comments
Labels

Comments

@darvesh
Copy link

darvesh commented Nov 30, 2020

Checklist

  • I've verified that I'm running youtube-dl version 2020.11.29
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl -v  https://www.reddit.com/r/watchpeoplesurvive/comments/k3aoyn/f1_driver_romain_grosjean_coming_out_out_of_the   -o - > i.mp4
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.reddit.com/r/watchpeoplesurvive/comments/k3aoyn/f1_driver_romain_grosjean_coming_out_out_of_the', u'-o', u'-']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2020.11.29
[debug] Python version 2.7.18 (CPython) - Linux-5.4.0-52-generic-x86_64-with-LinuxMint-20-ulyana
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[RedditR] k3aoyn: Downloading JSON metadata
[Reddit] onbvmhlc17261: Downloading m3u8 information
[Reddit] onbvmhlc17261: Downloading MPD manifest
[debug] Default format spec: best/bestvideo+bestaudio
[debug] Invoking downloader on u'https://v.redd.it/onbvmhlc17261/DASH_720.mp4'
[download] Destination: -.fdash-video_2329911
[download] 100% of 3.48MiB in 00:05
[debug] Invoking downloader on u'https://v.redd.it/onbvmhlc17261/DASH_audio.mp4'
[download] Destination: -.fdash-audio_0_132011
[download] 100% of 202.46KiB in 00:01
[ffmpeg] Merging formats into "-.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:-.fdash-video_2329911' -i 'file:-.fdash-audio_0_132011' -c copy -map '0:v:0' -map '1:a:0' 'file:-.temp.mp4'
Deleting original file -.fdash-video_2329911 (pass -k to keep)
Deleting original file -.fdash-audio_0_132011 (pass -k to keep)

Description

-o - doesn't redirect to stdout for reddit but creates a file instead (-.mp4)
You can run this command to reproduce
youtube-dl https://www.reddit.com/r/watchpeoplesurvive/comments/k3aoyn/f1_driver_romain_grosjean_coming_out_out_of_the -o - > hello.mp4

@dstftw
Copy link
Collaborator

dstftw commented Nov 30, 2020

There are no video+audio formats served as single fil for this video.

@dstftw dstftw closed this as completed Nov 30, 2020
@dstftw dstftw added the invalid label Nov 30, 2020
@trgwii
Copy link

trgwii commented Nov 30, 2020

Isn't it reasonable to still let youtube-dl output to stdout when user specifies it, even if it needs to create temp files to merge?

@dstftw
Copy link
Collaborator

dstftw commented Nov 30, 2020

No, since this defeats the whole point of streaming to stdout.

@trgwii
Copy link

trgwii commented Nov 30, 2020

The point is up to the user imo, it might be to consume it from another program or to pipe it reliably to a media player, it makes more sense for the application to honor that contract if it can than to break it. I'd rather have it emit a warning that it can't purely stream, and is reverting to streaming after merge.

@MKRhere
Copy link

MKRhere commented Dec 1, 2020

ffmpeg just errors if you try to stream mp4 to stdout, so that might be a more useful behaviour than silently writing to -.mp4

Fedalto added a commit to Fedalto/reddit2telegram that referenced this issue Feb 10, 2021
Reddit offers DASH-mpeg and HLS urls together with a `fallback` which
doesn't have audio.

To make this work, I had to download the video locally with youtube-dl
and re-encode it before sending it to Telegram servers, as the bot API
don't accept DASH-mpeg or HLS.

Tried to keep the video in memory only, but there's no way to output to
stdout due to this bug,
ytdl-org/youtube-dl#27265
pukkandan added a commit to yt-dlp/yt-dlp that referenced this issue Aug 1, 2021
For this to work:
1. The downloader must be ffmpeg
2. The selected formats must have the same protocol
3. The formats must be downloadable by ffmpeg to stdout

Partial solution for: ytdl-org/youtube-dl#28146, ytdl-org/youtube-dl#27265
nixxo pushed a commit to nixxo/yt-dlp that referenced this issue Nov 22, 2021
For this to work:
1. The downloader must be ffmpeg
2. The selected formats must have the same protocol
3. The formats must be downloadable by ffmpeg to stdout

Partial solution for: ytdl-org/youtube-dl#28146, ytdl-org/youtube-dl#27265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants