spock
Posts: 198
Joined: Sun Oct 02, 2011 10:33 am

starting omxplayer in .profile

Wed Dec 05, 2018 12:44 pm

i would like to start omxplayer automatically after booting. so i have put it into .profile and it works fine but i also need to be able to quit it with esc. why doesn't this work if i put stuff in .profile? how can i achieve this in a non-complicated way? :)

User avatar
ksharindam
Posts: 103
Joined: Sat Jan 09, 2016 4:16 pm

Re: starting omxplayer in .profile

Wed Dec 05, 2018 5:00 pm

to control omxplayer, such as quit by pressing Esc, you have to run omxplayer in terminal.
To run omxplayer in fullscreen in xterm, use this command...

Code: Select all

xterm -fullscreen -e omxplayer -b file.mp4
You have to put this command in .profile
My Qt projects at ... https://github.com/ksharindam

spock
Posts: 198
Joined: Sun Oct 02, 2011 10:33 am

Re: starting omxplayer in .profile

Wed Dec 05, 2018 6:54 pm

thanks for your answer! :)

what i forgot to say is that i boot to the cli and not to x.

isn't xterm for x?

User avatar
ksharindam
Posts: 103
Joined: Sat Jan 09, 2016 4:16 pm

Re: starting omxplayer in .profile

Thu Dec 06, 2018 1:49 pm

Yes, xterm requires xserver.

If you are running it in cmdline , then it should not require any terminal for keyboard input.
I dont know why it is not taking keyboard input.
My Qt projects at ... https://github.com/ksharindam

fbe
Posts: 446
Joined: Thu Aug 17, 2017 9:08 pm

Re: starting omxplayer in .profile

Thu Dec 06, 2018 9:03 pm

/home/pi/.profile is executed not on boot but on login as user pi.

I appended a line to /home/pi/.profile

Code: Select all

omxplayer /opt/vc/src/hello_pi/hello_video/test.h264
and omxplayer is running after login and stopping on <esc> no matter whether I automatically or manually login as pi on the CLI or login via ssh.

I'm running current Raspian Stretch with desktop (without recommended software).

spock
Posts: 198
Joined: Sun Oct 02, 2011 10:33 am

Re: starting omxplayer in .profile

Fri Dec 07, 2018 3:23 pm

hm... strange!

i did it like you and can't esc. :(

spock
Posts: 198
Joined: Sun Oct 02, 2011 10:33 am

Re: starting omxplayer in .profile

Tue May 21, 2019 8:47 am

it still doesn't work for me.

i am using the CLI. if start omxplayer directly from the command prompt it works.

but if i start it from a .sh script (i noticed it doesn't only happen if i put it into .profile) then it doesn't react to any keyboard presses. i have to reset the pi afterwards.

does nobody else have that problem? :)

Return to “Raspbian”