Log in

View Full Version : Crop Preview PyGtk App


Major_Kong
9th September 2009, 16:09
Don't know if it will very useful to anyone but me... but i cobbled up a very simple PyGtk App to help me with cropping, that let's you change the crop values "on the fly". Apart from the python libraries the app only needs mplayer.

http://h.imagehost.org/t/0599/screen.jpg (http://h.imagehost.org/view/0599/screen)


Installing:
Just unzip the contents of croppreview.zip;
Give "croppreview.py" execution permission either by using your file manager or by typing in the console "chmod +x croppreview.py";
Type in the terminal ./croppreview.py or just double click on the croppreview.py file

Notes:
I'm not a python programmer, so don't expect much;
There's no seeking;
Pause/Play sometimes fails;
Did i mention that i cobbled up the app ?;
If you give it a file mplayer can't open the app borks;
This is my first python app, so once again don't expect much.


http://rapidshare.com/files/277875472/croppreview.zip.html

EDIT: Made a few changes, nothing major, just some tweaks. To install and run, unzip pycrop.zip and run the bash script (pycrop.sh).
And i think i'll leave it like this. Can't really think of any features to add... and to really perfect the app i suspect another approach would have to be used.

microchip8
10th September 2009, 10:04
You can already preview crop area with mplayer itself, if you use -vf rectangle with the crop values. How is this different?

Major_Kong
10th September 2009, 13:14
You can already preview crop area with mplayer itself, if you use -vf rectangle with the crop values. How is this different?

There's a way to change crop values while just running mplayer ?

microchip8
10th September 2009, 13:20
There's a way to change crop values while just running mplayer ?

Not afaik, but from your description I gathered it just displays the crop area and that's all which is really the same as running mplayer with rectangle

(though in a bash script it can be done with a while loop, though this is not changing crop values while mplayer runs but asking for new ones and previewing and doing so until satisfied)

Major_Kong
10th September 2009, 13:50
Not afaik, but from your description I gathered it just displays the crop area and that's all which is really the same as running mplayer with rectangle

(though in a bash script it can be done with a while loop, though this is not changing crop values while mplayer runs but asking for new ones and previewing and doing so until satisfied)

Hmm... i'll add some more notes to the description.

(it can also be done in a more 'elegant' fashion by using mplayer's -input file=<filename> switch and a pipe, which is what the app relies on, but that's not 'just running mplayer')

Major_Kong
13th September 2009, 15:54
Any feedback ?

microchip8
13th September 2009, 16:09
:) not very useful to me personally, but for others it may be

Note; this is not to discourage you or something

Major_Kong
13th September 2009, 21:11
Don't worry, i'm not deluded to the point of thinking that something i cobbled up in a hurry, would make a script guy (or a large number of people for that matter) use a crop previewing gui. ;)

But did you try the app ?

microchip8
14th September 2009, 12:22
Yes I did :) but like I said, not very useful for me

Major_Kong
15th September 2009, 21:52
On a related note, you may have noticed that when adjusting the size of the rectangle the video will unpause and pause again. This is the mplayer behaviour when opening it with -slave -idle and -input filename=<PIPE> and sending thru the pipe first a pause command and then a change rectangle size command, is there a way to make mplayer keep the video paused ?

Major_Kong
25th September 2009, 22:35
On a related note, you may have noticed that when adjusting the size of the rectangle the video will unpause and pause again. This is the mplayer behaviour when opening it with -slave -idle and -input filename=<PIPE> and sending thru the pipe first a pause command and then a change rectangle size command, is there a way to make mplayer keep the video paused ?

Couldn't find any mplayer command or setting to solve this problem, so i'll leave it like this.


PS: Made a few changes to the app, just some tweaks mostly.