OpenVG based YouTube client.


75 posts   Page 2 of 3   1, 2, 3
by kalehrl » Wed Jan 02, 2013 5:48 pm
Finally, I managed to compile it with some hacking.
In file gfxlib.c you need to comment out this line:
Code: Select all
jpeg_mem_src(&jdc, buf, bufSize);

So it becomes:
Code: Select all
// jpeg_mem_src(&jdc, buf, bufSize);

Surely there is a better way to solve this error than this but bbond007 will hopefully enlighten us.
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by bbond007 » Wed Jan 02, 2013 6:52 pm
kalehrl wrote:Finally, I managed to compile it with some hacking.
In file gfxlib.c you need to comment out this line:
Code: Select all
jpeg_mem_src(&jdc, buf, bufSize);

So it becomes:
Code: Select all
// jpeg_mem_src(&jdc, buf, bufSize);

Surely there is a better way to solve this error than this but bbond007 will hopefully enlighten us.


That is only going to be called (createImageFromBuf) if you enable software jpeg decoding.... by default, its not used.

That function is part of libjpeg and it tells the library the location of the jpeg in memory to start to decode, so its kinda important :)

I don't know why it would have a problem with that function but not "jpeg_create_decompress" or "jpeg_read_header" which are part of the same library....
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Wed Jan 02, 2013 7:09 pm
kalehrl wrote:Finally, I managed to compile it with some hacking.
In file gfxlib.c you need to comment out this line:
Code: Select all
jpeg_mem_src(&jdc, buf, bufSize);

So it becomes:
Code: Select all
// jpeg_mem_src(&jdc, buf, bufSize);

Surely there is a better way to solve this error than this but bbond007 will hopefully enlighten us.


I think you libjpeg62 is too old.... and does not have a jpeg_mem_src function

sudo apt-get libjpeg8-dev

I'm updating the readme file now...

good luck...
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by kalehrl » Wed Jan 02, 2013 7:59 pm
Now it compiles just fine.
I suggest you add this to your readme file:
Code: Select all
cd /opt/vc/src/hello_pi/libs/ilclient
make

because without it, compilation will fail with:
Code: Select all
/usr/bin/ld: cannot find -lilclient
collect2: ld returned 1 exit status
make: *** [raspytube.bin] Error 1

Thank you
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by kalehrl » Thu Jan 03, 2013 8:42 am
Since an old version is on the git server, I attach here the latest which I compiled on Raspbian.
First:
Code: Select all
sudo wget https://github.com/downloads/rg3/youtube-dl/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl

Then download my zip file and unzip it.
Code: Select all
chmod 755 raspytube.bin

And run it with:
Code: Select all
./raspytube.bin

http://www.mediafire.com/?q6827b6ny2bzxfs
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by bbond007 » Fri Jan 04, 2013 4:08 pm
kalehrl wrote:Since an old version is on the git server, I attach here the latest which I compiled on Raspbian.


I'm pretty sure the bin.zip on the git server is getting updated and should have the latest always. I'll check into that...

Anyway I have updated the application to allow downloading of videos...

press the I key or corresponding gamepad button twice...
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Fri Jan 04, 2013 4:57 pm
bbond007 wrote:
kalehrl wrote:Since an old version is on the git server, I attach here the latest which I compiled on Raspbian.


I did verify by downloading the git repository and both the "raspytube.bin" and "raspytube.bin.zip" and they seem to be the latest build with the download feature. "make" worked as well.

Perhaps you have old stuff in your browser cache?

anyway, here is the screenshot of the download feature:

https://github.com/bbond007/raspytube/b ... screen.jpg

I amazed at how many full movies are on youtube... I had no idea...
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by kalehrl » Fri Jan 04, 2013 5:35 pm
I compared the sizes of your binary and the one I compiled and mine is much bigger - 1.7MB compared to yours of 1.14MB. So I assumed it was the old version. Any ideas why such size difference?
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by ++bahjatk++ » Fri Jan 04, 2013 6:46 pm
Thank you bbond007 !
Since I am yet to get my Pi, I have a question : is this slow like running YouTube videos using flash on gnash ? or does it run (well, not fast - but..) normally ?
I will be very happy if it is, YouTube is a very important part of the internet.

Oh, and are the commands in the readme alright, or do they still have problems ?

Sorry for my many noob questions, and well done bbond007
Posts: 36
Joined: Sun Dec 30, 2012 10:02 am
by bbond007 » Sat Jan 05, 2013 1:02 am
++bahjatk++ wrote:Thank you bbond007 !
Since I am yet to get my Pi, I have a question : is this slow like running YouTube videos using flash on gnash ? or does it run (well, not fast - but..) normally ?
I will be very happy if it is, YouTube is a very important part of the internet.

Oh, and are the commands in the readme alright, or do they still have problems ?

Sorry for my many noob questions, and well done bbond007


It uses omxplayer which is hardware accelerated. The videos will run smooth as silk as long as your internet connection is fast enough.
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Sat Jan 05, 2013 1:05 am
kalehrl wrote:I compared the sizes of your binary and the one I compiled and mine is much bigger - 1.7MB compared to yours of 1.14MB. So I assumed it was the old version. Any ideas why such size difference?

