huceke / omxplayer

omxplayer
GNU General Public License v2.0
520 stars 502 forks source link

HTTP authentication #100

Closed vpetersson closed 11 years ago

vpetersson commented 11 years ago

First, let me say thanks for a great tool.

I'm the creator of Screenly, a digital signage player for the Raspberry Pi. Thanks to omxplayer, it was trivial to add support for video playback.

One request we've received from a few users however is the ability to stream content from password protected http/https resource.

I know mplayer supports this, and I was just curious if this is something you'd be interested in adding. I do realize this is somewhat of a niche feature, but I just wanted to reach out and check.

(This is discussed in Screenly ticket #19.)

matiaspl commented 11 years ago

If it's not working already this could be easily implemented, as ffmpeg supports it.

popcornmix commented 11 years ago

What does the command line to play one of the streams (from mplayer or ffmpeg) look like?

vpetersson commented 11 years ago

What does the command line to play one of the streams (from mplayer or ffmpeg) look like?

$ mplayer [...] −user <username> −passwd <password> [...]

(from man)

popcornmix commented 11 years ago

How about ffmpeg? I really want to know if these just form part of the URL (e.g. http://username:password@foobar.com) or whether there are any libffmpeg/libavcodec functions to configure this.

vpetersson commented 11 years ago

Yes, it appears as it has been supported in ffmpeg since 0.6.3 [1][2].

I cannot find any references to any username or password flags, so I assume that means that the standardized syntax http://username:password@domain.com is used.

popcornmix commented 11 years ago

Can you find an address where http://username:password@domain.com works on ffmpeg. Can you try the same address on omxplayer?

vpetersson commented 11 years ago

Sorry for the late response. However, here are my findings.

As for mplayer, I can confirm that both of the following commands work:

$ mplayer http://foobar:foobar@example/test.mp4
$ mplayer  -user foobar -passwd foobar http://example/test.mp4

I can also confirm that ffmpeg works with the following command (or in this case, ffprobe):

$ ffprobe http://foobar:foobar@example/test.mp4
popcornmix commented 11 years ago

Does anyone have a real url like http://foobar:foobar@example/test.mp4 I can use to test?

skgsergio commented 11 years ago

I've created a test, works with mplayer and vlc but can't test it on omxplayer due I don't have my Raspberry Pi now with me:

http://test:test@omxplayer.sconde.net/test/big_buck_bunny_480p_h264.mov

popcornmix commented 11 years ago

@ skgsergio thanks. It plays fine! (and if username or password is wrong it doesn't play as expected).

skgsergio commented 11 years ago

As I thougth :) due omxplayer is using ffmepg.

@vpetersson works for you?

vpetersson commented 11 years ago

Yep, works fine. Thanks guys. I should have tested this before escalating it. Maybe we should add a note in the docs about this newly found support :)