Log in

View Full Version : Join & resize small .avi files


Metallo
23rd August 2009, 11:56
Hi there!

I have been using the following method to join .avi movies generated by my digital camera and then resize them to DVD format.

I use VirtualDub to join the files and to re-encode them in DVD format. In order to preserve the original quality (limited but enough), I apply a black frame of 720 x 576 around the source file.

What's the problem then?

Well, every source movie out of my Canon is around 3.8 MB, if I join 6 .avi movies I get a file of approx. 23 MB, so far so good.
I enclose a screenshot of the format I join (given that .avi is only a container).

When I do the framing (by applying the resize filter) and then encode, the 23 MB become 1.6 GB approx. :eek:
See picture below.

Obviously, I do expect a bigger file, but cannot understand why so big.

Can you help me to improve my process?

I also enclose another screenshot of the final format.

Thank you!
Alex

CWR03
23rd August 2009, 13:28
When I do the framing (by applying the resize filter) and then encode, the 23 MB become 1.6 GB approx.
You're using an uncompressed output, which is naturally going to be a very large file. You could join them and use direct stream copy, then use DVD Flick to create your actual DVD disk, which will convert straight from the original file to DVD with no intermediate encoding or loss of quality, or even import them as-is to DVD Flick.

Metallo
23rd August 2009, 14:02
You're using an uncompressed output, which is naturally going to be a very large file. You could join them and use direct stream copy, then use DVD Flick to create your actual DVD disk, which will convert straight from the original file to DVD with no intermediate encoding or loss of quality, or even import them as-is to DVD Flick.

Hi,

When I join the movies I use direct stream copy, in fact the file size is only 23 MB.
I can use any authoring software, that's not the point, the files become bigger once I apply the resize frame filter.
How can I add a frame without getting a several GB file? :confused:
The frame is mandatory for me because it enables to view the clip in DVD format, preserving the original quality of 320 x 240.

Hope I managed to clarify.

Thanks
Alex

MatLz
23rd August 2009, 15:51
Metallo, you can't recode your videos in dvd "format" with virtualdub. 720x576 is a "resolution" not a "format".
For your need, use an Avisynth script:
a1=directshowsource("YOUR AVI.avi",video=false)
v1=Converttoyv12(imagesource("YOUR FRAME.bmporjpeg...", fps=YOUR AVI FPS, start=0, end=0))+avisource("yourvideo.avi", audio=false)
Audiodub(v1,a1)
Delayaudio(1/YOUR FPS)


After that, use a a dvd builder which supports avs scripts.

Metallo
23rd August 2009, 16:03
Metallo, you can't recode your videos in dvd "format" with virtualdub. 720x576 is a "resolution" not a "format".
For your need, use an Avisynth script:
a1=directshowsource("YOUR AVI.avi",video=false)
v1=Converttoyv12(imagesource("YOUR FRAME.bmporjpeg...", fps=YOUR AVI FPS, start=0, end=0))+avisource("yourvideo.avi", audio=false)
Audiodub(v1,a1)
Delayaudio(1/YOUR FPS)


After that, use a a dvd builder which supports avs scripts.

Hi,

you are right, I am sorry for the wrong terminology I used to describe the resolution.

I will try your suggestion, I know Avisynth just by name but never used it, however, I will try and see if it works.

The new file I will get after the process will have an important difference in size or just a small one?

Thank you
Alex

MatLz
23rd August 2009, 16:15
I forgot to tell you the frame you want insert must have same resolution as your Avi.

Just copy I wrote in a text file and rename it in .avs instead of .txt.
Of course change the values and directories.
For size, it's function of the length of your avi and paraméters in the dvd builder. I can't answer you.

Metallo
23rd August 2009, 16:41
I forgot to tell you the frame you want insert must have same resolution as your Avi.

Just copy I wrote in a text file and rename it in .avs instead of .txt.
Of course change the values and directories.
For size, it's function of the length of your avi and paraméters in the dvd builder. I can't answer you.

So, you mean YOUR FRAME.bmporjpeg has to be 320x240 ?
What will actually do this script? I am trying to interpret it... and understand how will it get to 720x576

It is a pity you cannot see the pictures I enclosed, they are still under pending approval and I don't know how long will it take to get them online :(

