1

When I pass a link to omxplayer with youtube-dl it won't play the audio only the video. Where as playing it locally works as expected.

It doesn't show the usual Audio codec ac3 channels 6 samplerate 48000 bitspersample 16 when streaming. And to make it more odd, it can stream audio just fine.

I start omxplayer like this:

omxplayer `youtube-dl -g <youtube-url>`
1
  • please mark your answer as the correct one if that solved your problem ;)
    – Vini.g.fer
    Jun 3, 2016 at 18:40

2 Answers 2

5

Or for simplicity replace "format_id" with "best" (best: Select best quality format represented by single file with video and audio):

omxplayer `youtube-dl -g -f best <youtube-url>` # play the video

https://github.com/rg3/youtube-dl/blob/master/README.md#format-selection

2
  • As far as I know best is the default, but even explicitely choosing it didn't work for me. Maybe it was/is a bug.
    – TomTom
    Jun 4, 2016 at 12:22
  • Using RB Pi 3 without the -f best did not worked.
    – Neoecos
    Sep 22, 2017 at 3:59
1

Turns out streams have no audio by default. I need to explicitly choose a format that includes the audio stream.

youtube-dl -F <youtube-url> # print the available formats
omxplayer `youtube-dl -g -f <format_id> <youtube-url>` # play the video

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.