Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Reduce size of avi movie
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Sat Sep 23, 2006 5:22 pm    Post subject: [SOLVED] Reduce size of avi movie Reply with quote

With a camera I produced an avi movie. 19 seconds long and 13 MB in size.
I think that is a little too much for such a short movie. How can I make it smaller for putting on the internet?


Last edited by oldefortran on Mon Sep 25, 2006 12:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
guduri
Apprentice
Apprentice


Joined: 04 Apr 2005
Posts: 230
Location: Ann Arbor, Michigan

PostPosted: Sat Sep 23, 2006 5:53 pm    Post subject: Reply with quote

The file you extracted from the camera is most probably in dv format. You could use mencoder to encode it to a format (in the process you may want apply filters such as scaling) which can reduce the size of the file considerably. Check out mencoder which is a part of the mplayer package (Just make sure you use encode use flag when you emerge mplayer).

EDIT: Using mencoder in command line mode has a pretty steep learning curve. Possibly you could use a gui based on mencoder to simplify the encoding process. Maybe someone on this forum could point you to one of them.
_________________
Power is about what you can control. Freedom is about what you can unleash.
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Sun Sep 24, 2006 5:45 am    Post subject: Reply with quote

I read about something like this
mencoder -ovc xvid -oac copy -xvidencopts bitrate=700 -o foobar.avi MVI_0130.AVI
but mencoder segfaults.
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Sun Sep 24, 2006 6:06 am    Post subject: Reply with quote

Or if there is a way of stripping the file of the audio, that would also be nice.
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Sun Sep 24, 2006 6:30 am    Post subject: Reply with quote

guduri wrote:
EDIT: Using mencoder in command line mode has a pretty steep learning curve. Possibly you could use a gui based on mencoder to simplify the encoding process. Maybe someone on this forum could point you to one of them.

Avidemux. Except that the version in portage is quite ancient. 2.3-preview1 has just been released and is much better. There is a 2.3-svn ebuild in my overlay.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Sun Sep 24, 2006 9:14 am    Post subject: Reply with quote

Well avidemux2 looks nice, but how do I use it?
I have managed to open it.. then what?
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Sun Sep 24, 2006 4:09 pm    Post subject: Reply with quote

Open your avi movie, then in the left-hand bar select your video codec, for example xvid4 or x264. Then Configure for options (e.g Two pass, average bitrate 1000kb/s - you can leave the other options at their defaults or look for encoding howtos). You can use Filters for resizing, improving image quality etc. If you have audio, I would recommend encoding that as wll, with lame or vorbis. Then press save ;)
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Sun Sep 24, 2006 4:42 pm    Post subject: Reply with quote

yngwin wrote:
Open your avi movie, then in the left-hand bar select your video codec, for example xvid4 or x264. Then Configure for options (e.g Two pass, average bitrate 1000kb/s - you can leave the other options at their defaults or look for encoding howtos). You can use Filters for resizing, improving image quality etc. If you have audio, I would recommend encoding that as wll, with lame or vorbis. Then press save ;)


Thank you very much. I'm trying it right now. Can I remove the sound with this program? It doesn't seem so.
And unfortunatly, I think I have to upgrade the avidemux first. I can not select average bitrate, only target size which seems to be ignored.
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Mon Sep 25, 2006 3:25 am    Post subject: Reply with quote

Yes, you can remove the sound as well. From the top menu, go to Audio > Main Track and set to "No audio". And as you can see there, you can even select an external audio file (at least in the 2.3-preview version I'm running).
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
m707
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 121
Location: Germany

PostPosted: Mon Sep 25, 2006 10:32 am    Post subject: Reply with quote

avi is a container not a codec, so noone can predict what is actually in your file.

Use:

tcprobe -i <file>

to get an idea which codec is used (mplayer --identify <file> should work, too, but the output is harder to read - IMHO).

Tcprobe belongs to transcode.

Where is your file from ... is it really a dv cam, or some kind of digicam?

If it is really dv, I would use kino to work with it. The GUI is IMHO straight forward.

To get just the video (strip the audio), mplayers syntax is quite harmless (exception proving the standards ;)):

mplayer -dumpvideo -dumpfile <OutFile> <InFile>
_________________
bye maik
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Mon Sep 25, 2006 10:47 am    Post subject: Reply with quote

