Support for streaming on afplay #3795

Closed
opened 2026-02-20 23:59:45 -05:00 by deekerman · 2 comments
Owner

Originally created by @vegetableman on GitHub (Jan 4, 2015).

Would like to know if it's possible to support streaming on a command-line player like afplay (a mac app)?
afplay allows audio playback of a video with out opening up any gui.

Using command:
youtube-dl -o - https://www.youtube.com/watch?v=z4PKzz81m5c | afplay -

gives the following error:-

unknown argument: -


    Audio File Play
    Version: 2.0
    Copyright 2003-2013, Apple Inc. All Rights Reserved.
    Specify -h (-help) for command options

Usage:
afplay [option...] audio_file

Options: (may appear before or after arguments)
  {-v | --volume} VOLUME
    set the volume for playback of the file
  {-h | --help}
    print help
  { --leaks}
    run leaks analysis
  {-t | --time} TIME
    play for TIME seconds
  {-r | --rate} RATE
    play at playback rate
  {-q | --rQuality} QUALITY
    set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality)
  {-d | --debug}
    debug print output
[youtube] z4PKzz81m5c: Downloading webpage
[youtube] z4PKzz81m5c: Extracting video information
[youtube] z4PKzz81m5c: Downloading DASH manifest
[download] Destination: -
[download]   0.1% of 12.92MiB at  1.29MiB/s ETA 00:09

ERROR: unable to write data: [Errno 32] Broken pipe
Originally created by @vegetableman on GitHub (Jan 4, 2015). Would like to know if it's possible to support streaming on a command-line player like afplay (a mac app)? afplay allows audio playback of a video with out opening up any gui. Using command: `youtube-dl -o - https://www.youtube.com/watch?v=z4PKzz81m5c | afplay -` gives the following error:- ``` unknown argument: - Audio File Play Version: 2.0 Copyright 2003-2013, Apple Inc. All Rights Reserved. Specify -h (-help) for command options Usage: afplay [option...] audio_file Options: (may appear before or after arguments) {-v | --volume} VOLUME set the volume for playback of the file {-h | --help} print help { --leaks} run leaks analysis {-t | --time} TIME play for TIME seconds {-r | --rate} RATE play at playback rate {-q | --rQuality} QUALITY set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality) {-d | --debug} debug print output [youtube] z4PKzz81m5c: Downloading webpage [youtube] z4PKzz81m5c: Extracting video information [youtube] z4PKzz81m5c: Downloading DASH manifest [download] Destination: - [download] 0.1% of 12.92MiB at 1.29MiB/s ETA 00:09 ERROR: unable to write data: [Errno 32] Broken pipe ```
Author
Owner

@dstftw commented on GitHub (Jan 4, 2015):

Looks like afplay does not support playing from stdin.

@dstftw commented on GitHub (Jan 4, 2015): Looks like `afplay` does not support playing from stdin.
Author
Owner

@jaimeMF commented on GitHub (Jan 4, 2015):

There's an open issue for adding a --play option: #628.
Since this doesn't seem to be a problem in youtube-dl I'll close the issue (mplayer or mpv work without problem with that command).

@jaimeMF commented on GitHub (Jan 4, 2015): There's an open issue for adding a `--play` option: #628. Since this doesn't seem to be a problem in youtube-dl I'll close the issue (mplayer or mpv work without problem with that command).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#3795
No description provided.