thats because as part of my process I strip the bin....

your bin has 500K+ of symbols

strip rasytube.bin

and see if they are the same

bigger is not always better :)
Last edited by bbond007 on Sat Jan 05, 2013 1:27 am, edited 1 time in total.
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Sat Jan 05, 2013 1:24 am
++bahjatk++ wrote: is this slow like running YouTube videos using flash on gnash ? or does it run (well, not fast - but..) normally ?


You know, I think I know what you are talking about. Like YouTube on my G4 mac with flash...

No... that is truly horrible... this is MUCH better...

Depending on the video and your internet speed... it can look like a blu-ray video...

the only downside is that there is no way to seek to to like 50% or something. you have to watch it from the beginning.
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by kalehrl » Sat Jan 05, 2013 9:55 am
I ran strip raspytube.bin but the size remained the same. :?
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by ++bahjatk++ » Sat Jan 05, 2013 10:07 am
Awesome, thanks again!
But if you get the jpg's (or any other kind of images) to render the video, do you download them frame by frame ? [theoretically speaking, ] I think that if the jpeg's are numbered 1,2,3... hinting the number of frames, you can try to run something in the code that says "go to frame 97, then start playing from there (98,99,100...)".

I am a programmer, but never worked with c or openVG, or actually any kind of videos, but I think this is an idea that may be used for seeking (if anyway possible).
Posts: 36
Joined: Sun Dec 30, 2012 10:02 am
by bbond007 » Sat Jan 05, 2013 4:36 pm
++bahjatk++ wrote:Awesome, thanks again!
But if you get the jpg's (or any other kind of images) to render the video, do you download them frame by frame ? [theoretically speaking, ] I think that if the jpeg's are numbered 1,2,3... hinting the number of frames, you can try to run something in the code that says "go to frame 97, then start playing from there (98,99,100...)".

I am a programmer, but never worked with c or openVG, or actually any kind of videos, but I think this is an idea that may be used for seeking (if anyway possible).


This program works like a very simple browser. Rather than interpreting HTML, it understands YouTube's json-c implementation. Like HTML, this json-c is pure text containing URLs to jpeg files, text descriptions, etc. (Unlike HTML, it does not contain layout information), The technology used draw round rectangles, bitmaps and text is OpenVG. I could have just as easily gone with OpenGL ES.

Once the user has selected video to play the program calls another program called "youtube-dl" with the URL and that program runs and returns another (much longer) URL to the actual video feed. The program then calls omxplayer with that URL which plays the video until the end or until the user aborts. At the time the video is playing my program is almost completely out of the picture. The only thing it is really doing is checking the joystick back button (if pressed it kills omxplayer).

simply "go to frame 97" is not possible because frame 97 is not even on the RPI yet. the server may not have even transcoded it yet, and I'm not really even in control at that point.

Also I'm pretty sure you'd say go to a time base, and not a frame... ie. go to 90 seconds...

I'm not sure if there is a way to communicate with the video streaming server and tell it to jump to a different point. That would be fantastic.

Otherwise it might be is an option I would specify from the beginning as a prram to youtube-dl. That would be less ideal.

Anyway, That feature is a long way off....
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by ++bahjatk++ » Sat Jan 05, 2013 7:07 pm
bbond007 wrote:
++bahjatk++ wrote:Awesome, thanks again!
But if you get the jpg's (or any other kind of images) to render the video, do you download them frame by frame ? [theoretically speaking, ] I think that if the jpeg's are numbered 1,2,3... hinting the number of frames, you can try to run something in the code that says "go to frame 97, then start playing from there (98,99,100...)".

I am a programmer, but never worked with c or openVG, or actually any kind of videos, but I think this is an idea that may be used for seeking (if anyway possible).


This program works like a very simple browser. Rather than interpreting HTML, it understands YouTube's json-c implementation. Like HTML, this json-c is pure text containing URLs to jpeg files, text descriptions, etc. (Unlike HTML, it does not contain layout information), The technology used draw round rectangles, bitmaps and text is OpenVG. I could have just as easily gone with OpenGL ES.

Once the user has selected video to play the program calls another program called "youtube-dl" with the URL and that program runs and returns another (much longer) URL to the actual video feed. The program then calls omxplayer with that URL which plays the video until the end or until the user aborts. At the time the video is playing my program is almost completely out of the picture. The only thing it is really doing is checking the joystick back button (if pressed it kills omxplayer).

simply "go to frame 97" is not possible because frame 97 is not even on the RPI yet. the server may not have even transcoded it yet, and I'm not really even in control at that point.

Also I'm pretty sure you'd say go to a time base, and not a frame... ie. go to 90 seconds...

I'm not sure if there is a way to communicate with the video streaming server and tell it to jump to a different point. That would be fantastic.

Otherwise it might be is an option I would specify from the beginning as a prram to youtube-dl. That would be less ideal.

Anyway, That feature is a long way off....

