Page 1 of 1
To let to set autocrop and crop-geometry per playlist item
Posted: 10 Jul 2006 12:25
by Lurker
Investigating why I can't set "crop-geometry" parameter for a playlist item eithe via the command line, or via m3u playlist, I've found out that this and "autocrop" parameters are handled so that they use only the global settings, from config file or via command line global options (starting from --).
But I need to set them in a m3u list of TV via Internet channels, different values for each channel. I hope other people might find such a feature useful!
Posted: 10 Jul 2006 15:26
by Lurker
It looks like quite easy change. In the modules/crop.c, function Init(), instead of:
Code: Select all
/* Shall we use autocrop ? */
p_vout->p_sys->b_autocrop = config_GetInt( p_vout, "autocrop" );
/* Get geometry value from the user */
psz_var = config_GetPsz( p_vout, "crop-geometry" );
I wrote
Code: Select all
/* Shall we use autocrop ? */
p_vout->p_sys->b_autocrop = var_CreateGetBool(p_vout,"autocrop");
/* Get geometry value from the user */
psz_var = var_CreateGetString( p_vout, "crop-geometry" );
if ( psz_var && psz_var[0]==0 )
{
free(psz_var);
psz_var = NULL;
}
and it works as expected! I've made a check for an empty string for compatibility with the old code, because it handles an empty string and a NULL different way, while in this code they mean the same. Well, I could miss something...
Posted: 10 Jul 2006 15:34
by Lurker
OK, not exactly as expected: it looks for the new parameters only if a new window is created for video. If a new stream can be played in the existing window, it does not work...
All in all I'm not a developer. I hope a developer knows the internals better.
Posted: 10 Jul 2006 21:40
by dionoea
Note that VLC now has another crop feature which is embeded in the video output system (ie not a filter). You can set the crop ratio using the
option. Preset cropping options can be changed on the fly durring playback (in the video menu). Using the developement version of VLC, you can add custom crop settings to this list of presets, and fine tune cropping using the alt-[shift-](i|j|k|l) key combos. This new (it was introduced in VLC 0.8.4 i think) crop system is far more efficient than the old crop filter. The last thing it needs is some kind of autocrop feature ... but you can do without it using the key combos.
Posted: 10 Jul 2006 21:44
by dionoea
Note that VLC 0.8.5 only supports aspect ratio type strings for the --crop option (ie <width>:<height>) while the developement version also supports the <weight>x<height>+<top>+<left> syntax (like the old crop video output filter) and the <left>+<top>+<right>+<bottom> syntax.
Posted: 10 Jul 2006 21:46
by Lurker
I don't care about "crop" option, I say only about "crop-geometry", from the "crop" video filter. For me it is far more convenient to crop distorted parts of the streaming video using crop-geometry, and then, using RC, choose from aspect ration-like crop parameters e.g. to see a wide screen movie on my wide screen monitor.
Posted: 10 Jul 2006 21:51
by dionoea
Did you read what i just said ? that the old crop filter is outdated ?
And if you were so inteligent, you'd know about the
ption=value syntax which just happens to work with --crop. But i won't explain how that works since it's not what you're looking for.
Posted: 10 Jul 2006 21:56
by Lurker
OK, which build can I use to check how the new implementation of crop works?
Posted: 10 Jul 2006 22:31
by dionoea
As stated in a previous reply, you can try starting with 0.8.5 (since it's aspect ratio syntax only, it'll only crop left/right or top/bottom symetrically) or the developement version if you want to fine tune more. To include it in a m3u file you can use the option with
preceding every file which needs cropping.