I have a 5 minute HD music clip in .ts format (originally recorded on a Humax PVR). It's about 650Mb in size, and I want to convert it to xvid/divx to slash the size while retaining a reasonable amount of quality (it's a low-light clip, so not the best quality in the first place).
I've used Avidemux to do the conversion, but it actually doubled the file size rather than reducing it. The settings I used were:
- Video output: Mpeg4 ASP (xvid4)
- Audio output: MP3 (lame)
I left all other settings to default.
Any idea why the file size increased, and how I can reduce it? (ideally to no more than 200Mb)
+ Reply to Thread
Results 1 to 22 of 22
-
-
Filesize = bitrate * runlength. So it follows that a lower bitrate will mean a smaller file.
A 5 minute xvid should have been 75 meg not 1300.
But post the mediainfo reports of both to be sure that nothing else is going on.
Edit. Just a thought. Is there a '2 CD' encode option for the conversion. That could explain the gigantic file size. -
This is the Mediainfo report for the original clip (I'm afraid I already deleted the converted clip that it created). There's no "2 CD" option that I can see. The conversion did take several hours though.
General
ID : 2050 (0x802)
Complete name : D:\Captured Video (from VHS)\BBC HD Live Earth - Crowded House.ts
Format : MPEG-TS
File size : 634 MiB
Duration : 5mn 10s
Overall bit rate mode : Variable
Overall bit rate : 17.1 Mbps
Video
ID : 2318 (0x90E)
Menu ID : 6940 (0x1B1C)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Format settings, GOP : M=3, N=12
Codec ID : 27
Duration : 5mn 10s
Bit rate : 15.6 Mbps
Maximum bit rate : 31.7 Mbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.402
Stream size : 578 MiB (91%)
Audio #1
ID : 2319 (0x90F)
Menu ID : 6940 (0x1B1C)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 6
Duration : 5mn 10s
Bit rate mode : Constant
Bit rate : 384 Kbps
Maximum bit rate : 31.7 Mbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -322ms
Stream size : 14.2 MiB (2%)
Language : English
Audio #2
ID : 2320 (0x910)
Menu ID : 6940 (0x1B1C)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 5mn 10s
Bit rate mode : Constant
Bit rate : 256 Kbps
Maximum bit rate : 31.7 Mbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -305ms
Stream size : 9.47 MiB (1%)
Language : nar
Text
ID : 2321 (0x911)-888
Menu ID : 6940 (0x1B1C)
Format : Teletext Subtitle
Language : English
Menu
ID : 258 (0x102)
Menu ID : 6940 (0x1B1C)
Duration : 5mn 10s
List : 2318 (0x90E) (AVC) / 2320 (0x910) (MPEG Audio, nar) / 2321 (0x911) () / 2309 (0x905) () / 2310 (0x906) () / 2311 (0x907) () / 2312 (0x908) () / 2313 (0x909) () / 2319 (0x90F) (AC-3, English)
Language : / nar / / / / / / / English
Maximum bit rate : 285109600 -
The converted clip would have been more useful.
Checked avidemux. That option does not specifically allow you to set a bitrate. You have to alter the quantiser which defaults on 2. The lower the number effectively means a higher bitrate.
But change the encoding setting to 'constant bitrate' then allows you to set it. (use a bitrate calculator to choose it). 200 meg is still much too high tho. -
I just had to abort the latest conversion attempt after 12 hours as it was only 35% complete. It seems that converting this file from .ts to .mp4 using Mpeg4 ASP (xvid4) / MP3 (lame) is not really feasible using Avidemux for some reason.
Is there another tool that can convert this .ts file to xvid in a reasonable timescale? (It's only a 5 minute clip after all!) -
Is there a specific reason for using xvid ? (e.g. did you need to play it on a specific device?c ompatibility reasons? ) Compression ratio is significantly worse than h.264/avc. Since your goal is to REDUCE the filesize, xvid would be a poor choice these days (might have been ok 5 years ago)
-
No I'd be happy to try any common format that gets the file size down without looking terrible. What would be a better choice?
-
Compression wise, x264 encoder would be much better , AAC audio .
This clip is encoded MBAFF (you can think of it as "interlaced") , did you want to keep it that way ? I'm assuming it's interlaced content, like a nature show (BBC Earth)
Did you care for the other audio track , and subs ?
The equation DB83 posted above is universal ; filesize = bitrate * running time . So if you wanted 1/3 of the size, you would need 1/3 of the bitrate
If it's "noisy" you might consider denoising/filtering it first (noise is the enemy of compression) -
I may be wide of the mark here but the conversion speed may well be influenced by the apparent fact that it has to deal with a 2nd audio stream that has a very high bitrate.
Might I suggest that you use avidemux and extract a 30 sec sample from this original vid - use copy for both video and audio and .ts as the format. Upload that sample here and we can see what is possible -
Here's a short sample of the output using the copy/Mpeg TS Muxer (ff) option.
I'm only interested in the primary stereo soundtrack. I've just tried omitting the 2nd audio track and the conversion is still painfully slow (about 3 secs to encode each frame on average) -
Maybe Avidemux is having problems with demuxing that transport stream
If I were you, I would first remux to an intermediate MKV file, and then re-encode.
BTW, that's why I did with your sample file. VirtualDub + Xvid worked at "normal" speed over here. -
Strange - I just demuxed to mkv using Handbrake, then tried encoding the mkv to mp4 using Avidemux but it still took forever. Also, Virtualdub wouldn't open the mkv file
??? -
VirtualDub requires an input plugin (the ffmpeg one, or fccHandler's). OR an intermediate Avisynth file.
Perhaps there is a program or a service interfering with Avidemux on your machine
FWIW, I demuxed the .TS to elementary streams with TSmuxer, and then I used MKVtoolnix. -
I did a quite quick conversion using avidemux. Stripped out the 2nd audio stream first and then selected a cbr of 1500. Same format as you wanted but with a mp4 container.
The original is not brilliant so this conversion is not either. It took <30 secs on my slow PC. -
It's pretty dark and noisy ; I would brighten it up a bit and denoise it
Noise is very bad for compression . Compression works by storing the differences between frames, and lots of noise means big differences => big filesize for a given level of "quality" . Good denoisers are usually very slow, so even if you get things sorted out regarding the speed, if you add a denoiser it will slow down considerably. -
Under the 'Video' menu you will see lists of various filters.
Can not say how good they are in practice and most on here would use avisynth for that since their filters are v.good but as pdr states v.slow.
But you already have a time issue.
You may like to try this since I did not have a time issue with my sample. Load the full clip in to avidemux and copy it in full just like you did with the sample. I also wonder if this speed issue is down to the makeup of the original PIDs etc. Also go to the 'Audio' menu and deselect the second audio stream to see if that itself speeds up the encode.
Mind you, a fast re-encode does not usually equate to good quality. But a 5 minute clip should still only take minutes and not hours. -
If my goal was primarily reduction of filesize , and retaining some decent quality, I would bob deinterlace to 720p50, instead of keeping it 1440x1080i25. Progressive encoding is more efficient for compression, and by the time you denoise, process it, etc... you're not going to have much fine details anyways.
Like all choices in video , the choice of denoising is about trade offs and very subjective. It's easy to "overdo" it and remove fine details , that when combined with sharpening will give a "plastic doll" or "oil painting" look . One person's "grain" (wanted) is another person's "noise" (unwanted) . But I think everyone would agree that the noise in your video sample is a bit too much.
This example below was done using "typical" avisynth filters. HDRAGC and levels to brighten up the shadows, MCTemporalDenoise with default "high" , interlaced settings. QTGMC to bob deinterlace for the 720p50 version. The results are nothing special - very standard stuff for avisynth. It's probably overdenoised IMO , but I don't have time to fiddle with it. You can get better results if you spent time tinkering, customizing the settings, and playing with other filters.
I played with a few avidemux versions (some are better than others, some are missing filters) - it has a field rate bug which reads your framerate as 50 (instead of 25). So that's going to be a problem. It does have deinterlacing, denoising, and color/brightness adjustment filters, but you won't get as good results as in avisynth. There is a learning curve in avisynth , but it's not too bad once you get started -
I know it is not my choice but if it was I would go with pdr's 720p version. Maybe my friend would like to provide his script.
Now if I read your source correctly, the original may have been HD (as per the screen graphic) but I see '(from VHS)' in your title. So did you, or even someone else, record that to VHS and then as a means to an end you recoded that back to HD to get it in to your PC ?. Obviously a VHS (SD from HD) upconverted source will not be very good which is quite likely where the noise etc. came from. After all, the BBC are not usually that bad. -
-
It might help to look at the beginner section at the avisynth page.
http://avisynth.nl/index.php/Main_Page#New_to_AviSynth_-_start_here
I used DGAVCIndex (it works ok on most MBAFF streams, it just has problems with PAFF streams), to index the files
Everything I used was almost "default" settings, if you have the time, you should tinker with the script and settings to get better results. Only HDRAGC and levels required specific adjustments, and i used slightly different levels for the break after the scene (since it's brighter). You could probably get away with using 1 set of generic levels/brightness settings, but you always get better results if you customize them to the scene (since some scenes will be brighter than others in this concert). I used histogram() to see what values were required and you're going to have to adjust parts of the script (you can't use the same trim() numbers on the 5min video)
After denoising, you often have to adjust levels again (a lot of noise can affect the levels, and once you remove that noise, the levels will change). Some people prefer to adjust levels only once after everything at the end. The reason I like to do it earlier, is usually denoisers are damaging to shadow details. If you bring those dark areas up, I find they usually won't turn to mush as easily. (There are other methods as well, such as using masks, shadow protection, but this is just a quick example of a common usage scenario in avisynth)
I split it up into 2 steps, the first for a lossless intermediate - because I wanted demonstrate 2 versions (720p50 vs. 1080i25) and didn't want to use MCTD twice (It's a slow filter, but you can speed it up very slightly if you have a compatible GPU, by using GPU=true which uses FFT3DGPU instead of FFT3DFilter. You can also get a speedup by using avisynth MT, but that's another topic. It's not entirely "rosy", it can be problematic too, so start with the non MT version)
1st stage
Code:AVCSource() HDRAGC(max_gain=1, coef_sat=0.85) AssumeTFF() SeparateFields() f1=SelectEven().MCTemporalDenoise(settings="high", sharp=false, strength=0) f2=SelectOdd().MCTemporalDenoise(settings="high", sharp=false, strength=0) Interleave(f1,f2) Weave()
1080i25
Code:a=AVISource("1st stage lossless intermediate.avi") a Levels(12,1,255,0,255,false) HDRAGC(max_gain=0.5, coef_sat=0.85) a1=last a Levels(15,1,255,0,255,false) HDRAGC(max_gain=0.5, coef_sat=0.85, shift=5) a2=last a1.trim(0,235)++a2.trim(236,0)
720p50
Code:#Same as above, for input, the following bob deinterlaces with QTGMC AssumeTFF() BicubicResize(1280, last.height) QTGMC(preset="faster") BicubicResize(1280,720)
For QTGMC I used "faster" settings. You can use the default "slower" or whatever you want. I find "faster" gets about 95% of the quality for most sources and is "good enough" . (It's also a few times faster)
If you get stuck with something, just ask, someone will help you . One of the most common problems is just finding the required .dlls and plugins. (many filters and plugins are developed by individuals and it can be difficult tracking down the correct versions) -
Thanks so much for this. There's an awful lot to take in - I'll see if I can make some sense of it tomorrow....