MatLz
23rd August 2009, 16:57
This script don't resize, it will be the dvd builder which will resize your video in 720x576.
This script extract the audio of your avi and store it in "a1". "v1" is your original video with the frame you want insert in the beginning, with no audio.
"Audiodub" make the output to have the audio. And "delayaudio" delays the audio cause the frame insertion.

MatLz
23rd August 2009, 17:05
Of course you can resize with Avisynth for better quality. That means the frame you want to insert can have 720x576 in input.
Someone can explain him in a better english than mine? :-)

Gavino
23rd August 2009, 18:57
MatLz, I think you have misunderstood what Metallo is trying to do (or maybe I have). By inserting a frame, I think he means adding a black border to the entire video to change the frame size, not adding a single frame at the beginning.

Metallo, try this script (replacing file1.avi, etc, by your own files):

AviSource("file1.avi", "file2.avi", ...)
AddBorders(200, 168, 200, 168)

This will convert your 320x240 source to 720x576 by adding a border. The script can be input directly to an mpeg encoder, so no need to save an intermediate video file.
You could also resize the video within the script instead of adding the border. For that, replace the AddBorders line by
LanczosResize(720, 576)

MatLz
23rd August 2009, 19:42
It seems you're right Gavino....
But I noticed a thing:
He will must have to resize to 320x256 before adding borders cause to the PAR.
So:
Lanczosresize(320,256)
Addborders(200,160,200,160)

CWR03
23rd August 2009, 22:57
I can use any authoring software, that's not the point, the files become bigger once I apply the resize frame filter.
Perhaps I didn't explain well, it's when you're adding borders that you're converting to an uncompressed format.

If you import them into DVD Flick, you don't need the intermediate encoding. It will size them properly for full-screen playback with minimal quality loss. Or are you saying you want to maintain that tiny 320x240 size in the middle of the screen surrounded by lots of black borders as viewed in your screenshot?

Metallo
24th August 2009, 09:43
Perhaps I didn't explain well, it's when you're adding borders that you're converting to an uncompressed format.

If you import them into DVD Flick, you don't need the intermediate encoding. It will size them properly for full-screen playback with minimal quality loss. Or are you saying you want to maintain that tiny 320x240 size in the middle of the screen surrounded by lots of black borders as viewed in your screenshot?

Hi,

yes, definitely, I want to maintain the 320x240 size because should I change it to 720x576 the video quality would deteriorate to unacceptable level. On the other hand, if you look at the original source specs. it is already a miracle I found this workaround :rolleyes:

Alex

CWR03
24th August 2009, 10:11
yes, definitely, I want to maintain the 320x240 size because should I change it to 720x576 the video quality would deteriorate to unacceptable level.
That's not actually what happens. The image quality is poor, you're just unable to see exactly how poor until you view it full screen. It's not deteriorating, it's revealing how it really looks, then you're just not squinting at a tiny frame on the screen. In any case, you're converting using uncompressed, but does it matter since you're going from that to DVD? You can delete your large intermediate file when you're done. You could try x264 uncompressed, which would give you a smaller intermediate file, but you will lose some quality using a lossy intermediate conversion. Uncompressed is lossless.

Metallo
24th August 2009, 11:07
That's not actually what happens. The image quality is poor, you're just unable to see exactly how poor until you view it full screen. It's not deteriorating, it's revealing how it really looks, then you're just not squinting at a tiny frame on the screen. In any case, you're converting using uncompressed, but does it matter since you're going from that to DVD? You can delete your large intermediate file when you're done. You could try x264 uncompressed, which would give you a smaller intermediate file, but you will lose some quality using a lossy intermediate conversion. Uncompressed is lossless.

I fully agree with your statement, but since I want to archive the uncompressed movies, I am trying to find a way to get a smaller file. I will try the avysinth solution and see if it works, I cannot accept that adding a frame results in a file 70 times bigger than the original source.

Ciao
Alex

CWR03
25th August 2009, 16:47
...since I want to archive the uncompressed movies, I am trying to find a way to get a smaller file.
Since they are UNCOMPRESSED, they are going to be that big. Why not just archive your original (very small) originals, which you can later use again?