|
Post by rikky on Feb 28, 2018 7:26:08 GMT 1
Since the Raspberry pi is verry little, it does not play video's very well on ordinary players like VLC. Omxplayer is specially created for the hardware of the Raspberry pi, but comes without a gui with buttons for Forward, Play, Pause, etc. So I've made this Bacon gui. It will probably not work on the too little 7'' (or littler) screens from 800 x 480 pixels, until I find tinier buttons then size 48*48. Further more I had to adapt (a little) to fit everything nicely on my screen, so I don't know if it will turn out nicely elsewhere. Everything is as tidy and self explanatory written as I could, so it could serve as an example of how to make your own, better :-) Let's see If someone can find a bug. Best regards, Rik Attachments:OMXPLAYER.tgz (452.7 KB)
|
|
|
Post by ptitjoz on Feb 28, 2018 9:20:51 GMT 1
Hello Currently, I have not my PI2 with me. Also I will try later in the next weeks. I looked at your code : it's a good works. Good luck and I will continue to follow your project. Regards
|
|
|
Post by vovchik on Feb 28, 2018 11:34:53 GMT 1
Dear rikky,
Thanks for that. Brilliant. I had to make a few adjustments, since I have my menubar on top. You had adjusted the "hight" var by -10. I needed -35. And I set the offsets for x and y in the config files at 60 in non-fullscreen mode. Apart from that little stuff, everything was OK and runs very nicely. Very nice work.
With kind regards, vovchik
|
|
|
Post by alexfish on Feb 28, 2018 13:02:32 GMT 1
Hi Rik
looking at the configs , it is possible to get the scan cords , some systems are set to scan cord ON & scan cord OFF
If Scan Cord ON , then possible one gets clipping of the video . or the video will be miss-placed on the actual window depending on the window mode & size
hugrpi has is a routine that gets the scan cords.
the code
CONST GET_OVERSCAN = 0x0004000a CONST TST_OVERSCAN = 0x0004400a CONST SET_OVERSCAN = 0x0004800a CONST END_TAG = 0x00000000
PROTO close REM ============================================================================
DECLARE hug_scan_coord[4] TYPE unsigned FUNCTION mailbox_property(int file_desc, void *buf) TYPE static int int return_value = ioctl(file_desc, _IOWR(100, 0, char *), buf) /* ioctl error of some kind */ IF (return_value < 0) THEN close(file_desc); END END IF
RETURN return_value
END FUNCTION
FUNCTION get_overscan(int file_desc) TYPE unsigned
LOCAL i=0 LOCAL property[32] TYPE unsigned property[i++] = 0 property[i++] = 0x00000000
property[i++] = GET_OVERSCAN property[i++] = 0x00000010 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = END_TAG property[0] = i*sizeof *property
mailbox_property(file_desc, property) hug_scan_coord[0] = property[5] hug_scan_coord[1] = property[6] hug_scan_coord[2] = property[7] hug_scan_coord[3] = property[8]
RETURN 0
END FUNCTION
FUNCTION TESTSCAN() LOCAL file_desc
file_desc = open("/dev/vcio", 0) IF (file_desc == -1) THEN PRINT "TESTSCAN :: Fail :: Exit Now" END ELSE get_overscan(file_desc) close(file_desc) END IF RETURN TRUE
END FUNCTION
TESTSCAN
PRINT "-- ScanCords ----------" ' can try these two values TOP = y Left = x in config file PRINT "Top = : " ,hug_scan_coord[1], " Left = : " , hug_scan_coord[0]
PRINT "Bottom = : " ,hug_scan_coord[2], " Right = : " , hug_scan_coord[3]
Whilst the video plays well , I have no sound at presents , looking further in respect of 'Jessie'
BR Alex
|
|
|
Post by alexfish on Feb 28, 2018 14:12:10 GMT 1
Hi Rik
Looking at the VTE Terminal commands ,
did not see anything specific to end of line/return
Normal operation is to send the commands then to execute one would normally terminate with newline '\n' character
Not sure sure if this will help in this instance , yet for future
can use
vte_terminal_feed_child(term,(char*)"\n",1)
BR Alex
|
|
|
Post by rikky on Feb 28, 2018 14:17:58 GMT 1
your program gives me : -- ScanCords ---------- Top = : 0 Left = : 0 Bottom = : 0 Right = : 0 I suppose, for now, people have to adjust manually in line 129. About the sound, there are three options you can chose from in line 100. output$ = "hdmi" : ' local, hdmi , alsa hdmi = sound from your hdmi television local = sound from your video/sound output plug from your Raspberry alsa = for your usb sound card. I am not aware of any more options. Best regards RIk
|
|
|
Post by rikky on Feb 28, 2018 14:24:06 GMT 1
Ah, I overlooked your last post. Omxplayer reacts on the key presses. For example "q" stops the video from playing. I am only sending these keys, without the newline. If you want to send a command with a newline send to your VTE, you can simply add a & NL$ to your command, and it works. See subroutine start_movie at line 295 command$ = "omxplayer -o " & output$ & " --align center --font-size 40 " & omx_window$ & this_movie$ & NL$ length = LEN(command$) vte_terminal_feed_child(term,command$, length) Rik.
|
|
|
Post by alexfish on Feb 28, 2018 15:03:55 GMT 1
Hi Rik
changing line 100 to
output$ = "local" : ' local, hdmi , alsa
Works Here Now all working as Advertised
BR Alex
|
|
|
Post by vovchik on Feb 28, 2018 15:14:13 GMT 1
Dear Rik and Alex, I get silence with output$ = "local", but hdmi works fine for me. And Alex's geometry test gives me Top = 21, Left = 21, Bottom = 40 and Right = 40. With kind regards, vovchik
|
|
|
Post by vovchik on Mar 1, 2018 11:42:55 GMT 1
Dear Rik, Here is a minimalistic set of 32px icons in SVG format. Just change ".png" to ".svg" in OMXPLAYER.bac, and change the icon folder to "/icons/svg/" and icon_size$ to "32", rather than reading from the dir name. All the icons are with viewBox, which means you can change the size to whatever you want by changing the width="32" and height="32" in the first line of the SVG. I have also attached my modded player version that makes use of the SVG icons. With kind regards, vovchik
|
|
|
Post by rikky on Mar 1, 2018 17:21:36 GMT 1
Yes, it works. Well, had to adjust the screen back to only 10, and put the Omxplayer back from 44,44 to 0,0 of course. I even changed the size to 16, and then only the position falls of, but duration is still visable. Now all the building blocks are in place, even for someone with a real tiny raspi screen of 320*480 resolution Duration and position could even be swapped for a progress bar, like in a 'real' professional player. But I don't have one Maybe later, I don't know. Thanks. Rik.
|
|
|
Post by vovchik on Mar 1, 2018 22:18:55 GMT 1
Dear Rik, Here is another SVG version. I placed all the icons into an include and they are used in inline fashion via the gdk pixbuf loader. It works fine, and this obviates the need for an icons directory and reading in of icons at runtime, since they are already in the binary. I also prevent the file selector from generating a taskbar entry, so it looks better. With kind regards, vovchik
|
|
|
Post by rikky on Mar 1, 2018 23:55:37 GMT 1
Yes, it works, I cannot believe you can draw these pics grammatically. This opens new perspectives. Did you use a program for translating existing pics into program code, or did you do this all by hand? I can not believe the latter, but you never know Thanks. Rik.
|
|
|
Post by vovchik on Mar 2, 2018 0:01:50 GMT 1
Dear Rik, Some of the pics I got from techosaurus on the Puppy linux forum. Others I modified and I drew some others. I have been working with SVGs for some time, so eventually it becomes somewhat "natural". You can do amazing things with SVGs...and the syntax is pretty easy. With kind regards, vovchik PS. In the inline version, I also added mp3s. They play nicely in omxplayer, too. And one way of changing the icon size is simply to use icon_size$ = "24", for example, without actually changing the width and height in the SVGs, since the TEXT_SVG function will do the scaling.
|
|
|
Post by rikky on Apr 20, 2018 6:02:11 GMT 1
So there were some problems with the OMXPLAYER. Most importanly, you could not play with the buttons like as if it is a piano, for then the player got stuck. Mostly because of REWIND and FAST_FORWARD. These routines have been rewritten in an custom routine. Now FAST_FORWARD AND REWIND work, only they sputter. But better have a player that sputters, then one that gets stuck. I kept the svg method of Vovchick, but went back to the old pics. That is just a matter of taste. One other thing is that there is a config-gui added. You can now adjust the small and full screens with buttons. The subtitles. omxplayer says it recognizes subtitles in the docu, but it doesn't, except for moviename.srt So now it translates your moviename.prefered_language.vtt to moviename.srt Change the line 87: translation_preferences$ = "nl en fr es de ru" according to your taste. change subtitles, doesn't work at all, no matter what I tried, so I removed that button, (for now) ehm, and little things. There is still the issue that omxplayer doesn't eat Russian characters. Not in the moviename, for then it crashes, nor in the subtitles, for then it shows no subtitles. I surely hope that this has nothing to do with politics. But these days, I wouldn't be surprised of anything anymore. P.S. I forgot to mention. I don't know how to put this properly in English. Somehow with the introduction of the second GUI , the buttons changed. I mean, in the initialisation, I have to HIDE buttons, in order to SHOW them. couldn't figure out the cause, but it works. Rik. Attachments:OmxPlayer.tgz (85.65 KB)
|
|