Unattended stream recording with MPlayer | Linux Today

Unattended stream recording with MPlayer

Written By
Web Webster
Web Webster
Feb 4, 2011

“The Linux movie player program MPlayer has an option to record
an Internet-broadcast video stream for playing later. The recording
can be done from the command line. This is useful for two reasons:
(1) you can record at a time when you are too busy to watch, (2) if
your Internet connection is poor for realtime video but reasonable
for non-realtime bandwidth (some low-end cable connections are like
this), then you might get better results by using ssh to log into a
well-connected remote box, record the broadcast from there, and
then download the resulting file in non-realtime (assuming the
broadcast is short, otherwise this might not be practical).

“However, many versions of MPlayer have trouble doing this
unattended. Firstly, if the connection to the stream goes down for
whatever reason, MPlayer makes no attempt to re-establish it, and
secondly it’s difficult to tell MPlayer when to stop recording
(there are command-line timing options but they don’t always work,
and interrupt signals can be ignored).

“One workaround is to write a script in Python (or some other
language) that runs MPlayer inside a “pseudo-terminal” and control
it via this terminal. The script can then take responsibility of
restarting MPlayer if necessary, and sending a keystroke to close
it down at the end.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.