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-23-2012 03:04 AM

Proof of concept required
 
/begin long preamble
I have replaced my tv with a 24" HDMI monitor. My son saw this as a cue to get me a raspberry pi to download & watch stuff with. I'm trying to do a proof of concept download. But it transpires I need another box. The pi can have iced tea for a java plugin, but there's nothing for it that does flash. Gnash in particular hasn't implemented these flash features yet, and adobe aren't bothered.
/end long preamble

/Begin Question
I want to get some 'remote desktop' protocol going which will allow me to download (via eth0) on my laptop, and forward (via wlan0) to the raspberry pi which will allow me to use the flash & java plugins on the laptop, and choose the download from the raspberry pi. I do _not_ want to set up a mythtv server if there's any other possible way out.

Has someone written this up anywhere?

414N 12-23-2012 04:56 AM

What is the "critical" flash content you're not able to access on the Raspberry PI?
If you're talking about youtube videos then there are a lot of dedicated applications that can stream and download videos from there. To name a few: youtube-dl, minitube and, of course, the youtube addon you can download for XBMC.
There's not only gnash, though. Have a look at Lightspark.

business_kid 12-23-2012 09:24 AM

Lightspark sounds like a good idea. Unfortunately the version of debian wheezy is a bit short on essentials - requiring cmake to build whereas the raspberry pi distro barely has make. Going after cmake sources just to try my luck, but I'm not hopeful

As I have been asked: The "critical" content I was trying to stream is squeaky clean documentaries/films, and I didn't consider it critical. I want to be able to send him an email of us watching something via a raspberry pi before I get one from him of him watching something on a raspberry pi. He is big time into windows and macs and know a bit of linux. That kid has IT degrees coming out of his rear end and is on about twice what I ever earned.

414N 12-23-2012 09:46 AM

Isn't cmake available through apt/aptitude?
You should also install build-essentials, with a line like this:
Code:

sudo apt-get build-essential cmake
Be aware, though, that the Raspberry PI lacks the horsepower needed to enjoy most flash-based content and you should really try to find some kind of native application which directly plays the media you're interested in.
Maybe you can find something on the Pi store.

teckk 12-23-2012 10:58 AM

I was reading about it. Some thoughts of what I would try.
Can you get perl working on that little debian OS, or the little arch OS.
Looks like youtube-viewer and mplayer might be a natural.
Code:

pacman -Si youtube-viewer
Repository    : community
Name          : youtube-viewer
Version        : 1:3.0.4-1
URL            : https://github.com/trizen/youtube-viewer
Licenses      : GPLv3
Groups        : None
Provides      : None
Depends On    : perl>=5.10.0  mplayer  perl-data-dump  perl-libwww  perl-xml-fast
Optional Deps  : perl-term-readkey: to get the terminal width size
                perl-term-readline-gnu: for a better STDIN support
                perl-lwp-protocol-https: for login and https support
                gcap: for retrieving Youtube closed captions. [in AUR]
Conflicts With : None
Replaces      : None
Download Size  :  36.81 KiB
Installed Size : 220.00 KiB
Packager      : Daniel Wallace <danielwallace at gtmanfred dot com>
Architecture  : any
Build Date    : Wed 21 Nov 2012 05:05:16 PM CST
MD5 Sum        : 3eb1c7e3572c01c41cc03fbabba35b0f
SHA256 Sum    : 561db0a25951b59267d3a49d345425709529322e157b9f72cefb39dc81275122
Signatures    : Yes
Description    : A command line utility for viewing youtube-videos in MPlayer.

It says that it comes with python and midori. (The default debian) It has to have gtk and webkit then. Then you could always make a little script like this example for getting the URl of jpg files.
Code:

#! /usr/bin/env python2

import gtk, webkit, urllib2

x=100

def update(view, frame, resource, request, responce):
    global x
    url=request.get_uri()
    if "jpg?" in url:
        print url
        u = urllib2.urlopen(url)       
        file = open( str(x) + ".jpg", 'w')
        file.write(u.read())
        file.close()
        x+=1

win = gtk.Window()
win.connect('destroy', lambda w: gtk.main_quit())
win.show()

box1 = gtk.HBox()
win.add(box1)

web = webkit.WebView()
web.connect("resource-request-starting", update)
box1.pack_start(web)

# URl of page.
web.open("https://webpage/name/name.html")

box1.show_all()

gtk.main()

If you want to get the video on the laptop to start with, and then transfer it to the raspberry...can you ssh from the pi to the laptop or visa versa?
You can get the URL of the video with youtube-dl, look at the web pages source, etc.
Dump the video to file then transfer it over.

If you can get mplayer and youtube-dl working on the pi then play the video on the rasberry.
Code:

#!/bin/sh

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

You don't have to have flash installed on a box to play flash videos. Mplayer will do it. Just some thoughts....

teckk 12-23-2012 11:12 AM

Oh, another thought.
If you can find the rtsp:// stream on the web sites source, mplayer will play it.
Code:

