开发者

Make MPlayer show all playback state change message in output

I'm currently using MPlayer in slave mode for a video player im making.

As of currently, the media player shows ==== PAUSED ==== when it's paused and I can read the output for this status to know when the video is paused.

The command line arg i am using as of now is msglevel identify=6:statusline=-1 (i disabled statusline as it produced A: 0.7 V: 0.6 A-V: 0.068 ... and unneccessary stuff)

What do I need to set the msglevel (or anything else) so that it will also show ==== PLAYING ==== or any indication that 开发者_JS百科it started playing, stopped, media ended, loading, etc?


I found out how to get if the video is paused.

By sending command pausing_keep_force get_property pause to mplayer, it responds with ANS_pause=no if not paused, and ANS_pause=yes if paused. Problem solved.


Based on what I can decipher from the OP's answer to his/her own question, he/she was looking for a way to determine whether mplayer was paused or playing. I've written a little bash script that can handle this task with some simple function calls.

You can actually inspect the last couple lines of mplayer's output to see if mplayer is paused. I put together a little bash library that can be used to query some status information about mplayer. Take a look on my GitHub. There are instructions for integrating my script with other bash scripts.

If you implement my script, you will need to play your media file using the playMediaFile function. Then you can simply call the isPaused function as a condition in bash like this:

if isPaused; then
    # do something
fi

# or
if ! isPaused; then
    # do something
fi

# or
ifPaused && #do something
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