mpv stdout/stderr issues

Created on 3 Jul 2016  路  5Comments  路  Source: mpv-player/mpv

OS: linux, SHELL: bash GNU bash锛寁ersion 4.3.46(1)-release (x86_64-pc-linux-gnu)

first thing is:
1, run mpv by: mpv XXX.mp4. we can control mpv via SHELL window.
2, run mpv with STDOUT redirect to /dev/null by: mpv XXX.mp4 1>/dev/null. we lose control mpv on SHELL window
3, run mpv with STDERR redirect to /dev/null by: mpv XXX.mp4 2>/dev/null. we can control mpv via SHELL window

another thing is:
output to STDOUT is error info
and output to STDERR is normal info.

eg:
redirect STDERR to /dev/null, only show STDOUT:

bash$ mpv 'XXXX.mp4'  2>/dev/null
Playing: XXXX.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
[vo/opengl] Could not create EGL context!
AO: [pulse] 44100Hz stereo 2ch float
[vaapi] Decoder profile 'VAProfileH264Baseline' not available.
Using software decoding.
VO: [opengl] 480x272 yuv420p

redirect STDOUT to /dev/null, only show STDERR:

bash$  mpv 'XXX.mp4'  1>/dev/null
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
AV: 00:00:03 / 00:00:20 (18%) A-V:  0.002 DS: 2.017/0

could you make AV: 00:00:03 / 00:00:20 (18%) A-V: 0.002 DS: 2.017/0 output to STDOUT?

question

Most helpful comment

Note that you can also completely disable mpv's terminal output while still retaining functionality by using --really-quiet. (Or for less aggressive variants, you could use --quiet or a custom --msg-level)

All 5 comments

The status line is intentionally on STDERR and not STDOUT.

As for 1>/dev/null disabling the terminal, I think that's caused by mpv checking for presence of STDOUT and using that to decide whether it's running in GUI or CLI mode.

thanks @haasn
your answer is reasonable for me.
please close it if you don't want to change.

The libva lines are output by libva directly to stderr, and last I checked there was no way to prevent it.

Note that you can also completely disable mpv's terminal output while still retaining functionality by using --really-quiet. (Or for less aggressive variants, you could use --quiet or a custom --msg-level)

@haasn thank you!

Was this page helpful?
0 / 5 - 0 ratings