Thanks for explaining, if omxplayer is open source - can't you add some bits to the code that do the seeking, then upload the modded omxplayer to your repo ? (the sentence sounds rude, but I cannot say it any way else - poor english, sorry!)
Posts: 36
Joined: Sun Dec 30, 2012 10:02 am
by bbond007 » Sat Jan 05, 2013 7:51 pm
++bahjatk++ wrote:Thanks for explaining, if omxplayer is open source - can't you add some bits to the code that do the seeking, then upload the modded omxplayer to your repo ? (the sentence sounds rude, but I cannot say it any way else - poor english, sorry!)


sorry, I just don't know enough about how streaming works at this point to know how and where to implement that functionality....

I'm pretty sure I don't want to maintain a modded omxplayer...
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by ++bahjatk++ » Sun Jan 06, 2013 10:08 am
bbond007 wrote:
sorry, I just don't know enough about how streaming works at this point to know how and where to implement that functionality....

I'm pretty sure I don't want to maintain a modded omxplayer...

Okay then! Still good job on the client, very good.
Adding mouse functionality ? :) I guess I am being sassy but take them as suggestions not orders lol xD
Posts: 36
Joined: Sun Dec 30, 2012 10:02 am
by sim_tcr » Sun Jan 06, 2013 10:19 am
I am following this from few weeks.

Is youtube client ready to use?

Can some one please send instructions (with commands) to install and use it?
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by ghans » Sun Jan 06, 2013 10:25 am
This works , the instructions are on github , scroll down.

They are badly formatted though.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4605
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by bbond007 » Sun Jan 06, 2013 2:49 pm
++bahjatk++ wrote:
bbond007 wrote:
sorry, I just don't know enough about how streaming works at this point to know how and where to implement that functionality....

I'm pretty sure I don't want to maintain a modded omxplayer...

Okay then! Still good job on the client, very good.
Adding mouse functionality ? :) I guess I am being sassy but take them as suggestions not orders lol xD


The mouse might not look that great. With OpenVG I have to paint an video buffer screen then swap buffers to do any visual change(like move a mouse pointer) ... a mouse that moves choppy is not worth having in my opinion. That is my gripe with XBMC on the RPI. So if I tried to implement the mouse, and the movement was not fluid, I would not continue to do the work to make the OSK(on-screen KB) and menus mouse aware. At that point it may be better to make an xwindows app and use some sort of GUI toolkit such as qt or GTK :)

No to be sassy, but I'm really designing the my UI to be controlled by my gamepad from my couch :)

Probably my next efforts will be to redesign the results screen(the man screen) to have configurable # of rows and columns. Once try to push past the rightmost column, you'll get a new set of results. Once you push past the leftmost column, you'll return to previous results.

I also want add a download queue...
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Tue Jan 08, 2013 9:12 pm
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by bbond007 » Tue Jan 08, 2013 11:04 pm
kalehrl wrote:I ran strip raspytube.bin but the size remained the same. :?


maybe your version has spyware :)

just kidding :)
Posts: 73
Joined: Sun Nov 04, 2012 6:10 pm
by kalehrl » Wed Jan 09, 2013 9:53 am
Thanks for the update.
It seems your version has also grown in size. :)
Code: Select all
pi@raspberrypi ~/Templates/raspytube $ git pull
remote: Counting objects: 80, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 63 (delta 43), reused 33 (delta 13)
Unpacking objects: 100% (63/63), done.
From https://github.com/bbond007/raspytube
   07a9d44..baaa2ae  master     -> origin/master
Updating 07a9d44..baaa2ae
Fast-forward
 Makefile                       |    2 +-
 config.c                       |   15 ++++++++---
 gfxlib.c                       |   14 +++++++---
 gfxlib.h                       |    2 +-
 main.c                         |   70 +++++++++++++++++++++++++++++++++++++-----------
 mainmenu.h                     |   14 +++++-----
 raspytube.bin                  |  Bin 1745264 -> 1746896 bytes
 raspytube.bin.zip              |  Bin 636486 -> 636984 bytes
 screenshots/font_menu.jpg      |  Bin 193595 -> 233691 bytes
 screenshots/gui_menu.jpg       |  Bin 175947 -> 211962 bytes
 screenshots/info_screen.jpg    |  Bin 272238 -> 280494 bytes
 screenshots/main_menu.jpg      |  Bin 165066 -> 230395 bytes
 screenshots/results_screen.jpg |  Bin 0 -> 199779 bytes
 term.c                         |    3 +--
 ui.c                           |  199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------
 ui.h                           |    6 ++++-
 16 files changed, 219 insertions(+), 106 deletions(-)
 create mode 100644 screenshots/results_screen.jpg
pi@raspberrypi ~/Templates/raspytube $
Posts: 343
Joined: Tue Jul 24, 2012 10:49 am
by ++bahjatk++ » Wed Jan 09, 2013 9:58 am
I would try to embed raspytube in an x window using GTK+ in the upcoming month or two :)
it would still be controled by keyboard, but window resizing will be available at least. I might not be the best one to do this, but raspytube is currently the best Raspberry Pi youtube player and it'd be awesome with a mouse.
Posts: 36
Joined: Sun Dec 30, 2012 10:02 am