How to produce VCD\DVD content from a raw AVI video ?
Hello , How can I achieve this , can you send me parameters for this ? Regards _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
On Sun, Jun 29, 2008 at 5:19 PM, Akin Ocal <akin_ocal@hotmail.com> wrote:
Hello ,
How can I achieve this , can you send me parameters for this ?
A simple browse of the documentation brings up http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html -- Ken echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlb xq |dc
On Mon, Jun 30, 2008 at 4:01 AM, Ken Murray <kmurray@gmail.com> wrote:
On Sun, Jun 29, 2008 at 5:19 PM, Akin Ocal <akin_ocal@hotmail.com> wrote:
Hello ,
How can I achieve this , can you send me parameters for this ?
A simple browse of the documentation brings up http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html
One thing I found confusing about that page was that it only really mentions the expand filter in passing. The complete examples of creating DVDs down the bottom only use scale. This means that if your original videos are not in the correct (e.g. for PAL) ratio 720x576, then the picture will get pulled out of shape. Nowdays when I'm using video that's not already in the 720x576 *ratio*, I use a combination of scale and expand. For example, if I want videos from my "still" camera (640x480) to become DVD sized, I first scale to 720x480 and then expand to 720x576, effectively making the video slightly widescreen-ish. Though, as my DVD player doesn't show all of the 720x576 screen anyhow, I sometimes scale less (or not at all), and expand more. This is only for "home videos", and hence "perfection" is not required.
Hi. Le tridi 13 messidor, an CCXVI, Ross Clement a écrit :
One thing I found confusing about that page was that it only really mentions the expand filter in passing. The complete examples of creating DVDs down the bottom only use scale. This means that if your original videos are not in the correct (e.g. for PAL) ratio 720x576, then the picture will get pulled out of shape. Nowdays when I'm using video that's not already in the 720x576 *ratio*, I use a combination of scale and expand. For example, if I want videos from my "still" camera (640x480) to become DVD sized, I first scale to 720x480 and then expand to 720x576, effectively making the video slightly widescreen-ish. Though, as my DVD player doesn't show all of the 720x576 screen anyhow, I sometimes scale less (or not at all), and expand more. This is only for "home videos", and hence "perfection" is not required.
On the general principle, you are right: people should be aware of the need for the expand filter to adjust the aspect ratio. But in the particular case you are taking as example, you are totally wrong. You work under the false assumption that de ratio between the width and the height of the video in pixel is the same as the ratio between the width and the height of the video in physical units when it is (correctly) played. That is not true. That assumption is mostly true for nowadays screens and resolutions: they have square pixels, although it was not always the case (some fifteen years ago, on 4/3 screens, 320×200, 640×400, 640×350 and 640×200 were quite common). The same is probably true also for your camera. But most video containers have a field to specify the desired display aspect ratio. If this aspect ratio does not match the actual pixel aspect ratio of the screen, players are supposed to prescale the video to adjust for it. For example, when you play a DVD with mplayer, you can read: Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0xba2230]720x576 -> 768x576 A lot of players are bogus, and do not honor this field; thus, a lot of video randomly lying around are set up for square pixels, so that they will display correctly in most cases. In the particular case of a PAL DVD, the resolution must be 720×576 (although a few other lower resolutions are possible, almost nobody uses them), but the display aspect ratio must be either 4/3 or 16/9. In your particular case, your camera uses the 4/3 aspect ratio, so there is no need for expand. In fact, if you expand as you said, the resulting image will be horizontally stretched and vertically squished in a 16/15 ratio. This is almost unnoticeable, but this is not correct. The arithmetic to do everything properly is quite confusing. I think it is possible to let mplayer do it by using the correct combination of dsize and scale filters, but I did not manage to do it yet. Regards, -- Nicolas George
I see. That explains some general weirdness that I blamed on my DVD player. I'll look further into dsize and scale filters. And revise the mencoder documentation page given before. On 6/30/08, Nicolas George <nicolas.george@normalesup.org> wrote:
Hi.
Le tridi 13 messidor, an CCXVI, Ross Clement a écrit :
One thing I found confusing about that page was that it only really mentions the expand filter in passing. The complete examples of creating DVDs down the bottom only use scale. This means that if your original videos are not in the correct (e.g. for PAL) ratio 720x576, then the picture will get pulled out of shape. Nowdays when I'm using video that's not already in the 720x576 *ratio*, I use a combination of scale and expand. For example, if I want videos from my "still" camera (640x480) to become DVD sized, I first scale to 720x480 and then expand to 720x576, effectively making the video slightly widescreen-ish. Though, as my DVD player doesn't show all of the 720x576 screen anyhow, I sometimes scale less (or not at all), and expand more. This is only for "home videos", and hence "perfection" is not required.
On the general principle, you are right: people should be aware of the need for the expand filter to adjust the aspect ratio.
But in the particular case you are taking as example, you are totally wrong.
You work under the false assumption that de ratio between the width and the height of the video in pixel is the same as the ratio between the width and the height of the video in physical units when it is (correctly) played. That is not true.
That assumption is mostly true for nowadays screens and resolutions: they have square pixels, although it was not always the case (some fifteen years ago, on 4/3 screens, 320×200, 640×400, 640×350 and 640×200 were quite common). The same is probably true also for your camera.
But most video containers have a field to specify the desired display aspect ratio. If this aspect ratio does not match the actual pixel aspect ratio of the screen, players are supposed to prescale the video to adjust for it. For example, when you play a DVD with mplayer, you can read:
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0xba2230]720x576 -> 768x576
A lot of players are bogus, and do not honor this field; thus, a lot of video randomly lying around are set up for square pixels, so that they will display correctly in most cases.
In the particular case of a PAL DVD, the resolution must be 720×576 (although a few other lower resolutions are possible, almost nobody uses them), but the display aspect ratio must be either 4/3 or 16/9.
In your particular case, your camera uses the 4/3 aspect ratio, so there is no need for expand. In fact, if you expand as you said, the resulting image will be horizontally stretched and vertically squished in a 16/15 ratio. This is almost unnoticeable, but this is not correct.
The arithmetic to do everything properly is quite confusing. I think it is possible to let mplayer do it by using the correct combination of dsize and scale filters, but I did not manage to do it yet.
Regards,
-- Nicolas George
OK, I've created a video slideshow in Kino. It's 720x576 pixels. But I know that if I convert to mpeg and play it through my DVD player, I'll lose the sides of the images. When I play this DV file (as exported) in mplayer on the computer, it reports that the aspect ratio is 1.37:1 and that it's scaling to 786x576 to correct for it.(All this is from memory, but I think it's correct). How could I modify the aspect ratio when I convert to mpeg2 so that it doesn't stretch the image and lose the sides?
Le quartidi 14 messidor, an CCXVI, Ross Clement a écrit :
When I play this DV file (as exported) in mplayer on the computer, it reports that the aspect ratio is 1.37:1 and that it's scaling to 786x576 to correct for it.(All this is from memory, but I think it's correct).
You should copy-paste exactly the output, to avoid mistakes.
How could I modify the aspect ratio when I convert to mpeg2 so that it doesn't stretch the image and lose the sides?
I will take a slightly more generic example, where all fractions do not simplify. First of all, the actual resolution of the source content does not matter, only its intended aspect ratio. For example, if the pixels are squares, 320×240 and 640×480 are perfectly equivalent for the following calculations. Let us assume that the display aspect ratio of your content is 3/2 (this is the standard aspect ratio for paper photos). Let us assume that you want to play it on a wide-screen TV, and thus choose a 16/9 DVD. Let us assume that you have determined the size of the viewable area in this configuration (probably by encoding a test pattern): 684×544. First, let us compute the pixel aspect ratio of a 16/9 PAL DVD, because that is the number that does not change when you crop tie image. The number 16/9 tells us that for some arbitrary unit, the size of the displayed image is 16 units wide times 9 units high. The actual value of the unit depends on the size of the screen, but it does not matter, only the ratio matters. Knowing that, we can compute the size of one pixel. Its width is 16 units divided by 720 pixels, thus 16/720 units. For the same reason, the height of one pixel is 9/576 units. Finally, we can compute the display aspect ratio of one pixel, which is its width divided by its height: (16/720) / (9/576) = (16/9) / (720/576), which gives us 64/45, or approximatively 1.422. I suggest PARI/GP as a simple calculator which handles fractions nicely. Now, we must determine the pixel size for a 3/2 content. We do not know whether the limiting factor will be the width or the height, so we try both, and take the smallest. First, let us try to fit the image in width. The width is therefore 684 pixels, we already know it. We also know that, for some unit (not the same as before, and much smaller), the width of one pixel is 64, and its height is 45. Therefore, in this unit, the width of the content is 684×64. Its height must therefore be: 684×64 / (3/2). And to know the size in pixels, we divide by 45: 684 × (64/45) / (3/2) = 648.53 approximatively. The height must therefore be 649 pixels, which is bigger than 544. The limiting factor is the height. So let us try to fit the image in height. The height is 544, let us compute the width. The height in small physical units is 544×45, so the width must be 544×45 × (3/2). To get the width in pixels, we divide by 64: 544 × (45/64) × (3/2) = 544 × (3/2) / (64/45) = 573.75. The width must be 574 pixels, which fits in our 684. Please note that I always tried to write the aspect ratios exactly as we know them: 3/2, 64/45. The same calculation would work if we took approximate values. For example, 3/2 = 1.5. One must just remember that 1.5 means 1.5/1. Another point: we know that the aspect ratio of the content we want to display is 3/2 = 1.5, and we want to display on something whose aspect ratio is 16/9 = 1.78 approximatively. Since 1.78 > 1.5, the screen is wider than the content, so we could have guessed that the limiting length would be the height. The aspect ratio of the viewable area is not exactly 16/9, but the difference is small, not enough to reach 1.5. We can make the exact computation: the physical width of the viewable area is 684×64, and its height is 544×45, so the aspect ratio is (684×64) / (544×45) = (684/544) × (64/45) = 152/85, or approximatively 1.79. Now, we know that we must scale our content to 574×544, and then add 720-574 = 146 black pixels on the left and right borders, and 576-544 = 32 black pixels on the top and bottom. There is a last, small point to decide: how much on the left, how much on the right? The black pixels we have to add can be split in two parts: first we add some black pixels to totally fill the viewable area, and then we add black pixels to pad the viewable area in the total area. For the first part, we probably want the content centered on the visible area. Our content is 574 pixels wide, the viewable area is 684, we need 110 pixels: 55 on each side. Vertically, the fit is perfect: 0 pixels. For the second part, we have no choice, that is determined by the hardware. Hopefully, we measured that back when we measured the size of the viewable area. Let us assume that we lose 21 pixels on the left, 15 on the right, 18 on the top and 14 on the bottom. The total is therefore: 55+21 pixels on the left, 55+15 pixels on the right, 0+18 pixels on the top, 0+14 pixels on the bottom. (Note: I have been quite lengthy in this message, more than necessary, in order to make it possible to quote it in a tutorial or as answer to a similar question. I have no objection to have this text copied anywhere.) (Note to Ross: in the previous message you top-posted. If you do it again, you will make enemies on this list: avoid it. And if you do not know what top-posting is, use Google or Wikipedia.) Regards, -- Nicolas George
participants (4)
-
Akin Ocal -
Ken Murray -
Nicolas George -
Ross Clement