m707 wrote:
avi is a container not a codec, so noone can predict what is actually in your file.

Use:

tcprobe -i <file>

to get an idea which codec is used (mplayer --identify <file> should work, too, but the output is harder to read - IMHO).

Tcprobe belongs to transcode.

Where is your file from ... is it really a dv cam, or some kind of digicam?

If it is really dv, I would use kino to work with it. The GUI is IMHO straight forward.

To get just the video (strip the audio), mplayers syntax is quite harmless (exception proving the standards ;)):

mplayer -dumpvideo -dumpfile <OutFile> <InFile>

The codec seems to be MJPG.
I get the output
Code:
[tcprobe] RIFF data, AVI video
[avilib] V: 10.000 fps, codec=MJPG, frames=202, width=640, height=480
[avilib] A: 11024 Hz, format=0x01, bits=8, channels=1, bitrate=88 kbps,
[avilib]    21 chunks, 222684 bytes, CBR
[tcprobe] summary for /tmp/MVI_0130.AVI, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
       frame rate: -f 10.000 [25.000] frc=11 (*)
      audio track: -a 0 [0] -e 11024,8,1 [48000,16,2] -n 0x1 [0x2000] (*)
                   bitrate=88 kbps
           length: 202 frames, frame_time=100 msec, duration=0:00:20.200


It's from a digitalcamera.
I will try the mplayer dump command later on. Thanks for your input.
Back to top
View user's profile Send private message
m707
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 121
Location: Germany

PostPosted: Mon Sep 25, 2006 12:47 pm    Post subject: Reply with quote

Quite ugly the format you got :(.

MJPEG is neither known to produce good quality nor does it show good compression rates :(. OTOH it is _unfortunately_ quite common for digicams.

It's a algorythm close to the one used for jpg still pics. As it is for still pics it is lacking at all in all compression functions you can use for films. E.g. if there is 1 sec (=25 single pics in PAL) with hardly any motion in the scene, mpeg2 or mpeg4 will compress this scene to nearly to size of one single picture. MJPEG will have to compress any single picture and the size is roughly 25 times higher than it could have been, without loosing information.

IMHO mjpeg sucks, but I suppose it is pretty cheap to implement for digicam producers (jpg for the pics mjpg for the video - so probably no extra chip) and AFAIK not covered with any additional licence issues.

Ok, as you already installed transcode, you can try it to convert the file, too:

Code:

transcode -i <yourFile> -x mplayer,null -f 10.000,11 --export-fps 25.000,3 -y ffmpeg,null -J fps -F mpeg4 -w 2000 -o mpeg4File.avi


Should give you an mpeg4 encoded avi, that is much closer to common standards.

-w 2000 is a bitrate setting for the video encoder and should be more than sufficient for 640x480 pixel mpeg4.

If in need decrease this setting (to make the file smaller). I suppose with less than 800 kbit/sec you will see first problems.

If you still need to decrease the filesize at this point, decrease the resolution, too.

e.g. if you reduce it to a quarter of the original (-Z 320x240), you should receive nearly the same image quality if you reduce -w correspondingly (1/4 of the bitrate used at 640x480). Of course the pic smaller, but it should be (nearly) as clear (no mpeg artifacts, etc.)

--export_fps 25.000,3 is my local standard (PAL), if you are in an ntsc country --export_fps 23.976,1 will be more common. IIRC -j fps will just copy single frames, so the overhead of the additional 15 frames per second to make it more standard compliant should be very good compressable using mpeg4.

The statement "null" in -x and -y takes care that no audio is im(ex)ported.

If you wish to have the audio, too, you could try:

-x mplayer,mplayer -y ffmpeg,mp3

but I suppose transcode will fail as 11024 khz 8 bit single channel audio is a *very* strange format.

If in need extract the audio using the mplayer command, convert the sample rate, bits, channels (44100,16,2) using sox, convert it to mp3 using lame and mux it back in the video stream using avimerge (belongs to transcode, too).

HTH
_________________
bye maik
Back to top
View user's profile Send private message
oldefortran
l33t
l33t


Joined: 28 Feb 2004
Posts: 652

PostPosted: Mon Sep 25, 2006 12:54 pm    Post subject: Reply with quote

Thanks! It worked fine!
Great forum here!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum