Pipe Unrar Output Directly to a Media Player
Streaming video directly from a compressed RAR archive allows you to
watch media without waiting for a full extraction or using extra disk
space. By using the command-line utility unrar to send file
data to standard output (stdout), you can pipe the uncompressed stream
straight into the standard input (stdin) of media players such as VLC,
MPV, or MPlayer.
The Basic Command Structure
To pipe a media file from a RAR archive into a player, use the
p (print) command combined with the -inul
(inhibit messages) switch:
unrar p -inul archive.rar | mpv -Command Breakdown
unrar: Invokes the command-line extraction tool.p: Instructsunrarto output the contents of the compressed file directly to standard output (stdout) instead of writing it to disk.-inul: Suppresses all status messages, headers, and copyright banners. This is crucial because any text mixed into the video stream will corrupt the playback.archive.rar: The path to your target RAR archive.|: The pipe operator, which redirects stdout of the left command to stdin of the right command.mpv -: The media player command. The trailing hyphen (-) explicitly tells the media player to read the video stream from standard input rather than looking for a local file.
Examples for Common Media Players
Depending on your preferred video player, you can adjust the receiving end of the command:
Using MPV
unrar p -inul movie.rar | mpv -Using VLC
unrar p -inul movie.rar | vlc -Using MPlayer
unrar p -inul movie.rar | mplayer -cache 8192 -(Adding a cache buffer to MPlayer helps prevent playback stuttering.)
Handling Multi-Part Archives
If your media file is split across multiple RAR files (e.g.,
movie.part01.rar, movie.part02.rar), specify
only the first volume in the sequence. unrar will
automatically read the sequential volumes and stream the file
continuously:
unrar p -inul movie.part01.rar | mpv -Specifying a File in Multi-File Archives
If the archive contains multiple files (such as sample clips, text
files, or subtitles), specify the exact filename of the video you want
to play at the end of the unrar command:
unrar p -inul release.rar "video.mkv" | mpv -If you do not know the exact filename, run
unrar l archive.rar first to list the contents of the
archive.