LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-13-2012, 07:47 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
Listen audio over SSH distant during vacations?


Hello, During vacations, I would pleased to check the house sometimes, by listening the alsa hw:0.0 over SSH. Would you eventually know to make it? ffmpeg or direct some other designed application?

thanks
 
Old 03-13-2012, 06:11 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Do you specifically want to create an application to push audio data over ssh? ... it might be simpler to install freenx server and enable multimedia resources, then work on activating the microphone.
 
Old 03-13-2012, 06:51 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
It's been awhile but I've done something like this with sox in the past.

Code:
ssh user@host "cat /path/to/music/file" | play -t wav -
 
Old 03-14-2012, 10:22 AM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by trickykid View Post
It's been awhile but I've done something like this with sox in the past.

Code:
ssh user@host "cat /path/to/music/file" | play -t wav -
good beginning. to get the hw.0.0 I do this:

Code:
 arecord  -Dplughw:0,0 -f cd   |   lame  - test.mp3

however ssh cannot run a command or I am not sure how to combine those two lines (yours and mine)

Last edited by Xeratul; 03-14-2012 at 10:23 AM.
 
Old 03-14-2012, 10:40 AM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
It works !!

Code:
ssh  user@host -p port#  arecord  -Dplughw:$CARD,0 -f cd | aplay -t wav

Thank you !!

edit: by the way, what about the Audio + Video using ffmpeg ?

Last edited by Xeratul; 03-14-2012 at 10:48 AM.
 
Old 03-14-2012, 11:16 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Quote:
Originally Posted by Xeratul View Post
It works !!

Code:
ssh  user@host -p port#  arecord  -Dplughw:$CARD,0 -f cd | aplay -t wav

Thank you !!

edit: by the way, what about the Audio + Video using ffmpeg ?
Cool.

Not sure about video, never went that far. Doesn't hurt to try though!
 
Old 03-14-2012, 12:02 PM   #7
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
How about mounting the remote mp3 folder with fuse?

Code:
sudo apt-get install sshfs
mkdir ~/fuse

sudo adduser username fuse
sudo modprobe fuse

sshfs -p port my.home.server:/share ~/fuse
To unmount:
Code:
fusermount -u ~/fuse
Regards,
Stefan
 
Old 03-14-2012, 01:58 PM   #8
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by propofol View Post
How about mounting the remote mp3 folder with fuse?

Code:
sudo apt-get install sshfs
mkdir ~/fuse

sudo adduser username fuse
sudo modprobe fuse

sshfs -p port my.home.server:/share ~/fuse
To unmount:
Code:
fusermount -u ~/fuse
Regards,
Stefan
Fuse is certainly a direction not to go ...
I reported you about SSH and alsa.

I will soon about video+audio encapsed into a simple ssh ... Working on it...
 
Old 03-14-2012, 02:06 PM   #9
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
OK. it is easy , simply pipe with ffmpeg ... And you got all into it

Code:
ffmpeg -i input.flv pipe:1 | ffplay -i -

Enjoy
 
Old 03-14-2012, 04:22 PM   #10
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
1)
you simply run this command with pipe:

Code:
 ssh   username@host -p port# -C  ffmpeg -f alsa -ac 2 -i  hw:0,0 -f video4linux2 -i /dev/video0 -f avi pipe: | ffplay -i -
alternatively you can use mplayer with
Code:
| mplayer -
I must say that ffmpeg is not worknig so well

2)
Over even better, with mencoder it is like that:
Quote:
ssh USERNAME@HOST -p PORT mencoder tv:// -tv driver=v4l2:device=/dev/video0:alsa:adevice=hw.0,0:forceaudio -ovc lavc -oac lavc -o - -really-quiet | ffplay -

Say me "Thanks"

Last edited by Xeratul; 03-14-2012 at 05:38 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stream your webcam using LINUX on a distant SSH SERVER :) frenchn00b Linux - General 3 07-03-2011 12:45 PM
while being logued on a distant box with ssh, can we send a file to the local pc? frenchn00b Linux - General 3 12-08-2009 12:09 AM
SSh on pc Distant:howto fat32 chkdsk then resize, install Debian, check the grubboot? frenchn00b Debian 0 10-29-2008 06:25 PM
WinXp: Mounting a Z: drive from a distant NFS&/OrSamba Linux server via using SSH frenchn00b Linux - Server 4 01-01-2008 09:05 AM
How can I listen to audio CDs without audio cable? calande Linux - Desktop 11 07-20-2007 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration