How to export audio and video on GNU/Linux system ?
Suppose you want to export audio/video from system REMOTE (where you are running our application say mplayer), to another system LOCAL (where you want to see it and hear it).
The scenerio is : you are working on system LOCAL. From there you logon to system REMOTE (say using ssh). You want to run mplayer on system REMOTE, and want to watch a movie. And obviously want to hear the audio too.
example : LOCAL = 172.16.7.31 aka inferno and REMOTE = 172.16.10.31 aka matrix
exporting video ( called DISPLAY )
———————————–
you want to open display of REMOTE on LOCAL.
LOCAL should allow REMOTE to open display on LOCAL
For that on LOCAL we do
LOCAL$ xhost +REMOTE_IP
example : [smr@inferno ]$ xhost +172.16.10.31
REMOTE_IP is the ip of REMOTE system
+REMOTE_IP means you are adding REMOTE to the access list of exporting display
* “$ xhost +” means you are allowing eveyone to export display to your system
now you can export display from REMOTE to LOCAL by
REMOTE$ export DISPLAY=LOCAL_IP:0.0
example : [neo@matrix]$ export DISPLAY=172.16.7.31:0.0
LOCAL_IP is the ip of the LOCAL system
:0.0 means the display number of LOCAL system
the default display opened is 0, so works most of the times
if your display is something else then you need to give that ex
LOCAL_IP:2.0 for display 2
* i dont know what does .0 mean (why other 0 after dot)
now you can see the video of mplayer running on REMOTE system on your LOCAL system,
REMOTE$ mplayer movie.avi
example : [neo@matix]$ mplayer The-Matrix.avi
expoting audio ( sound )
————————
unlike display there is no native way of exporting audio
so we export sound using arts, esd, etc, which sends the stream from remote using tcp on some port and is recieved by at the other end at that port, and played.
what audio modules do you have - arts/esd/oss/sdl/etc ??
exporting sound is dependent on what mode you want to use and what modes do you have
using arts
———-
start arts server on LOCAL system, in listening mode on port 5001 ( any port u like)
LOCAL$ artsd -u -n -p 5001
example : [smr@inferno]$ artsd -u -n -p 5001
-u means public => no authentication => dangerous
now export arts sound from REMOTE to LOCAL
REMOTE$ export ARTS_SERVER=LOCAL_IP:5001
example : [neo@matrix]$ export ARTS_SERVER=172.16.7.31:5001
5001 is the port where arts server is running on LOCAL system
while running your application make sure that its using arts as sound output in your appplication (in mplayer we give -ao arts )
REMOTE$ mplayer movie.avi -ao arts
example: [neo@matrix]$ mplayer The-Matrix.avi -ao arts
using esd
———
start esd on LOCAL sysem, in listening mode on port 5001
LOCAL$ esd -public -tcp –port 5001
example: [smr@inferno]$ esd -public -tcp –port 5001
now export esd sound from REMOTE to LOCAL
REMOTE$ export ESPEAKER=LOCAL_IP:5001
example: [neo@matrix]$ export ESPEAKER=172.16.7.31:5001
5001 is the port where esd server is running on LOCAL system
while running your application make sure that its using esd as sound output in your appplication (in mplayer we give -ao esd )
REMOTE$ mplayer movie.avi -ao esd
example: [neo@matrix]$ mplayer The-Matrix.avi -ao esd
Some applications don’t speak esd.So we fools them into talking to esd when they think they’re opening dsp. This is done using esddsp in the following way ( assume your mplayer does not supprt esd )
$ esddsp -v –server=LOCAL_IP:5001 mplayer movie.avi
example: [neo@matrix]$ esddsp -v –server=172.16.7.31:5001 mplayer movie.avi
i don’t know how can sound be exported using other sound systems like oss,sdl etc.
Updated May 05, 2005 : Wow this page is first result on google seach of “exporting audio/video linux” queries 
Report bugs/errors/feedback to me at smr@thisserver….