[FFmpeg-user] Grabbing quality from TV card

tovis mailer.tovis at freemail.hu
Mon Mar 19 13:36:01 CET 2012


REMARK: This is a secondary sent email, first seem to be spinning some
where :(

Hi!
I have reach some progress :D
Some one later suggest to use h264 codec (I think dE.) - I've decided to
give a chance. I've downloaded and compile x264 library from git (I have
several pain, because I have to get also latest yasm to compile it with
appropriate assembler, and also install Debian package autoconf). But the
result was prove this. I have using command:

$ ffmpeg -v verbose -f video4linux2 -i /dev/video0 -r 29.97 -s 640x480
-vcodec libx264 \
 -t 10 -f avi -y /tmp/test01.avi

In result I have resonable good quality of the video stream :D

Next I have tried to get sound. As it suggested in ffmpeg documentation I
have checked available options for alsa:
$ cat /proc/asound/cards
 0 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfe024000 irq 16
 1 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfdffc000 irq 19
 2 [Bt878          ]: Bt87x - Brooktree Bt878
                      Brooktree Bt878 at 0xfdbfe000, irq 20

$ cat /proc/asound/devs
  2:        : timer
  3:        : sequencer
  4: [ 0- 2]: digital audio capture
  5: [ 0- 1]: digital audio playback
  6: [ 0- 1]: digital audio capture
  7: [ 0- 0]: digital audio playback
  8: [ 0- 0]: digital audio capture
  9: [ 0- 0]: hardware dependent
 10: [ 0]   : control
 11: [ 1- 3]: digital audio playback
 12: [ 1- 0]: hardware dependent
 13: [ 1]   : control
 14: [ 2- 1]: digital audio capture
 15: [ 2- 0]: digital audio capture
 16: [ 2]   : control

I have using command for grabbing:

$ ffmpeg -v verbose -f alsa -ac 2 -i hw:0 -f video4linux2 -i /dev/video0 \
-r 29.97 -s 640x480 -vcodec libx264 \
-f avi -y test02.avi

No sound :( I have tried hw:0, hw:1 and hw:2 as input, but nothing. I have
compile latest mp3lame from sourceforge. No result. But in video stream,
mp3 track is exist (I have checked on windows using mediainfo)!?

I goes back to check v4l2 facilities. I have list available controls for
/dev/video0, using command v4l2-ctl (getting from Squeeze repository),
here is the result:

brightness (int)  : min=0 max=65535 step=256 default=32768 value=32768
contrast (int)  : min=0 max=65535 step=128 default=32768 value=32768
saturation (int)  : min=0 max=65535 step=128 default=32768 value=32768 hue
(int)  : min=0 max=65535 step=256 default=32768 value=32768
balance (int)  : min=0 max=65535 step=655 default=32768 value=32768 bass
(int)  : min=0 max=65535 step=655 default=32768 value=32768
treble (int)  : min=0 max=65535 step=655 default=32768 value=32768 mute
(bool) : default=0 value=1
chroma_agc (bool) : default=0 value=0
combfilter (bool) : default=0 value=0
automute (bool) : default=0 value=1
luma_decimation_filter (bool) : default=0 value=0
agc_crush (bool) : default=0 value=1
vcr_hack (bool) : default=0 value=0
whitecrush_upper (int)  : min=0 max=255 step=1 default=207 value=207
whitecrush_lower (int)  : min=0 max=255 step=1 default=127 value=127
uv_ratio (int)  : min=0 max=100 step=1 default=50 value=50
full_luma_range (bool) : default=0 value=0
coring (int)  : min=0 max=3 step=1 default=0 value=0

Tuner card internal sound output attached to CD input on mainboard for
onboard audio. I've goes back to "-i hw:0" and start grabbing w/o time
limit, in other console I have set mute to '0' :
$ v4l2-ctl --set-ctrl=mute=0
Sound from TV tuner is up, after several seconds, I have stopped grabbing,
when ffmpeg step out to shell sound is goes down - I have checked the sort
clipp - I've got sound :D

Happy? Not yet.
I need NO sound on the card's host box - I suppose to use it as a stream
server. The best (for me) if I could get sound from tuner card  directly,
avoid sound card. I have tried similar procedure using grabbing command:

$ ffmpeg -v verbose -f alsa -ac 2 -i hw:2 -f video4linux2 -i /dev/video0 \
-r 29.97 -s 640x480 -vcodec libx264 \
-f avi -y test02.avi

But no success. Is it possible to get sound avoid the sound card? Any
suggestion?

Sincerely
  tovis






More information about the ffmpeg-user mailing list