Bug on size of Snapshot

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Bug on size of Snapshot

Postby Omega56 » 04 Aug 2009 21:07

1) I believe I've just found a bug on size of Snapshot. To reproduce the bug:
* open a VOB file (MPGEG2 movie)
* ajust the format to 5:4 (let 720:576 for Europe)
* the full screen is 720:576, but the part without the upper and the lower black part may (for ex.) 720:424 (more or less)
* ask a snapshot in jpg format
* the snapshot format is 720:576 : OK! but the part without the black parts is 720:450 !

The error is the ratio 1.0666 = (4/3)/(5/4). We may suggest an error made by the jpg encoder, "mixing" good and bad ratios. I say the jpeg encoder because the total sizes (720:576) remains OK.

Do you agree?
If OK, can you correct this, pls?

2) By the way, the jpeg snapshot from the ratio 5/4 gives good black parts to be cropped: the black is &H0000 0100. Good and constant. But if we change the ratio to 1:1 these black parts are a bit noisy: several low values and not constant : &H0000 0100 and &H0000 0000 and &H0000 0101 and ...
I'm not that a good result from the jpeg encoder.
Can you check and correct this ?

To say all, I need jpeg picture to perform automatic cropping from a software of myself.

Regards,

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Bug on size of Snapshot

Postby erwan10 » 06 Aug 2009 10:41

What do you mean "ajust the format to 5:4" ?

You don't need to adjust format. Everything is taken care of automatically. 720x576 images come with a sar parameter that tells vlc how to stretch it in order to retrieve the original aspect ratio.

Also, as it is done today, snapshots are always taken from source image (cropping is not taken into account).

If you need to crop or more generally alter the images and store the resulting snapshots, the scene video_filter should be your friend.


Erwan10

Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Re: Bug on size of Snapshot

Postby Omega56 » 07 Aug 2009 11:43

Hi Erwan10,

Let me answer in your kind answer below.

What do you mean "ajust the format to 5:4" ?

I must adjust to 5:4 to get the original sizes (remember 720:576 is 5:4). On the snapshot, I need to find the correct size for the cropping.

You don't need to adjust format.

You're right if you want to see the movie, but this 5:4 is to get the snapshot with original sizes (720:576).

720x576 images come with a sar parameter that tells vlc how to stretch it in order to retrieve the original aspect ratio.

These parameters could be 4:3 or 16:9 for these very classical MPEG2 DVD format (and not the 5:4). So, of course, I admit the VLC viewer stretch the picture. I agree this point.

Also, as it is done today, snapshots are always taken from source image (cropping is not taken into account).

Correct. I saw this point.
But something is wrong somewhere :
* the viewer gives 720:576 and a crop to 720:424
* the snapshot gives 720:576 and a crop to 720:450
With the same 720:576, I've should get the same cropping because no stretching (neither 4:3, nor 16:9 and nor anything else).
Then I suspect a bug in the jpg procedure (something confuse giving a a-typical ratio of 1.06666...).

If you need to crop or more generally alter the images and store the resulting snapshots, the scene video_filter should be your friend.

Let me see... Have you got a way (a better procedure or a filter) able to give me the result of the cropping please?
To sum up, I need the information as "crop to 720:xxx on this DVD":
* I've tried by the VLC ActiveX and I failed.
* And by a jpg snapshot, I've just conclude "OK, but if you read xxx=450, you must understand 724:424". Why not, but it's strange.

Rgds

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Bug on size of Snapshot

Postby erwan10 » 07 Aug 2009 18:32

Okay, I gave it a try on the latest vlc1.0.2-git ... but my results are a bit different

With a simple .vob file (720x576 16:9 with black borders)

command => vlc --aspect-ratio="5:4" file.vob

Result is as expected (both playback and snapshot are 720x576 and black borders are exactly the same size)

With a dvd (same characteristics)

command => vlc --aspect-ratio="5:4" dvd:// doesn't work. :(

