Feb 23

I got a TV card, it appears like this in lspci:


01:08.0 Multimedia controller: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decoder (rev d1)


In order to stream 3 simultaneous streams, very low, low and high quality, you can do this:


#!/bin/ksh
#
/sbin/modprobe saa7134-alsa
sleep 2

DEV=/dev/tvcard
ps -ef | grep -i vlc | grep -v grep |grep -i $DEV | awk '{ print $2 }'| while read P;do
kill -9 $P
done
VBR=96
ABR=24
W=320
H=240

### --deinterlace-mode {discard,blend,mean,bob,linear} : deinterlacing mode (default: discard)
#  width=320,height=240  qpmax=40 x264{crf=5,profile=extended,level=1.0}
# :standard{access=http{user=video,pwd=cable},mux=asf,dst=0.0.0.0:8088}
# venc=x264{level=2,nr=1000,me=tesa,b-pyramid,bitrate=64,ref=4,b-adapt=2,bframes=2,partitions=all,keyint=2500}

VLC="/usr/local/bin/cvlc --logo-file /disk2/logox.png v4l2://$DEV :input=2 :standard=8 :input-slave=alsa://hw:1
,0 --alsa-samplerate=32000 --deinterlace-mode linear --sout "

VERYLOW="transcode{vcodec=h264,acodec=mp4a,channels=1,width=160,height=120,vb=24,ab=16,venc=x264{bframes=0,leve
l=5,nr=1000,b-pyramid,b-adapt=2,hurry-up},audio-sync,sfilter=logo}:standard{access=http,dst=0.0.0.0:8011/stream
.flv}"

LOW="transcode{vcodec=h264,acodec=mp4a,channels=1,width=${W},height=${H},vb=${VBR},ab=${ABR},venc=x264{bframes=
0,level=5,nr=1000,b-pyramid,b-adapt=2},audio-sync,sfilter=logo}:standard{access=http,dst=0.0.0.0:8012/stream.fl
v}"

HIGH="transcode{vcodec=h264,acodec=mp4a,channels=2,ab=128,venc=x264{bframes=0,level=5,nr=1000,b-pyramid,b-adapt
=2,hurry-up},deinterlace,audio-sync,sfilter=logo}:standard{access=http,dst=0.0.0.0:8013/stream.flv}"

/usr/local/bin/v4l2-ctl -d $DEV --set-tuner=stereo
/usr/local/bin/v4l2-ctl -d $DEV --set-standard=0
/usr/local/bin/ivtv-tune -d $DEV -t us-cable -c3

#--- audio codecs can be mpga or mp3 or m4a
#--- mux can be ogg,ts,mp4,asf,ps,mpeg1,asfh,mpjpeg

#--- low quality
#$VLC "#$VERYLOW"

#--- low quality
#$VLC "#$LOW"

#--- LAN quality
#$VLC "#$HIGH"

#---- single command, high quality AND low quality using h264_vdpau and x264 as encoder
$VLC "#duplicate{dst=\"$VERYLOW\",dst=\"$LOW\",dst=\"$HIGH\"}"
#$VLC "#duplicate{dst=\"$VERYLOW\",dst=\"$HIGH\"}"
#$VLC "#duplicate{dst=\"$LOW\",dst=\"$HIGH\"}"
#$VLC "#duplicate{dst=\"$VERYLOW\",dst=\"$LOW\"}"


"#duplicate" is used in order to have 2 streams working simultaneously from the same input device, for each output srteam we use a "dst="

Posted by rdircio

| Top Exits (0)
Vote for articles fresher than 7 days!
Current karma: none, 0 vote(s) 442 hits
Feb 17
Linux

I wanted to watch my movies remotely, so i used h264 for video and aac for audio, and built a vlc config to startup a daemonized RTSP server.I built a script to create the config file by scanning all my videos, and then start the vlc daemon :). Here it is:


#!/bin/ksh
ps -ef | grep -i vlc | grep -v grep |awk '{ print $2 }' |while read p;do
        kill $p
done
(
x=0
find /disk2/VIDEO -type f | egrep -i 'avi|mpg' |while read v;do
#---- if not using x264
# echo "new $x vod enabled"
# echo -n "setup $x input \"file://$v\" output"
#---- if using x264
echo "new $x vod"
echo -n "setup $x input \"file://$v\" enabled output"
#---- low quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,width=640,height=480,fps=12,vb=128,ab=8}"
echo " #transcode{vcodec=h264,acodec=mp4a,width=640,height=480,vb=100,ab=4}"
#---- mid quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,scale=.5,fps=10,vb=256,ab=64}"
#echo " #transcode{vcodec=h264,acodec=mp4a,scale=.5,fps=12,vb=256,ab=64}"
#---- high quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,scale=.5,fps=10,vb=512,ab=64}"
#echo " #transcode{vcodec=h264,acodec=mp4a,scale=.5,fps=12,vb=512,ab=128}"
echo " "
x=$(($x+1))
done
) > /etc/v.config
nohup cvlc --vlm-conf /etc/v.config -I telnet --telnet-password vl --rtsp-host 0.0.0.0:564 &


Try it, and enjoy :)

Posted by rdircio

| Top Exits (0)
Vote for articles fresher than 7 days!
Current karma: none, 0 vote(s) 737 hits
Feb 9

My disk is pgp encrypted so i can't mount it and image it from outside, if i image it from inside, when i restore it i'll need to add pgp again.


So i booted off backtrack 4 in a usb disk, used old dd to image my drive, compress it and dump it to a nfs mounted directory.


dd if=/dev/sda | gzip -c -9 > /a/disk.iso.gz


If i ever want to restore it i'll do


gunzip -cd /a/disk.iso.gz  | dd of=/dev/sda

Posted by rdircio

| Top Exits (59)
Vote for articles fresher than 7 days!
Current karma: none, 0 vote(s) 164 hits

(Page 1 of 2, totaling 6 entries)