Page 1 of 1

how to: transcode, crop letterbox, chain vfilter

Posted: 04 Apr 2010 22:15
by dach
There is a serious lack documentation, especially working examples, out there for vlc 1.0. All the old transcoding code samples for vlc .8.6 no longer work.

My goal:
Video input: 720x480 4:3AR
Video output: 720x386 16:9AR (shift down 8 lines)

I was very annoyed that after I finally figured out how to do this in vlc.8.6, only to be so happy with vlc that I upgraded it to 1.0.5, only to find very different, not backward compatible (that I know of), and not much documentation. After much googling and a bit of code diving, here is my working solution:

1) From vlc menu: Media>Streaming...
2) Add... your video input file
3) click [Stream] button
4) click [Options] bar at bottom of dialog

5) paste following [Generated stream output string] edit box.

Code: Select all

:sout=#transcode{vcodec=mp4v,vb=2048,scale=1,acodec=mp4a,ab=192,channels=2,samplerate=44100,vfilter={croppadd{cropbottom=8,paddtop=8}: canvas{no-padd,height=480,width=720,aspect=16:9}}}:std{access=file,mux=mp4,dst=D:\\vids\\vlc.mpg}
6) click [Stream]


Of note, this chains 2 vfilters: croppadd, canvas. There is a bug and bad documentation that says chained filters are separated by comma (,). False. Chained filters are separated by colon (:). And there must be a space following the colon. The vfilter parsing incorrectly skips the first character after the colon.

To whomever owns the code,
transcode.c (603) calls config_ChainCreate() to parse vfilter params (afilter has the same issue)
src/config/chain.c (237) config_ChainCreate() expects ':' delin

Re: how to: transcode, crop letterbox, chain vfilter

Posted: 04 Jul 2010 17:36
by Joe33345
thank you so much, after following your code and instructions, I used it to construct my own RTP code for use with the JTVLC API for justin tv.

:sout=#transcode{venc=x264

{keyint=128,idrint=2,cabac=0,bframes=0},vcodec=h264,vb=500,fps=30,acodec=mp3,ab=128,channels=2,samplerate=44100,audio-

sync,vfilter={croppadd{croptop=4,cropleft=8,cropright=10}: deinterlace{no-padd,width=640,height=480,aspect=4:3}}}:rtp

{dst=127.0.0.1,port=1234,sdp=file:///C:\vlc.sdp} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

thats for my capture device the easycap, for casting with justin tv ^_^. thank you

Re: how to: transcode, crop letterbox, chain vfilter

Posted: 11 Nov 2010 16:59
by tokyotech
So, I see you figured out how to chain your particular filters, but I'm still having trouble with mine. I'm using VLC 1.0.5 and can't chain adjust and marquee. When I attempt to do the following, neither of the effects shows up:

Code: Select all

#transcode{vfilter={adjust{saturation=0.0,contrast=1.05}: marq{marquee="$N$_$T$_$D", position=5, size=14, opacity=255}},vb=800,height=540,venc=x264{},vcodec=h264,acodec=mp3,ab=96,channels=2,threads=4}:duplicate{dst=standard{access=http,mux=asf,dst=localhost:1234}}
It only works if I do one at a time, without the { } around the vfilter argument:

Code: Select all

#transcode{vfilter=adjust{saturation=0.0,contrast=1.05},vb=800,height=540,venc=x264{},vcodec=h264,acodec=mp3,ab=96,channels=2,threads=4}:duplicate{dst=standard{access=http,mux=asf,dst=localhost:1234}}
Any ideas?

Re: how to: transcode, crop letterbox, chain vfilter

Posted: 13 Nov 2010 00:23
by Jean-Baptiste Kempf
what about vfilter=adjust{},marq{} ?