Page 1 of 1

howto crop?

Posted: 17 Mar 2011 14:26
by fishstyc
[UPDATE] Crop seems broken since 1.1.x: check progress on ticket 3941


If I use vlc's command-line I can crop a video-file by entering something like

Code: Select all

vlc.exe video.avi --crop='20x20+10+10'
.

I don't seem to get this working when I use libvlc_media_add_option(...)

I have tried this, but since crop is a video-out-filter, I also tried stuff like

Code: Select all

vout-filter=crop{crop-geometry='20x20+10+10'} or vout-filter=crop{geometry='20x20+10+10'} or video-filter=crop
but none of them work. Does anyone know what I am doing wrong, and how I could crop using LibVLC and the add_option functions?

Thanks.

Re: howto crop?

Posted: 17 Mar 2011 16:22
by sherington
libvlc_video_set_crop_geometry

Re: howto crop?

Posted: 17 Mar 2011 23:41
by fishstyc
The question was: can I do this using libvlc_media_add_option(...)

Re: howto crop?

Posted: 18 Mar 2011 08:48
by sherington
What difference does it make? It's all just API calls.

Re: howto crop?

Posted: 18 Mar 2011 09:24
by fishstyc
That I can allow a user to add options before opening the file, without having to build a command line parser from scratch.

It already exists, why would I try to recreate the same thing myself?

(BTW I decode video frames to memory planes using libvlc_video_set_callbacks and libvlc_video_set_format, I don't know if that has an influence)

Re: howto crop?

Posted: 18 Mar 2011 09:46
by sherington
Another post in this forum suggested the following syntax:

Code: Select all

--sout="#transcode{vcodec=h264,deinterlace=1,vfilter=croppadd{cropleft=8,cropright=8},acodec=mp4a,ab=128,channels=2,samplerate=48000}:standard{access=file,dst='${1}'}
You have to change "--sout=" to ":sout=".

See viewtopic.php?f=4&t=76384

Worth a try.

Re: howto crop?

Posted: 18 Mar 2011 11:49
by fishstyc
Crop seems broken since 1.1.x:
ticket 3941

I hope it will be fixed soon... then I can try again.