Get video property value from MPV

By xngo on July 11, 2019

# You can get the property value of video file from MPV using --term-playing-msg option.
# Example: Get filename, video width, video height
mpv --term-playing-msg="\${=filename}, \${=width}, \${=height}" \
    --vo=null --ao=null \
    --frames=1 --quiet --no-cache --no-config \
    video.mp4

https://github.com/mpv-player/mpv/blob/master/TOOLS/mpv_identify.sh

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.