The result is still a 1024x576 snapshot (you would expect a 720x576 size) , and you're right about discrepancies in black borders between what is seen on the screen (playback) and what is stored as a snapshot.

seems a dvd which is made of subitems of different aspect ratio (a header 720x576 4:3 then a film 720x576 16:9) doesn't cope that well with the --aspect-ratio parameter.

Erwan10

Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Re: Bug on size of Snapshot

Postby Omega56 » 07 Aug 2009 19:18

Hi erwan10,

Thanks for your tests.

Some comments about them :
* I've set the aspect-ratio via the GUI
* and with a VOB file
* but nothing from a DVD at this time
* if you can't get the 5:4 ratio, the 1024:576 is perfect ; but with that, my tests keep the same curious behaviour for the black borders

By the way, I made the crop with the VLC GUI : I found 720:426 (instead of 720:424 checked from a file made by a MPEG4 encoder). Not to bad. This confirmed that the crop from the snapshot (720:450) is false (I suspect a multiplication by 1.0666 = (4/3)/(5/4) via the jpg encoder of the snapshoter).

So, whatever the situation is, can you help me please:
* why the "--autocrop" can't work?
* have you got a simpler idea to get automaticaly the ideal crop values from VOB file?

(At this time, I can read a snapshot and find automatically the black part, and this is a bit heavy.)

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Bug on size of Snapshot

Postby erwan10 » 07 Aug 2009 21:10

Hi,

The following command line works on Linux with vlc1.0 (tested) and should also work for other platforms.

command => vlc file.vob --vout-filter="crop" --autocrop

The video starts with black borders and then resizes without black borders within 1 second.


As for your tests, no conclusions but a few remarks :

- The black borders you're talking about are part of the 720x576 video. A snapshot doesn't treat them as a separate entity. There is no reason for them to be different from the playback with default setting, or even if you force another aspect-ratio.

- vlc has got two different ways to crop videos :
- a basic crop parameter at the core level (--crop parameter or 'c' hotkey)
- a crop video filter with numerous options. (partially available through the advanced tabs in GUI)

- The basic crop parameter has no effect on snapshot. That means you can end up with discrepancies between playback and snapshot if you use it.

- I don't know much about the crop video filter with regard to snapshots.

Hope that helps!

Erwan10

Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Re: Bug on size of Snapshot

Postby Omega56 » 08 Aug 2009 19:17

Thank you erwan10,

That's exactly the kind of information I need!

For Windows, I need to add --aspect-ratio= 5:4 :
--aspect-ratio="5:4" --width = 720 --vout-filter="crop" --autocrop
(if not, no cropping) and after to set manually in the GUI the aspect ratio to auto (if not, the picture is cropped but with an actual 5:4 ratio).

Well, I'd like to set this in a pgm via VLC ActiveX. Curiously, the vout-filter = "crop" and autocrop stay silencers:
mvarVideoOption = Array(strSound, "vout-filter = ""crop"" ", "autocrop", "aspect-ratio= 5:4")

Can I get a crop via an ActiveX please?
It should be, but something is wrong in my pgm.

Or can I get automatically cropping values?

Regards,

Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Re: Bug on size of Snapshot

Postby Omega56 » 08 Aug 2009 19:21

Hello!
it's me again : the VLC ActiveX sends the answser : "unsafe option "autocrop" has been ignored for security reasons.
How hell to overtake this please?

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Bug on size of Snapshot

Postby erwan10 » 08 Aug 2009 20:39

Yes, these security measures are often very frustrating !

There is no workaround ... but to send a request for autocrop to be removed from the unsafe list !

Erwan10

Omega56
Blank Cone
Blank Cone
Posts: 11
Joined: 11 May 2009 20:09

Re: Bug on size of Snapshot

Postby Omega56 » 09 Aug 2009 19:03

Hi,
Well ! The way with VLC ActiveX is a bit hard (snapshot, jpg file and APIs to read the picture).
Can we imagine something else to get the cropping value, CLI or others?
Thanks.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 16 guests