huceke / omxplayer

omxplayer
GNU General Public License v2.0
522 stars 501 forks source link

omxplayer plays at speed 2.0 when using a pipe #304

Open IpPsar01 opened 5 years ago

IpPsar01 commented 5 years ago

Some help is needed on the following: I want to run omxplayer as a separate process and sent characters to it via a pipe in order to pause, stop, etc. But when I run omxplayer and have it read from a fifo pipe it starts at playspeed 2.0!

The setup is as follows: I create a pipe using: mkfifo /tmp/cmdVideo

On one terminal I start:

!/bin/bash

export DISPLAY=:0 omxplayer -o local "/home/pi/Media/Videos/2019/2019-04-02 - Swan.mp4" </tmp/cmdVideo &

On another terminal I enter characters into the pipe. To start the playing: echo –n . > /tmp/cmdVideo To stop the playing: echo –n ‘q’ > /tmp/cmdVideo

The output from omxplayer is: Video codec omx-h264 width 1920 height 1080 profile 100 fps 29.970030 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: 1920x1080@29.97 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 Playspeed 2.000 Stopped at: 00:00:10 have a nice day ;)

If run without the pipe it plays at normal speed: omxplayer -o local "/home/pi/Media/Videos/2019/2019-04-02 - Swan.mp4" Video codec omx-h264 width 1920 height 1080 profile 100 fps 29.970030 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: 1920x1080@29.97 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 have a nice day ;)

I have tested with different videos, doesn’t make any difference.

Any help is welcome. Thanks in advance!

hobbieman commented 5 years ago

I am trying to do the same as you and although I have some issues, I do not have the same problem as you. For me it starts playback at normal speed, but I have issues after that.

Anyway, I think your issue is caused by that first DOT character you send to the FIFO. Try sending a SPACE character instead. If that does not work, send a second SPACE character separately (add a small wait in between sending them).

IpPsar01 commented 5 years ago

Thanks. I will play around with it at a later moment. Keep you posted.

Van: prusa3duser [mailto:notifications@github.com] Verzonden: Wednesday, August 07, 2019 00:52 Aan: huceke/omxplayer CC: IpPsar01; Author Onderwerp: Re: [huceke/omxplayer] omxplayer plays at speed 2.0 when using a pipe (#304)

I am trying to do the same as you and although I have some issues, I do not have the same problem as you. For me it starts playback at normal speed, but I have issues after that.

Anyway, I think your issue is caused by that first DOT character you send to the FIFO. Try sending a SPACE character instead. If that does not work, send a second SPACE character separately (add a small wait in between sending them).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/huceke/omxplayer/issues/304?email_source=notifications&email_token=AMLF7VDYWY5U6SXGV2OGFADQDH6CZA5CNFSM4HYIDKJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3WV5DA#issuecomment-518872716 , or mute the thread https://github.com/notifications/unsubscribe-auth/AMLF7VDFIO553XRNBZUNZE3QDH6CZANCNFSM4HYIDKJQ .Afbeelding verwijderd door afzender.

IpPsar01 commented 5 years ago

I am trying to do the same as you and although I have some issues, I do not have the same problem as you. For me it starts playback at normal speed, but I have issues after that.

Anyway, I think your issue is caused by that first DOT character you send to the FIFO. Try sending a SPACE character instead. If that does not work, send a second SPACE character separately (add a small wait in between sending them).

This resolved it for me. Great. It's now playing at the normal speed and due to that also with audio. Thanks.