LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-08-2015, 02:38 PM   #1
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Rep: Reputation: Disabled
can't access sound input from Hauppauge USB Live 2 with ffmpeg or aconv


trying to capture the sound from the device but don't know the command to load it.
dmesg,lsusb, and lsmod show the card and appropriate modules loaded
The dev shows as /dev/snd/pcmC1D0c
tvtime plays both video and sound with no problem.
I did notice that tvtime copies the sound from the above device to default.
mplayer, vlc, and ffmpeg will display the video.
what command is necessary to access the input on the above device.
I am trying to stream the output from my Dish receiver to a server on my local network. (Mythtv doesn't seem to like the card)

Lubuntu 15.04
Intel Celeron
 
Old 09-10-2015, 04:41 AM   #2
tonj
Member
 
Registered: Sep 2008
Posts: 514

Rep: Reputation: 37
1) please provide the ffmpeg command you have tried
2) with the usb device connected do # 'arecord -L' and give the output here.
 
1 members found this post helpful.
Old 09-10-2015, 10:11 AM   #3
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
This is the command I tried. I also installed the oss modules and tried that.
ffmpeg -f alsa -i hw:1,0 -f video4linux2 -s 720x480 -i /dev/video0 out.mpg
ffmpeg -f oss -i /dev/dsp -f video4linux2 -s 320x240 -i /dev/video0 out.mpg

I get video but no audio. As I had stated tvtime works great. Starting tvtime on the command line I get this;
alsa: starting copying alsa stream from hw:1,0 to default

The output from arecord -L is;
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default:CARD=Intel
HDA Intel, ALC268 Analog
Default Audio Device
sysdefault:CARD=Intel
HDA Intel, ALC268 Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
Front speakers
surround21:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
Direct sample snooping device
hw:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog
Hardware device with all software conversions
default:CARD=Cx231xxAudio
Cx231xx Audio, Conexant cx231xx Capture
Default Audio Device
sysdefault:CARD=Cx231xxAudio
Cx231xx Audio, Conexant cx231xx Capture
Default Audio Device
dmix:CARD=Cx231xxAudio,DEV=0
Cx231xx Audio, Conexant cx231xx Capture
Direct sample mixing device
dsnoop:CARD=Cx231xxAudio,DEV=0
Cx231xx Audio, Conexant cx231xx Capture
Direct sample snooping device
hw:CARD=Cx231xxAudio,DEV=0
Cx231xx Audio, Conexant cx231xx Capture
Direct hardware device without any conversions
plughw:CARD=Cx231xxAudio,DEV=0
Cx231xx Audio, Conexant cx231xx Capture
Hardware device with all software conversions
 
Old 09-10-2015, 11:03 AM   #4
tonj
Member
 
Registered: Sep 2008
Posts: 514

Rep: Reputation: 37
did you have the Hauppauge connected when you did areacord -L?
if so I'm assuming the Cx231xxAudio is the Hauppauge audio device. (please confirm)
try this:

ffmpeg -f alsa -i default:CARD=Cx231xxAudio -f video4linux2 -s 720x480 -i /dev/video0 out.mpg
if no joy try this:
ffmpeg -f alsa -i sysdefault:CARD=Cx231xxAudio -f video4linux2 -s 720x480 -i /dev/video0 out.mpg

let me know how it goes.
 
Old 09-10-2015, 02:55 PM   #5
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Yes, the card was plugged in.
Neither suggestion worked. Here is part of the command line verbosity;
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'default:CARD=Cx231xxAudio':
Duration: N/A, start: 1441910224.906750, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Input #1, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 1452.269362, bitrate: 165722 kb/s
Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x480, 165722 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc
[mpeg @ 0x160f880] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out.mpg':
Metadata:
encoder : Lavf56.15.102
Stream #0:0: Video: mpeg1video, yuv420p, 720x480, q=2-31, 200 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
Metadata:
encoder : Lavc56.13.100 mpeg1video
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Metadata:
encoder : Lavc56.13.100 mp2
Stream mapping:
Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))
Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp2 (native))
Press [q] to stop, [?] for help

Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'sysdefault:CARD=Cx231xxAudio':
Duration: N/A, start: 1441910026.823449, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Input #1, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 1254.205571, bitrate: 165722 kb/s
Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x480, 165722 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc
[mpeg @ 0x1954900] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'outa.mpg':
Metadata:
encoder : Lavf56.15.102
Stream #0:0: Video: mpeg1video, yuv420p, 720x480, q=2-31, 200 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
Metadata:
encoder : Lavc56.13.100 mpeg1video
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Metadata:
encoder : Lavc56.13.100 mp2
Stream mapping:
Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))
Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp2 (native))
Press [q] to stop, [?] for help

