View Full Version : Converting DVD-Video to Divx without losing quality (and some questions)
kurkosdr
7th November 2009, 22:56
Hi there,
I would like to convert the main movie of a DVD-Video to Divx without losing any quality. I am looking for a software that can adjust the bitrate (for each scene) and do the conversion in such way, that no quality is lost during the conversion. Filesize not an issue. Which software should I use?
Also, here are some questions about the divx format:
-How can I get anamorphic widescreen in dvix? The maximum resolution of the dvix specification for standalone players is 720x576, so the only way to get widescreen without reducing the resolution (and as a result, the quality) is the anamorphic. If the avi container can’t, can the .dvix container do that?
-Which features are not part of the official Dvix specification, so I can disable them? (3-warp and qpel comes to mind, if there are others please mention them). This is because I want playability on all Divx players (or at least, the licensed ones with the logo).
-How can I preserve the original AC3 sound ? As far as I know, both avi and .dvix support AC3 streams, so I only need a way to extract the sound from the Vob file and then put it in the dvix file
-Is there a way to put subtitles into a dvix file that is using the .dvix container? (avi’s can’t have subtitles for sure, at least not in the official spec, so .dvix is the only way). I have tried Avi Mux GUI, but it only gives me corrupt files.
And something more: Since the .dvix container seems better than avi container and is supported by all licensed players, why everyone prefers the avi?
Inspector.Gadget
7th November 2009, 23:42
You don't actually need to use anything produced or endorsed by DivX to create files that will play on a DivX-compatible standalone player, provided that you follow the appropriate complexity/feature/bitrate constraints. Your playback device's profile support will dictate what MPEG-4 ASP features you can use in encoding for it.
setarip_old
8th November 2009, 02:37
@kurkosdr
Hi!Filesize not an issue.So why bother converting to DivX-compressed .AVI? ALL standalone DivX-compatible standalone players also play conventional DVDs. Simply make a backup copy of your original, commercial DVD...
mgh
8th November 2009, 07:23
The latest xvid and divx codecs have ar signalling available and anamorphic encodes are possible.
Problem: even the latest divx player for the PC does not accept ar signalling, even though windows media player with divx codec installed on your pc accepts ar signalling and hence anamorphic playback.
afaik, none of the standalone divx capable players accept ar signalling.
divx subtitles are a proprietary format, you will find some tools for converting .srt subtitles to needed format at
http://www.videohelp.com/tools/sections/subtitle
most standalone divx capable players will accept .srt files with same name as .avi (i.e. xxx.avi and xxx.srt) and give you switchable subtitles
CWR03
8th November 2009, 13:33
So why bother converting to DivX-compressed .AVI? ALL standalone DivX-compatible standalone players also play conventional DVDs. Simply make a backup copy of your original, commercial DVD...
Agreed, plus there's no way to convert from DVD-Video to DivX without losing quality, even if you end up with a BIGGER end file. Conversions of this type are inherently lossy.
kurkosdr
8th November 2009, 18:03
Hi there. Thanks for the answers.
Hi!So why bother converting to DivX-compressed .AVI? ALL standalone DivX-compatible standalone players also play conventional DVDs. Simply make a backup copy of your original, commercial DVD...
I hoped that, even with the filesize not being an issue, I would still end up with a file that will be somewhat smaller than the original DVD, as divx is by definition more efficient that dvd-video.
Also, I would like to have the movie in one file, and that file being playable on standalones (I could join the vob files together, but if I do so, they won't be playable on standalones). So, even if I end up with a file as big as the original, converting to Divx still makes sense.
You don't actually need to use anything produced or endorsed by DivX to create files that will play on a DivX-compatible standalone player, provided that you follow the appropriate complexity/feature/bitrate constraints. Your playback device's profile support will dictate what MPEG-4 ASP features you can use in encoding for it.
I was not intending to use official Divx software anyway. I was hoping you could point me to another tool, being able to preserve quality better than the ofiicial divx software. But I want the end file to fully conform to the divx standards. My player actually supports things like qpel (but not 3warp) but since I want playability on all Divx standalones, I would like to remove all features not supported by the "official" divx standards (which is the lowest profile/common denominator?). Just post a list with the things I should disable (ex qpel, 3warp etc), I 'll find out how.
afaik, none of the standalone divx capable players accept ar signalling.
Isn't the official .divx container supposed to offer that? If not, it's a big mistake from Divx Inc, if you ask me. Anyway, since I seem to be headed mainly towards xvid, how can I do ar signaling with xvid? I need it so VLC and Media Player can show the video in proper widescreen (i don't use divx player). I don't care much if the standalone players won't see the ar singaling, as all Widescreen tv's have a button that streches 4:3 to 16:9, so this should do the trick.
divx subtitles are a proprietary format, you will find some tools for converting .srt subtitles to needed format at http://www.videohelp.com/tools/sections/subtitle
Thanks for the link. AVIAddXsubs did the the job (one question solved!). VLC can't show them (that's why I 'll keep the srt file in the same folder), but it says they are there, they are there, so the offically official certified standalone players should play them (I 'll post results when I get a blank cd)
most standalone divx capable players will accept .srt files with same name as .avi (i.e. xxx.avi and xxx.srt) and give you switchable subtitles
Yes, but most of them don't do it very well. My Sony recorder puts a grey backround behind the letters and the letters themselves are too small, my schaub lorenz player doesn't bother showing them at all, and some philips players demand the external subtitles to be inserted manually through a special button. In fact, getting your srt file detected (even if it is with same name as .avi) and properly shown is a matter of sheer luck. On the other hand, the divx subtitles (xsub) are inside the file and bitmap based, like the ones of dvd-video, so it should show fine (and are part of the official spec).
Agreed, plus there's no way to convert from DVD-Video to DivX without losing quality, even if you end up with a BIGGER end file. Conversions of this type are inherently lossy.
You mean there isn't any software to convert mpeg2 to mpeg4 asp without dropping quality? This is bad. Isn't there some software that would compress a scene, check if the end file has lost any quality (in that scene) compared to the original, and then compress again with increased bitrate if it has indeed lost any quality? If this is not possible, excuse my silly question...
So, here it goes:
1) Which method and software should I use to get the minimum quality loss ?
2) Since the end file won't have audio, how can I mux the video and an AC3 stream in one .dvix file (not avi)?
3) How can I get anamorphic widescreen in that .dvix file?
4) Which features are not part of the divx standard? (lowest profile)
5) How can I extract an ac3 stream from a vob file?
mgh
8th November 2009, 19:21
if you use virtualdub mod-vobs can be loaded directly-by default it will retain your ac3 audio
compress using divx codec home theatre profile ( which ensures that the video is compatible with divx certified devices), use quality mode with quantizer set to 2 (which is practically the highest quality possible) and convert to avi.
next load avi in mpeg4modifier (http://www.videohelp.com/tools/MPEG4_Modifier) and either set display aspect ratio (4:3 or 16:9) or the pixel aspect ratio, to make it play anamorphic, and save.
Use AVIAddXsubs to add your sub and save as .divx file
Inspector.Gadget
8th November 2009, 19:50
Don't use VirtualdubMod. It's old, broken, and not maintained. Use a more modern solution (read: avoid VFW if you're going to use B-frames). Your hardware may require packed bitstreams; you MUST read the documentation and not rely on us to guess for you.
Avidemux can also open VOBs directly, has more advanced built-in filters, doesn't get messed up on B-frames, can pack VOPs, etc. So yes, XviD Q2 is still the way to go if you don't care about file size. You can just allow Avidemux to copy the audio stream, and of course you can set the PAR to "as input" in the XviD config to get the correct anamorphism regardless of cropping. You must do your own research as far as feature support, as there is more than one DivX profile in existence and only you know what your hardware claims to support. Generally, you want the FourCC of the encoded file to be DX50 (can set this in Avidemux). Then run that file through the add subs program, and you should be set.
Dark Shikari
8th November 2009, 20:15
You mean there isn't any software to convert mpeg2 to mpeg4 asp without dropping quality? This is bad. Isn't there some software that would compress a scene, check if the end file has lost any quality (in that scene) compared to the original, and then compress again with increased bitrate if it has indeed lost any quality? If this is not possible, excuse my silly question...MPEG-4 ASP is lossy. That's it. Plain and simple.
CWR03
9th November 2009, 00:04
You mean there isn't any software to convert mpeg2 to mpeg4 asp without dropping quality?
The methods with which MPEG-4 compresses makes it impossible. There may be a level of quality loss that's suitable to you, but there will always be some loss in one manner or another (Usually more than one manner). Bitrate isn't the only determinor, which is why I said you'll have quality loss even with a bigger output file.
Also, I would like to have the movie in one file, and that file being playable on standalones (I could join the vob files together, but if I do so, they won't be playable on standalones).
Using a program such as DVD Shrink will allow you to strip all but the streams you want and in most cases will let you get the original MPEG-2 streams of a movie to fit on a standard DVD disk, which of course will be compatible with any standalone player.
kurkosdr
9th November 2009, 11:19
if you use virtualdub mod-vobs can be loaded directly-by default it will retain your ac3 audio
compress using divx codec home theatre profile ( which ensures that the video is compatible with divx certified devices), use quality mode with quantizer set to 2 (which is practically the highest quality possible) and convert to avi.
next load avi in mpeg4modifier (http://www.videohelp.com/tools/MPEG4_Modifier) and either set display aspect ratio (4:3 or 16:9) or the pixel aspect ratio, to make it play anamorphic, and save.
Use AVIAddXsubs to add your sub and save as .divx file
Don't use VirtualdubMod. It's old, broken, and not maintained. Use a more modern solution (read: avoid VFW if you're going to use B-frames). Your hardware may require packed bitstreams; you MUST read the documentation and not rely on us to guess for you.
Avidemux can also open VOBs directly, has more advanced built-in filters, doesn't get messed up on B-frames, can pack VOPs, etc. So yes, XviD Q2 is still the way to go if you don't care about file size. You can just allow Avidemux to copy the audio stream, and of course you can set the PAR to "as input" in the XviD config to get the correct anamorphism regardless of cropping. You must do your own research as far as feature support, as there is more than one DivX profile in existence and only you know what your hardware claims to support. Generally, you want the FourCC of the encoded file to be DX50 (can set this in Avidemux). Then run that file through the add subs program, and you should be set.
Wow, that was a very good guide, I 'll try it and see. As regards the features, I am looking for the lowesr common denominator, like the videos that cicrulate on the net. These videos play everywhere, because they use nothing but the features supported in the lowest profile.
detmek
9th November 2009, 18:38
I think that you should just use Dr Divx 2. It supports anamorphic, built-in subtitles, AC3. Use it with Divx Home Theatre Profile and it will work on all Divx certified players.
@IG Since when is VirtualDubMod broken? AutoGK uses it and all files work great with SAPs.
pelle412
9th November 2009, 18:39
afaik, none of the standalone divx capable players accept ar signalling.
Some do, but that capability is not usually found in the specs. My Philips DVP-5140 handles AR signalling. I know the Zensonic Z-500 does too. At present I use a PCH-A110.
To get high quality MPEG-4 ASP (DivX and XviD) videos can require quite a bit of work, but it all depends on how sensitive your eyes are. Try encoding with various settings and quantization matrices and decide what you find acceptable. The tools I use for XviD are:
DGMPGDec - process vob files into a d2v project file
AviSynth - very basic scripts, cropping, itvc, or deinterlacing as needed
xvid_encraw - encoding
Subrip - subtitles
VDubMod - muxing
The bottom line is that there isn't a golden method. If you want to be able to encode in high quality you need to start somewhere, usually with someone's written guide, and experiment until you get the hang of it.
Inspector.Gadget
9th November 2009, 18:49
@IG Since when is VirtualDubMod broken?
:search: (filler content to pad text limit here)
kurkosdr
27th December 2009, 22:15
(bump)
Rookie question:
Since the Videolan team managed to come up with a way of losslesly converting to Mpeg 4 avc ("x264 lossless") why can't someone do something similar for mpeg 4 asp?
The fact the content is already in compressed form (mpeg 2) should help. Just keep all those I-frames intact and replace some of the P-frames with B-frames. This should reduce size without quality loss.
Anyway, if I can't convert to Divx without losing quality, can someone tell me how to convert into mkv h.264 (losslesly, of course)? Please?
Dark Shikari
27th December 2009, 22:28
(bump)
Rookie question:
Since the Videolan team managed to come up with a way of losslesly converting to Mpeg 4 avc ("x264 lossless")The x264 team is non-overlapping with the Videolan team. And lossless x264 is generally much larger than the lossy source you're encoding from.why can't someone do something similar for mpeg 4 asp?Because MPEG-4 ASP doesn't have a lossless mode.The fact the content is already in compressed form (mpeg 2) should help.No, it makes it much harder. Instead of trying to make the video smaller than an uncompressed source (easy), you're trying to make it smaller than a compressed source (impossible). Just keep all those I-frames intact and replace some of the P-frames with B-frames. This should reduce size without quality loss.That doesn't even make an ounce of sense.Anyway, if I can't convert to Divx without losing quality, can someone tell me how to convert into mkv h.264 (losslesly, of course)? Please?Why? It would just make the file larger.
7ekno
28th December 2009, 01:50
OP, this is a video forum where terms like "lossless" are taken literally ... there is also a term "transparent", meaning "no discernable difference to the human eye when compared to source" ...
Are you truely after "lossless" or "transparent"?!? The file size between the 2 can be 5-10 fold different ...
If the answer is "transparent", then XviD at Q2 is the best you can hope for (and even then I can see the slight gradient blocking like in dark or uniform sky scenes), transparent with x264 is somewhere between CRF 16 - CRF 18 ... of course there are other settings to play with, but those are the basics you need for "transparent" ...
7ek
creamyhorror
2nd January 2010, 02:27
A bit off-topic, but how is the current state of XviD encoding quality-wise? I've heard about things like VAQ being introduced into XviD, so has there been a lot of improvement since, say, 2006? How does it compare to pre-mbtree x264? I'm asking because I may want to encode videos for standalone players which only play DivX.
henryho_hk
4th January 2010, 12:25
VAQ has improved XviD's "H.263 mode" a lot and we can finally use H.263 as a general purpose quick-win solution. It is said to offer 10% bitrate saving (or better overall quality at the same bitrate) without any support issue from H/W players. It cannot make XviD comparable to x264 at low bitrate though.
kurkosdr
6th January 2010, 23:23
Are you truely after "lossless" or "transparent"?!? The file size between the 2 can be 5-10 fold different ...
I used to be after "lossless", but then I realized it was impossible, so I 'll go for "transparent". All I want is not to add any artifacts into the picture (in other words, i want the output file to be identical to the eye to the original). If such thing isn't possible, I 'll go for "transparent".
If the answer is "transparent", then XviD at Q2 is the best you can hope for (and even then I can see the slight gradient blocking like in dark or uniform sky scenes)
Thanks for the answer! :thanks: I was looking forward for someone to give me these settings.
But, what exactly is that "Q2"? Is it the "quantization" setting? Were can I find this setting? I mostly use frontends like AutoGk and Xvid4psp, so I would be grateful if you could tell me where to find this setting in these apps.
(by the way, I always put the quantization to "1", it may give a file that's a little bigger than the usual, but results seem to be much better).
Asmodian
8th January 2010, 01:25
(by the way, I always put the quantization to "1", it may give a file that's a little bigger than the usual, but results seem to be much better).
Quant 1 is much bigger then quant 2 and only a little better in terms of visual quality. Please do a test of the same source to a constant quant 1 and constant quant 2 encode and compare them before sticking with q1.
It is hard for me to tell the difference between q1 and q2 and q1 is so much larger!
check out this post:
http://forum.doom9.org/showthread.php?t=91665#7
kurkosdr
19th January 2010, 01:00
MPEG-4 ASP is lossy. That's it. Plain and simple.
A friend of mine told me that if I set Xvid's quantizer to "1", the result will be indistinguisable from the original. Hence, lossless. (his words, not mine)
He also told me that I can take a png snapshot from any frame from the resulting avi file with a software like VLC, then take a snaphot from the same frame from the original source, and not even pixel-by-pixel comparison will be able to tell the difference.
Is he correct, or just giving me nonsense?
Thanks a lot in advance and for all the advice so far.
GodofaGap
19th January 2010, 10:22
Mostly what he said is nonsense.
detmek
19th January 2010, 10:28
No, it is not lossless. It is transparent. You can not see difference or, it is very hard for you to see difference. But, it is not lossless.
And, Q1 gives a lot bigger file compared to Q2 for very small gain in visual quality.
kurkosdr
19th January 2010, 10:28
Mostly what he said is nonsense.
Well, to me he seems to be correct.
When he came over, we put snapshots from the resulting avi and the original file side by side (the snapshots were from the same frame, of course), and neither of us was able to tell the difference.
I don't know if this classifies as "lossless", but it's basically what I want to achieve.
GodofaGap
19th January 2010, 10:36
Like detmek said, what you are talking about is transparent, not lossless.
kurkosdr
19th January 2010, 10:57
Like detmek said, what you are talking about is transparent, not lossless.
Which begs the question:
Is Xvid with quantization set to "1" transparent? Yes or no?
If I take snaphots from every frame of the resulting avi, and from every frame of the original, and compare them pixel-to-pixel with some software, will it detect any differences?
nurbs
19th January 2010, 11:33
Is Xvid with quantization set to "1" transparent? Yes or no?
Probably yes. You could probably save some harddisk space by using quant 2 with a high bitrate matrix and the result could both be smaller and as good (or better) as the quant 1 encode. There may be cases where quant 1 isn't transparent, but quant 2 with an appropriate matrix is.
If I take snaphots from every frame of the resulting avi, and from every frame of the original, and compare them pixel-to-pixel with some software, will it detect any differences?
You won't find a single picture where there aren't any differences in a pixel-to-pixel comparison. As people have told you multiple times Xvid, and MPEG-4 ASP in general, aren't lossless.
Asmodian
19th January 2010, 21:19
Which begs the question:
Is Xvid with quantization set to "1" transparent? Yes or no?
If I take snaphots from every frame of the resulting avi, and from every frame of the original, and compare them pixel-to-pixel with some software, will it detect any differences?
Yes Xvid is transparent at quant 1 but it is also transparent at quant 2 (use mpeg or a nice custom matrix) and much smaller. :p
Did you try a quant 2 encode?
henryho_hk
20th January 2010, 00:41
Avoid B frames too
nurbs
20th January 2010, 01:03
Why? From everything I read b-frames do what they are supposed to do. Maybe once you don't care about size anymore it's you can ditch them, but they do increase the quality at a given bitrate.
For reference: http://forum.doom9.org/showthread.php?t=88268
henryho_hk
21st January 2010, 00:45
coz they want to retain as much quality regardless of the file size.
Asmodian
21st January 2010, 21:06
Avoid B frames too
If you set the b-frame quant to 2 as well (turn off the increase in quant for b-frames) they do not hurt quality but don't decrease size much either so it isn't too bad to just turn them off.
kurkosdr
22nd January 2010, 20:51
Yes Xvid is transparent at quant 1 but it is also transparent at quant 2 (use mpeg or a nice custom matrix) and much smaller. :p
Did you try a quant 2 encode?
Yes, I tried quant 2, but there is some minor loss in some dark parts of the picture or when there is a lot of action going on. Also, I don't like using custom (non-official) matrixes, as they reduce compatibility with standalones (the H.263 matrix is the official matrix for Divx standalone devices, correct?).
Anyway, it seems quant 1 is the one I want. Even if it inserts some loss, it's going to be so minor that I won't even notice while watching. And thanks for the B-frame tip. I will put that quant to 1 too. Thanks for all the answers so far.
Dark Shikari
22nd January 2010, 21:23
A friend of mine told me that if I set Xvid's quantizer to "1", the result will be indistinguisable from the original. Hence, lossless. (his words, not mine)
He also told me that I can take a png snapshot from any frame from the resulting avi file with a software like VLC, then take a snaphot from the same frame from the original source, and not even pixel-by-pixel comparison will be able to tell the difference.
Is he correct, or just giving me nonsense?
Thanks a lot in advance and for all the advice so far.Indistinguishable? Almost surely yes. Lossless? No.
If I randomly added or subtracted 1 from each pixel in a movie, you wouldn't notice a thing. But it wouldn't be lossless.
Asmodian
22nd January 2010, 21:54
I hoped that, even with the filesize not being an issue, I would still end up with a file that will be somewhat smaller than the original DVD, as divx is by definition more efficient that dvd-video.
This statment makes me think you really should be re-visiting the q1 vs q2 options. Q1 is placebo IMO (but I have always used the MPEG matrix when going for low quants).
Also, I don't like using custom (non-official) matrixes, as they reduce compatibility with standalones (the H.263 matrix is the official matrix for Divx standalone devices, correct?)
The MPEG matrix is also supported by Divx standalones and it is the sharper more detail oriented matrix that looks better at low quants and results in larger files. The H263 matrix looks better at high quants because it looks smooth rather then ringing (mosquito noise) but it loses some detail even at quant 1 or 2.
Yes, I tried quant 2, but there is some minor loss in some dark parts of the picture or when there is a lot of action going on.
Maybe this was because B-frames were on and using quant 3? The quality difference between q1 and q2 is much less than q2 to q3. Please try a quick test of q1 vs q2 (5000 frames would be fine) with the mpeg matrix and B frames at the same quant.
I guess I shouldn't care if you are wasting large amounts of HD space but it was a pet-peeve of mine that the Xvid devs had to set the default minimum quant for two pass encoding to 1 instead of 2 (about four years ago) because of newbies complaining of undersized files with almost no increase in quality due the increase in size. Their videos didn't look any different but people stopped spamming the forum with I asked it for X MB but it gave me X-Y MBs. I really do not think it is easy to tell the difference between a q1 and q2 xvid video during playback, at least when using the mpeg matrix.
henryho_hk
23rd January 2010, 07:41
Again, try the "for editing only" special preset from the topmost sticky thread.
kurkosdr
1st August 2010, 05:27
Hi there, here is another question:
I just noticed ffmpeg has a -sameq switch, which according to their documentation (http://ffmpeg.org/ffmpeg-doc.html#SEC6), provides same video quality as source (their words not mine).
How is this possible on lossy formats like mpeg 2 and mpeg 4 asp? Does this mean I can get lossless conversion to mpeg 4 asp just by using the -sameq switch on ffmpeg?
If lossless is not the case, then what exactly "-sameq" means?
PS: I am asking here because you guys have the tryouts project, so you may know ffmpeg.
henryho_hk
1st August 2010, 06:33
would "sameq" mean "same quantitizer" ?
J_Darnley
2nd August 2010, 11:28
Yes. It encodes using the input frame quantiser.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.