LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Proof of concept required (https://www.linuxquestions.org/questions/linux-software-2/proof-of-concept-required-4175442641/)

business_kid 12-25-2012 04:41 AM

Omxplayer does the business all right. I had a struggle for the audio. The winning line was
omxplayer -o hdmi <file>

It came up full size, full speed, and seemed to have capacity to spare. omxplayer isn't as talkative as mplayer, but p pauses and q quits. Omxplayer is actually installed in the Debian Wheezy install for the pi. So it can be done.

EDIT: the python script crashes on line 3 because it can't find the gtk module.

teckk 12-25-2012 09:20 AM

Ok, that's good info, thanks.
http://elinux.org/Omxplayer
http://www.raspberrypi.org/phpBB3/vi...p?f=22&t=21435

If Omxplayer won't stream
Then make a named pipe (mkfifo) and stream to it, out of it. Use omxplayer instead. Assuming that omxplayer will play from a pipe.
Code:

mkfifo abc.fifo
mplayer http://path/to/file -dumpstream -dumpfile abc.fifo
cat abc.fifo | omxplayer -

Or use the standard output/input like a pipe.
Code:

youtube-dl http://blah/blah - | omxplayer -
Or use youtube-dl to get it, then play it with omxplayer.

This thread shows
Just how many ways that you can skin a cat with a Linux box, or board even,

Just how versatile Linux and open source software is,

Just how learning some basic Linux shell, command line, and basic shell scripting can make you functional across different platforms and devices,

If no software exists that does exactly what you want, then easily make your own with what is extant.

business_kid 12-26-2012 04:45 AM

Omxplayer refuses standard input, pipes, etc, and only wants to see files. But as you pointed out, there's more that 1 way to do things if you are a little familiar with the Unix command line. I first tried this:

Quote:

mkfifo nutty.fifo
youtube-dl URL > nutty.fifo & sleep 5 && omxplayer -o hdmi nutty.fifo
But that wasn't too good, because all the standard youtube-dl output went into the fifo as well. I don't really know what happened, but I saw nothing. So I opened a second terminal. In one I ran
Quote:

youtube-dl URL -o nutty.fifo
and in the other I put in
Quote:

omxplayer -o hdmi nutty.fifo
and simply waited for the youtube download to get under way, switched focus to the second terminal and hit return.

In it's right place, the fifo is such a powerful tool. The pipsqueak was fast enough to handle the download and the playback simultaneously, and for sites amenable to youtube-dl, that certainly seems to be the way to go.

A much higher hurdle is the nearby English channels. I'll look into that rtsp and rtmp stuff to see if I can make any progress there. How am I supposed to run the .php files?

teckk 12-26-2012 08:55 AM

Quote:

youtube-dl URL > nutty.fifo & sleep 5 && omxplayer -o hdmi nutty.fifo
That won't work, that puts the shell output into the pipe.
Code:

mkfifo nutty.fifo && \
omxplayer -o hdmi nutty.fifo && \
youtube-dl -f 17 http://www.youtube.com/watch?v=D1u3fjJBd0w -o nutty.fifo

Just like you did.

This script will probably work
Code:

#!/bin/sh

echo "Enter URL"
while read URL
do
omxplayer -o hdmi $(youtube-dl -g --cookies /tmp/cookie.txt "$URL")
done

Save it as video.sh, make it executable, launch it, paste in the URl when asked.
Quote:

How am I supposed to run the .php files?
I don't know what you mean by that. rtmpdump is a little command line app. (A binary) rtmp://host[:port]/playpath
Code:

Usage: omxplayer [OPTIONS] [FILE]
Options :
        -h / --help                    print this help
        -n / --aidx  index            audio stream index    : e.g. 1
        -o / --adev  device            audio out device      : e.g. hdmi/local
        -i / --info                    dump stream format and exit
        -s / --stats                  pts and buffer stats
        -p / --passthrough            audio passthrough
        -d / --deinterlace            deinterlacing
        -w / --hw                      hw audio decoding
        -3 / --3d                      switch tv into 3d mode
        -y / --hdmiclocksync          adjust display refresh rate to match video
        -t / --sid index              show subtitle with index
        -r / --refresh                adjust framerate/resolution to video
              --boost-on-downmix        boost volume when downmixing
              --font path              subtitle font
                                        (default: /usr/share/fonts/truetype/freefont/FreeSans.ttf)
              --font-size size          font size as thousandths of screen height
                                        (default: 55)
              --align left/center      subtitle alignment (default: left)

Key Bindings
z          Show Info
1          Increase Speed
2          Decrease Speed
j          Previous Audio stream
k          Next Audio stream
i          Previous Chapter
o          Next Chapter
n          Previous Subtitle stream
m          Next Subtitle stream
s          Toggle subtitles
q          Exit OMXPlayer
Space or p  Pause/Resume
-          Decrease Volume
+          Increase Volume
Left Arrow  Seek -30
Right Arrow Seek +30
Down Arrow  Seek -600
Up Arrow    Seek +600


business_kid 12-26-2012 01:30 PM

That bash script works all right. It's a bit disconcerting because you see no output for 10 seconds, before the video starts. so youtube is sorted.

I actually had the binaries of rtmpdump,compiled burt they were hidden in a directory I use to make slackware packages for installation. The intention was to add rtsp stuff there as well.


All times are GMT -5. The time now is 10:14 AM.