how to: transcode, crop letterbox, chain vfilter

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
dach
New Cone
New Cone
Posts: 3
Joined: 04 Apr 2010 21:28

how to: transcode, crop letterbox, chain vfilter

Postby dach » 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.

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

Joe33345
Blank Cone
Blank Cone
Posts: 22
Joined: 15 Jun 2007 04:09

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

Postby Joe33345 » 04 Jul 2010 17:36

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

tokyotech
Blank Cone
Blank Cone
Posts: 12
Joined: 17 Dec 2009 08:45

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

Postby tokyotech » 11 Nov 2010 16:59

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?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 13 Nov 2010 00:23

what about vfilter=adjust{},marq{} ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 12 guests