mplayer ffmpeg://rtsp://path/to/stream/video
or even
Code:

mplayer mplayer://rtsp://path/to/stream/video
Or if it requires authentication....find it on the .php or .html soure and use rtmpdump

Stream it to file, sleep 15, then play the file
Code:

rtmpdump -r rtmp://path/to/stream/video -W http://path/to/player/HuluMock.swf -v -o out.flv & sleep 15 && mplayer out.flv
Ore if you don't want to stream it to file because you don't have space, stream it to a pipe or standard output, play from standard input
Code:

rtmpdump -r rtmp://path/to/stream/video -W http://path/to/player/HuluMock.swf -v -o - | mplayer -
I think that the possibilities are many.

business_kid 12-23-2012 04:47 PM

Wow! A lot of answers here. I'll read them 2moro.

Tried & failed with lightspark. Lightspark needed a dependency which used cmake. No arm packages. I tried to build cmake, but the debian wheezy has nothing in /usr/lib/pkgconfig. So I copied it from slackware, and symlinked the .pc files in, as it only checks versions.

Now it goes for 2 hours, and dies looking for curl. Curl is there, and the pkgconfig file is there, but it still can't be found.

business_kid 12-24-2012 04:54 AM

@ teckk: I'm seriously impressed, teckk. Thank you very much for all these ideas, packages, scripts even.
Yes, the pi isn't really up to flash & java. My one has been given the rather appropriate hostname: 'pipsqueak.'The rstp sounds a lot more promising. The system is only 1.5G or so, 1.9G free space. The usb

I was surprised not to find cmake, but I did try apt getting it and couldn't find. Mind you, I'm as debian noob and have very little on the use of apt-whatever. I will get back with any positive results. The rstp protocol may even get under bbc or channel 4's limitations on nationality (Free access in UK; no access outside, and I'm just outside). I can try these on the laptop, and replicate on the raspberry pi.

business_kid 12-24-2012 09:08 AM

@414n: Thanks for the reassurance on cmake - I got it.
Lightspark: Final Word:
"To install this software you need to install development packages for llvm (2.8, 3.0, or 3.1), opengl, curl, zlib, libavcodec, libglew, pcre, librtmp, cairo, libboost-filesystem, libxml++, gtk-2, libavformat, pango & liblzma
For Sound: pulseaudio-libs, and/or libsdl.
For Browser Plugin: development package for xulrunner
Install also cmake and nasm."
I don't think lightspark is ready for the mobile market yet! This also explains curl. I have come from running slackware, and forgot about development packages because slackware just does the one. If the program is installed, the development stuff is as well. I simply forgot that I would need curl, and curl-devel.

@teckk: I actually found rtmpdump in a package. rstp I got as php scripts. mplayer I found, but I don't know about codecs. I believe there is a h264 codec out in the ether somewhere (I may have to pay for it) but that would mean mp4 is doable. Of course I was able to save some space by putging cmake & dependencies. This reply is coming from pipsqueak, the raspberry pi.

So I still have 2 questions:
1. Take an example youtube video
http://www.youtube.com/watch?v=D1u3fjJBd0w
How do I translate that into an rtmp[t][e] :// or rtsp:// path?

2. How does one use the rtsp php scripts?
php is not installed. I gather from the scripts they do a bit of detective work on the path. php is probably beyond the sanity limit to install here anyhow. The thing does have dillo, netsurf, & midori which are all hopeful but probably space efficient browsers. Chrome is apparently available, and iced tea although the space involved is a major trade-off on a 4G disk.

414N 12-24-2012 09:42 AM

