Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omxplayer plays at speed 2.0 when using a pipe #304

Open
IpPsar01 opened this issue Jun 14, 2019 · 3 comments
Open

omxplayer plays at speed 2.0 when using a pipe #304

IpPsar01 opened this issue Jun 14, 2019 · 3 comments

Comments

@IpPsar01
Copy link

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: [email protected] 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: [email protected] 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
Copy link

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
Copy link
Author

IpPsar01 commented Aug 7, 2019 via email

@IpPsar01
Copy link
Author

IpPsar01 commented Aug 8, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants