how to: transcode, crop letterbox, chain vfilter
Posted: 04 Apr 2010 22:15
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.
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
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}
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