Regarding question 1: I suggest you to use something a little more "hi-level" first, like minitube (I think you'll need to compile it yourself, though) or even VLC (it can play youtube links like the one you just posted).

teckk 12-24-2012 10:17 AM

You don't even need a GUI for ssh, rtmpdump, mplayer, ffmpeg, shell scripts, youtube-dl etc. They are small little apps that are usually staples in repositories. Mplayer will use framebuffer if necessary.
Code:

mplayer -vo fbdev2 -vf scale=160:120 video.mp4
Looks like mplayer works on it.
http://www.raspberrypi.org/phpBB3/vi...p?f=66&t=21364
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=8157
http://codeandlife.com/topics/raspberry-pi/

The graphics will do H264, mpeg4, mpeg2
http://en.wikipedia.org/wiki/Raspberry_Pi
http://www.raspberrypi.com/mpeg-2-license-key/
http://www.raspberrypi.com/vc-1-license-key/
http://www.raspberrypi.org/faqs

Anyway, good luck. Post back on what you come up with.
-------------------------------------------------------------------
Read your last post..

Quote:

How does one use the rtsp php scripts?
I meant look through the web sites source, the html file, .php scripts, javascripts etc. The Mods here might consider that hacking so I'll leave that at that.

Quote:

1. Take an example youtube video
http://www.youtube.com/watch?v=D1u3fjJBd0w
How do I translate that into an rtmp[t][e] :// or rtsp:// path?
Use that shell script I gave you, save it as UT for example.
chmod +x UT (make it executable)
Then launch UT (./UT), paste in the URL.
or
Code:

youtube-dl http://www.youtube.com/watch?v=D1u3fjJBd0w - | mplayer -
You'll have to wait for the whole video to come in.
or
Code:

youtube-dl -f 18 http://www.youtube.com/watch?v=D1u3fjJBd0w
Then play D1u3fjJBd0w.mp4 with your media player. (-f 18 is .mp4)
or
Code:

youtube-dl -f 18 http://www.youtube.com/watch?v=D1u3fjJBd0w - | xargs mplayer
To watch the video as it streams.

The idea is to make a script to do it automatically, so all you have to do is paste in a URl. Once you make a script, just launch the script like any executable and paste in the video link when it asks.
So in shell so it looks like
Code:

./UT
Enter URL

Code:

./UT
Enter URL
http://www.youtube.com/watch?v=D1u3fjJBd0w
MPlayer SVN-r35421-4.7.2 (C) 2000-2012 MPlayer Team
199 audio & 415 video codecs
........
........
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.71.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 126.2 kbit/8.94% (ratio: 15774->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 854x480 => 854x480 Planar YV12
A:  2.2 V:  2.2 A-V:  0.000 ct:  0.033  0/  0  8%  2%  0.8% 0 0 47%


teckk 12-24-2012 10:28 AM

I've got some FreeBSD machines that I've never had flash installed on, have javascript turned off in the browser, and watch almost all of the on-line flash videos that I want. If it's youtube that you are wanting, that's an easy answer.
youtube-dl outputted into mplayer
Look at
Code:

youtube-dl -h
Code:

man mplayer
That last one you will want to do on a day that you have hours to kill. In about 3 years you should be up to speed on it's manual. Then if you are really feeling sadistic have a look at ffmpeg's manual.

business_kid 12-24-2012 01:35 PM

1 Attachment(s)
SUCCESS! It worked exactly as you said it would.

But Failure :-(. Success in that that bash script grabbed the url, played the file, and the sound. Youtubd-dl is python; I used to think it was perl.

Failure, in that it wouldn't resize up from what you can see. The cars (doing 15-20mph in the film) did a jerky 2-3mph when played, but the sound ran ahead. In video, it quickly ran a minute behind. Mplayer spat up the helpful diagnosis

Quote:

***************************************************************************

WARNING!! Your System is TOO SLOW to play this!

***************************************************************************
Now the arm in my Android smart phone does youtube but at a tiny dpi. That's a google app playing a google download, and i'm sure they can pull tricks. Until someone comes along with an arm-specific player of some versatility, this is a fool's game. However, teckk, your kudos has risen sharply and your knowledge of this stuff is obvious. But there is a thin line between that and teaching people to pirate stuff, as you have pointed out.

At any rate, I can email my son the all important photo. I can also save the download, and play that; but I'm not too hopeful. What may come out of this is a lower level approach to the English channels. Thanks for your time everyone. If I get anywhere realistic I may come back to this.

teckk 12-24-2012 07:30 PM

youtube-dl defaults to the best (highest resolution.) Use a lower resolution in your youtube-dl script.
Code:

youtube-dl -F http://www.youtube.com/watch?v=D1u3fjJBd0w
[youtube] Setting language
[youtube] D1u3fjJBd0w: Downloading video webpage
[youtube] D1u3fjJBd0w: Downloading video info webpage
[youtube] D1u3fjJBd0w: Extracting video information
Available formats:
35      :      flv    [480x854]
44      :      webm    [480x854]
34      :      flv    [360x640]
18      :      mp4    [360x640]
43      :      webm    [360x640]
5      :      flv    [240x400]
17      :      mp4    [144x176]

So something like
Code:

youtube-dl -f 17 http://www.youtube.com/watch?v=D1u3fjJBd0w
Go from there. See what that little board can handle.

414N 12-25-2012 03:19 AM

Quote:

Originally Posted by business_kid (Post 4856216)
Failure, in that it wouldn't resize up from what you can see. The cars (doing 15-20mph in the film) did a jerky 2-3mph when played, but the sound ran ahead. In video, it quickly ran a minute behind. Mplayer spat up the helpful diagnosis

That's because you didn't tell mplayer to use the hardware acceleration offered by the VideoCore processor on the Raspberry PI board. Unfortunately, you can access this kind of acceleration only through some OpenMAX blob (you can find the relevant libraries in /opt/vc/lib) and mplayer doesn't support OpenMAX as output driver ATM.
There's a dedicated player, omxplayer (should already be installed or in the repos), which exploits OpenMAX to play multimedia files using hardware acceleration, but it can only play files, not streams.
If you could copy the stream to a pipe using youtube-dl and then feed this pipe to omxplayer you would be able to flawlessly play even HD video streams...


All times are GMT -5. The time now is 12:08 PM.