# stream source
device=/dev/video1
norm=ntsc
capture_height=720
capture_width=480
bitrate=4000000
maxbitrate=8000000
# transcoding
width=448
height=336
fps=25
vcodec=h264
vbitrate=256
acodec=mp4a
abitrate=96
achannels=1
# streaming
access=http
mux=asf
bindaddress=
port=8080
vlc -vv --intf rc pvr:$device:norm=$norm:height=$capture_height:width=$capture_width:bitrate=$bitrate:maxbitrate=$maxbitrate \
--sout "#transcode{fps=$fps,width=$width,height=$height,vcodec=$vcodec,vb=$vbitrate,scale=1,acodec=$acodec,ab=$abitrate,channels=$achannels,cropleft=20,cropbottom=6,cropright=4,croptop=6,deinterlace}:duplicate{dst=std{access=$access,mux=$mux,dst=$bindaddress:$port}}"
I just have this config in a script so I can easily start it. This setups VLC to listen on port 8080 for HTTP.
Popular codecs prefer the height and width to be factors of 16. Of course you also want to maintain the aspect ratio.
for (my $w = 16; $w <= 1920; $w+=16) {
my $h = $w / (16/9);
print "$w x $h\n" if ($h % 16 == 0);
}
| 4:3 | 16:9 |
|---|---|
|
320 x 240 384 x 288 448 x 336 512 x 384 576 x 432 640 x 480 704 x 528 768 x 576 832 x 624 896 x 672 960 x 720 |
256 x 144 512 x 288 768 x 432 1024 x 576 1280 x 720 1536 x 864 |