Records the video just fine. No sound in gnome-mplayer or ffplay
 
Old 09-10-2015, 03:03 PM   #6
tonj
Member
 
Registered: Sep 2008
Posts: 514

Rep: Reputation: 37
1) do some digging into the spec of the Hauppauge and find out what the audio device really is. I only assumed it was Cx231xxAudio, I might be wrong.
2) If you haven't already got it install v4l-utils and run 'v4l2-ctl -l', please post the output here.
3) install vlc if you don't have it and play the output in that, there's a volume control in the lower right corner. vlc is the only player I trust.
4) try a different audio source into the Hauppauge
although you've got no audio the ffmpeg command isn't throwing any errors (that I can see)

Last edited by tonj; 09-10-2015 at 03:10 PM.
 
1 members found this post helpful.
Old 09-10-2015, 03:51 PM   #7
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Here is the output from v4l2-ctl;
User Controls
brightness (int) : min=0 max=255 step=1 default=128 value=128 flags=slider
contrast (int) : min=0 max=127 step=1 default=64 value=64 flags=slider
saturation (int) : min=0 max=127 step=1 default=64 value=64 flags=slider
hue (int) : min=-128 max=127 step=1 default=0 value=0 flags=slider
volume (int) : min=0 max=65535 step=655 default=60928 value=65500 flags=slider
balance (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
bass (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
treble (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
mute (bool) : default=0 value=1
brightness (int) : min=0 max=255 step=1 default=128 value=128 flags=slider
contrast (int) : min=0 max=127 step=1 default=64 value=64 flags=slider
saturation (int) : min=0 max=127 step=1 default=64 value=64 flags=slider
hue (int) : min=-128 max=127 step=1 default=0 value=0 flags=slider
volume (int) : min=0 max=65535 step=655 default=60928 value=65500 flags=slider
balance (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
bass (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
treble (int) : min=0 max=65535 step=655 default=32768 value=32768 flags=slider
mute (bool) : default=0 value=1

There is no sound using vlc also.
I am able to capture the sound using tvtime so my sound source should be fine.
The question is; how did they do it and how can the audio and video be redirected for streaming over a local server?
 
Old 09-10-2015, 04:11 PM   #8
tonj
Member
 
Registered: Sep 2008
Posts: 514

Rep: Reputation: 37
I don't know what tvtime is, but in the meantime you still have to drill down and find out what the audio device is in the Hauppauge. What is it called ie: what's its proper name?
 
1 members found this post helpful.
Old 09-11-2015, 12:43 PM   #9
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
I got sound to work on vlc. I was selecting "analog tv" for the capture mode. I left it on camera, set video device as /dev/video, and audio device as hw:1,0. Got sound. Set the video standard to NTSC and got video playback with sound.
I set up a command line to start vlc with the necessary options. Now to set it up for streaming over my network.
If vlc will do what I need, I won't mess with ffmpeg.

Thank you very much tonj. You got me in the right direction to understand the audio input. For vlc it is
:input-slave="alsa://hw:1,0"
 
Old 09-11-2015, 12:52 PM   #10
tonj
Member
 
Registered: Sep 2008
Posts: 514

Rep: Reputation: 37
good you had a breakthrough but I'm puzzled: if vlc works with hw:1,0 then ffmpeg should too because vlc uses ffmpeg. Out of curiosity try swapping the ffmpeg command around a bit:
ffmpeg -f video4linux2 -i /dev/video0 -f alsa -i hw:1,0 -s 720x480 out.mpg
 
Old 09-11-2015, 01:33 PM   #11
crbum
LQ Newbie
 
Registered: Sep 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
That worked!!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to play sound directly from input on USB sound card, a Sound Blaster X-Fi THX JunctaJuvant Other *NIX 10 06-14-2014 03:36 AM
Hauppauge WinTV-HVR-1100 (Green/Grey image on Composite Input) jbullock Linux - Hardware 4 06-15-2013 03:16 PM
[SOLVED] Which device to use for ffmpeg sound input? Fedora 14 Doug Hutcheson Linux - Software 8 01-01-2011 07:57 PM
Hauppauge WinTV USB2 Input Stuck verdeboy2k Linux - Hardware 1 03-21-2007 02:50 PM
USB sound and SB Live pteren Linux - Hardware 0 03-24-2004 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:25 PM.

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
Open Source Consulting | Domain Registration