View Full Version : Anamorphic encoding in matroska 720 x 432 with AAC 5.1
ChristianHJW
2nd June 2003, 00:23
Hi,
i decided to upload a nice matroska test sample, trying to show the advantages of anamorphic encodings. Please, if you are not interested in this subject at all, dont download the file, i guess my provider will kill me if the bandwidth i expect will become reality ( the sample has about 10 MB ).
Here the Link (http://karin.wiesner.bei.t-online.de/Starwars/StarwarsAAC5_1anamorphicXviD.mkv) ( use 'save target as' and "StarwarsAAC5_1anamorphicXviD.mkv" as file name, including the ", to get the correct extension ) and the details :
Video :
Res : 720 x 432 , anamorphic ;
Output res on playback : 720 x 304 ( 1:2.35 )
Codec : XviD 2 pass ( I like both, DivX5 and XviD )
Settings : Bitrate 1250 kbps, VHQ 4, 5 B-frames, packed bitstream, QPEL, h.263 quant
Framerate : 25 fps ( PAL source 720 x 576 )
Audio :
AAC 5.1, 220 kbps, 44.1 KHz, PsyTel aacenc 2.15
Note : sound quality sucks, there is still a bug in this old version of aaceenc.exe, but the new NeroDigital AAC pluginwas released today, and it should give nice results ;)
Total :
2 x 700 MB ( No subs yet, i was too lazy to rip them ;) ), but it wouldnt add much
How to make it :
1. Encode Movie in 2-pass using VirtualdubMod, into AVI or MKV ( doesnt matter ). The important thing here that is different from making a 'normal' rip, is that you dont use any resizing, you just crop the picture ( either in AVISynth/Gknot or in VdubMod directly ). Make sure that the final encoding resolution will follow the multiples of 8 rule. This may make it necessary to crop 2 - 3 lines into the picture on top and bottom ( worst case ), but with > 400 lines in total you wont notice that, i promise ;)
2. Add the original AC3 to the streams list in VdubMod, mark the start and end frame and mux it into another MKV
3. Demux the AC3 from this new MKV
4. Feed the AC3 into BeSweet with the -6chwav switch, normal azid settings
5. Feed this WAV into aacenc.exe ( ver 2.15 ), with the follwing CLI : E:\FlaskDivX\AACencoder\aacenc.exe -br 220 -if E:\FlaskDivX\AACencoder\starwars.wav
6. Download latest mkvtoolnix from Mosu's site (http://www.bunkus.org/videotools/mkvtoolnix/), search for the win32 binaries of it ( cmpiled with cygwin ): Direct link for 0.4.2 : http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-0.4.2.zip
7. Use the following CLI :
E:\FlaskDivX\mkvtoolnix\mkvmerge.exe -o testAR.mkv --aspect-ratio 2.35 testnosound.mkv starwars.aac
If you'r not a CLI expert ( like i am ;) ), simply copy mkvtoolnix and the sound.aac and the video.mkv into the c:\ root directory ;) ...
For playback :
1. Download the Core Media Player from Corecoded.com (http://corecoded.com) . This is not mandatory, as you may do the resizing in other players also manually. Then goto 'settings' 'audio settings' and disable the Equalizer ( tickbox )
2. get the latest alpha matroska CDL plugin (http://christian.hj.wiesner.bei.t-online.de/TCMP//MatroskaCDLv1.2_test.exe) and install it . Note this is highly experimental !!
3. Download and install the newest matroska DirectShow parser ( 0.4.2 ) from http://www.matroska.org/announce.html
4. get the binaries of CoreAAC, the 5.1 capable AAC DirectShow filter, from Rarewares (http://rarewares.hydrogenaudio.org), courtesy to rjamorim ;)
5. If you dont have a 5.1 setup ( like me ;) ), you will need the great channel downmixer filter from trombettworks (http://trombettworks.com/directshow.php), or you cant hear sound
Tell me what you think guys :) !! . I plan to upload another sample file soon, being the same file with exactly same settings, but resized to 720 x 304 and with MPEG quant, for comparison.
CaptainCarrot
2nd June 2003, 00:59
Sounds cool, i'll download it and have a look (tomorrow), but what you say about the aacaudio is something about which i just posted in the audio-forum: Do you really get improved quality at the same bitrate compared to AC3?
ChristianHJW
2nd June 2003, 01:03
For a typical 2 CD rip i'd probably go for the original AC3, but this is a long movie and the AC3 bitrate is 448 kbps, so this will result in a 450 MB audio file :( ...
menno an Ivan from Nero are promising the new NeroDigital AAC encoder plugin will sound undistinguishable from the AC3 at > 240 kbps, and 160 kbps is possible with very good results ...
chepe36
2nd June 2003, 02:22
The great thing about anmorphic resizeing is not to resize from 720 x 432 to 720 x 304 but to resize to 1024 x 432. See this way you get a lot more resolution and just a little loss in quality.
doing it the other way (making the video smaller) is useless you wouldn't get any adventage of anamorphic.
chepe36
2nd June 2003, 04:02
Or not? :confused: :rolleyes:
31 Flavas
2nd June 2003, 05:02
That's how I do it RV9.
Encode 720x480 -> 888x480 for 1.85:1 content
Teegedeck
2nd June 2003, 08:27
Originally posted by 31 Flavas
That's how I do it RV9.
Encode 720x480 -> 888x480 for 1.85:1 content
I used to do something like that. But you do realize that this way (720x --> 888x) resizing really becomes an unnecessary filter in the chain?
Nice little clip but Core Media player crashes. Had to use Zoom Player to play this clip.
This doesn't belong to here but TCMP still crashes random a LOT under Win98, i think it's time to uninstall it.
ChristianHJW
2nd June 2003, 09:00
Originally posted by Gaia Nice little clip but Core Media player crashes. Had to use Zoom Player to play this clip.
This doesn't belong to here but TCMP still crashes random a LOT under Win98, i think it's time to uninstall it.
Gaia, if you remove the matroska CDL plugin from TCMP's plugin directory, will it crahs also ? Note that jcsston's CDL is highly experimental as i said, and everybody in the dev team is on 2k/XP, so it may well be that it doesnt work at all on Win98, due to the very same reasons as for our DShow parser, the missing unicode support in Win98.
Originally posted by ChristianHJW
Gaia, if you remove the matroska CDL plugin from TCMP's plugin directory, will it crahs also ? Note that jcsston's CDL is highly experimental as i said, and everybody in the dev team is on 2k/XP, so it may well be that it doesnt work at all on Win98, due to the very same reasons as for our DShow parser, the missing unicode support in Win98.
Actually i found reason for crash. Just had to disable somenthing. CDL seems to work under Win98 but you should really take care that your applications and filters works under all OS's. It seems everything CoreCodec team has released so far have had first major problems with Win98/ME. I even couldn't register first builds of COREaccDs. . Just tried latest and it worked really nicely. You get easily bad reputation for yourself because there are still lots of Win98/ME users. I use windows only for some gaming and encoding, Linux for everything else. That's the reason why i am not going to upgrade.
Anyway thanks for your great work :)
robUx4
2nd June 2003, 09:38
Bah, we already have a bad reputation so we don't need to care anymore about that ;)
It seems your problem are due to TCMP, not the CDL itself. Also I'm not aware of any problem with our DSF under W98 now (any different than on W2K/XP). It's just sad that W98 has no built-in support for Unicode.
ChristianHJW
2nd June 2003, 09:41
Originally posted by Gaia I use windows only for some gaming and encoding, Linux for everything else. That's the reason why i am not going to upgrade.
Latest mplayer from CVS, compiled with matroska support, will play the test samples nicely, and even with correct AR ... dont know if AAC 5.1 is also working already, but 2.0 AAC does for sure ( according to Mosu ) . On Mosu's site ( link above ) you will also find precompiled RPMs for some Linux distro's, including libmatroska compilation.
Anyway thanks for your great work :)
Well, the only problem we have with Win9x/ME is that all our code is made to support unicode filenames already ( Asian/Arabian people do love us for that ), and that 9x/ME doesnt support unicode natively :( ....
Latest mplayer from CVS, compiled with matroska support, will play the test samples nicely, and even with correct AR ... dont know if AAC 5.1 is also working already, but 2.0 AAC does for sure ( according to Mosu ) . On Mosu's site ( link above ) you will also find precompiled RPMs for some Linux distro's, including libmatroska compilation.
I am aware of that. It's just that i don't have TV near my Linux box so i mainly use my windows system for movies. Mplayer is best Linux player and matroska support works, tried it yesterday.
Originally posted by ChristianHJW
For a typical 2 CD rip i'd probably go for the original AC3, but this is a long movie and the AC3 bitrate is 448 kbps, so this will result in a 450 MB audio file :( ...
menno an Ivan from Nero are promising the new NeroDigital AAC encoder plugin will sound undistinguishable from the AC3 at > 240 kbps, and 160 kbps is possible with very good results ...
Then why not try MPC standard in future... ( because currently mkv doesn't support MPC....... )
And i am still waiting for Sv8......... having dreaming about it for 2 years.....
robUx4
2nd June 2003, 10:13
We will, with no doubt, be the first container to support MPC as I'm helping Frank Klemm on it, he is somehow part of Matroska (a major contributor to the format) and will rely on matroska for everything non codec related.
But everything starting from SV8 is begin rewritten from scratch with a lot of C++. Don't expect anything before a few months.
CaptainCarrot
2nd June 2003, 10:14
The great thing about anmorphic resizeing is not to resize from 720 x 432 to 720 x 304 but to resize to 1024 x 432. See this way you get a lot more resolution and just a little loss in quality.
This is really kind of funny, you're all talking about resolutions even though it's all about aspect ratios.
Christion didn't resize to 720x304, he just cropped the black bars and set the aspect ration. The final res depends on the screen resolution when you watch it, so that'd be 1024x432, or 1520x641 in my case. All the resizing is done during playback.
That's how I do it RV9.
Same thing with RV9, using a higher output res than the original input res is a workaround to set the aspectration there. If you tell producer to resize from 720x432 to 1024x432 it won't resize but encode the video at 720x432 and set the aspect ratio. During playback the player will then resize the video to the screen res with correct AR.
I used to do something like that. But you do realize that this way (720x --> 888x) resizing really becomes an unnecessary filter in the chain?
As I said, there's no resizing during encoding with both methods, it's all done at playback time.
Wilbert
2nd June 2003, 12:40
About some links in the first post:
1) mkvtoolnix-0.4.1.zip is not available, when clicking on that link. I found one here: http://www.bunkus.org/videotools/mkvtoolnix/win32/.
2) Download and install the newest matroska DirectShow parser ( 0.4.2 ) from http://www.matroska.org/anounce.html. Better change that into .../announce.html.
ChristianHJW
2nd June 2003, 12:49
Originally posted by Wilbert About some links in the first post: .. thanks, fixed !
31 Flavas
2nd June 2003, 16:49
Originally posted by Teegedeck
I used to do something like that. But you do realize that this way (720x --> 888x) resizing really becomes an unnecessary filter in the chain? How so? RV9 encoder will encode the clip at 720x480, but tell RealPlayer to playback at 888x480.
Important info:
Get the latest coreaac filter version here (http://www.hydrogenaudio.org/index.php?act=ST&f=13&t=6428&st=25&#entry100781) (compiled by john33)! the one on rarewares is already out-of-date :D
btw: couldnt be the function of Trombettworks' ChannelDownmixer included in CoreAAC to make it automatically work on non 5.1 setups? would make it perfect...
so the latest coreaac filter (from john33) works on your win98 system? I am asking this because i am under winme and i can not get the filter to work (just the video plays, no sound)
No i got working build from Rarewarez.
ups just changed my last post because i already got it working! thanks anyway...
Defiler
2nd June 2003, 18:11
I thought the resize process was part of the Matroska DirectShow filter? Why exactly do we need Core Media Player for it to work?
Forgive me if this has been asked before.
Other than that, it seems to play back beautifully over here.
I'm surprised that it looks so good with 5 B-Frames. That's quite a high setting.
B-Frame Threshold = 0?
Allow me to second bond's statement that the channel downmix should be part of the AAC plugin itself. Heh.
wiflye81
2nd June 2003, 20:09
mplayer classic ( 6.4.5.2 ) dont decode AAC ( with the last coreaac filter ) but mplayer2 and TCMP ( with dyneq disable ) works fine.
Mplayer2 dont load channeldownmixer, strange or not ?
AAC is very impressive that's a good work.
Atamido
3rd June 2003, 00:09
Originally posted by Defiler
I thought the resize process was part of the Matroska DirectShow filter? Nope. Currently it is read by the CDL, which resizes the TCMP view window through TCMP's internal API.
Defiler
3rd June 2003, 01:09
Originally posted by Pamel
Nope. Currently it is read by the CDL, which resizes the TCMP view window through TCMP's internal API. Uhh.. Why? :D
Atamido
3rd June 2003, 01:20
Because so far noone knows how to pass this info from the Matroska DS filter down, past the video decoder, to the video renderer.
Defiler
3rd June 2003, 01:43
Sounds like a job for.. ffdshow Man! *swirls cape*
Oh well. Someday..
robUx4
3rd June 2003, 09:24
Originally posted by Defiler
Sounds like a job for.. ffdshow Man! *swirls cape*
Nope, unless ffdshow can handle all the codec of this planet :D
Wilbert
3rd June 2003, 09:30
AAC issues (using win2000 sp2):
Yesterday I tried the following:
1) made a 2.0 ch AAC (MP3 -> uncompressed wav -> AAC), playback is fine using the winamp plugin.
2) made a 5.1 ch AAC (AC3 from dvd2avi -> 5.1 wav with besweet -> failed to make an AAC from this using aacenc.exe:
aacenc.exe -br 220 -if test.wav -of test.aac
ERROR[-1]: EncodeInit<> error!
3) muxed it with a black avs clip (took the first 100 frames, and demuxed the AC3 with vdubmod) and converted it to 5.1 ch AAC (AC3 -> 5.1 wav with besweet -> AAC with aacenc.exe)
3a) I can't playback the 5.1 AAC using the winamp plugin, is that supposed to work?
3b) Don't know how to play it with the coreaac directshow filter. I registered it, but graphedit can't connect it with anything?
The AC3/AAC files can be found here: http://www.geocities.com/wilbertdijkhof/aac.zip
A small question:
2. Add the original AC3 to the streams list in VdubMod, mark the start and end frame and mux it into another MKV
3. Demux the AC3 from this new MKV
Is this to add a delay ?
edit: just read in the AAC thread that you have to put the AAC 5.1 ch in a MKA container. Will try that :)
SirElvis
3rd June 2003, 16:51
I'm currently playing around with aac and matroska. I've used the Nero AAC plugin to encode a 6 channel wav to aac (sounds perfect to my ears at less than half the size of the ac3). The problem is that Nero saves the file to mp4 and mkvmerge can't read that... so I've tried demuxing with mp4UI but the resulting file still can't be muxed.
mkvmerge:Error: File 01.aac has unknown type. Please have a look at the supported file types
('mkvmerge --list-types') and contact me at moritz@bunkus.org if your file type is
supported but not recognized properly.
I suppose I'm not demuxing correctly. How should I do that?
Nibor
3rd June 2003, 17:51
Read this (http://forum.doom9.org/showthread.php?s=&threadid=53657&perpage=20&highlight=mp4%20aac%20header&pagenumber=2) thread, maybe there's the solution for your problem!
Hope that helped... ?
-Nibor
Originally posted by Wilbert
3a) I can't playback the 5.1 AAC using the winamp plugin, is that supposed to work?no
3b) Don't know how to play it with the coreaac directshow filter. I registered it, but graphedit can't connect it with anything?plz reread chris' first post carefully, you need the channel downmixer filter from trombettworks!
SirElvis
3rd June 2003, 18:05
Originally posted by Nibor
Hope that helped... ?It did... thanks.
Animaniac
4th June 2003, 01:39
I have 3.77 GB 6 channel WAV, I updated the WAV DLL for Nero, but Nero crashes when I try to save the AAC. Can it not handle files so large?
Defiler
4th June 2003, 02:01
Originally posted by Animaniac
I have 3.77 GB 6 channel WAV, I updated the WAV DLL for Nero, but Nero crashes when I try to save the AAC. Can it not handle files so large? I'm having a similar problem. Nero doesn't crash, but it instantly says "done" on the encode process. I also am using the RareWares replacement WAV plugin, along with the latest version of Nero.
gabest
4th June 2003, 03:44
I found today that the latest ffdshow can already pass the AR downstream! Try it with v1.0.0.4 of my splitter.
Animaniac
4th June 2003, 03:57
Incredible! I'm not sure if this is a matter of taste or just how it is done, but video is resized along the horizontal resolution. I would feel more comfortable if it were resized vertically, since the video would be resized smaller and not larger (thereby avoiding artifacts from becoming more evident?). When you have the time (and energy), maybe it could become a config option? Regardless, this is awesome work. Thanks a lot.
Edit: It seems that changing the aspect ratio in ffdshow's works against the Matroska aspect ratio. I think both are applied, and the aspect ratio becomes neither that of Matroska or of ffdshow. This would probably be something that would need to be worked out in ffdshow though (since it's the downstream filter?).
gabest
4th June 2003, 04:04
The AR width and height makes the player resize the _window_ around the video. No information is lost there.
edit: You don't have to set the AR in ffdshow. I didn't do it and the starwars sample looked correct.
Animaniac
4th June 2003, 04:09
Originally posted by gabest
The AR width and height makes the player resize the _window_ around the video. No information is lost there.
Well what I meant was when using ChristianHJW's test clip the video becomes 1015 x 432 instead of 720 x 304 (as mentioned earlier). I'm not sure which should be preferred, since in the former the vertical is being held constant and in the latter the horizontal is being held constant. I would think that either is fine, but with the former you're going from a smaller source resoultion to a larger resolution. In the latter is the opposite, and it's just that I've learned resizing to larger than the source is not a good idea. Maybe I'm misinformed (and being nit-picky).
Edit: Yeah I know, but on the off-chance that someone wanted a different aspect ratio, the ffdshow one should override the Matroska one, I think. I would assume that this would need to be programmed into ffdshow.
gabest
4th June 2003, 04:19
Well what I meant was when using ChristianHJW's test clip the video becomes 1015 x 432 instead of 720 x 304 (as mentioned earlier). I'm not sure which should be preferred, since in the former the vertical is being held constant and in the latter the horizontal is being held constant. You can resize the player's window to any resolution you want, the true resolution which is resized remains 720x432.
Animaniac
4th June 2003, 04:40
Originally posted by gabest
You can resize the player's window to any resolution you want, the true resolution which is resized remains 720x432.
Hmm, ok. It seems that WMP9 and MPC resize it to 1015 x 432, while WMP6.4 doesn't. WMP6.4 (and GraphEdit) just corrects the aspect ratio by shrinking veritcally. The properties page in WMP9 shows 1015 x 432 as the resolution, MPC shows 720 x 432 (AR: 1015 x 432), and WMP6.4 shows 720 x 432. WMP6.4 produces the image that I think is correct. I think I am just confused... >.<
gabest
4th June 2003, 04:47
WMP64 behaviour is very unusual in this question. While running windowed it does not correct the aspect ratio, but if you put it on fullscreen then does.
Animaniac
4th June 2003, 04:52
Originally posted by gabest
WMP64 behaviour is very unusual in this question. While running windowed it does not correct the aspect ratio, but if you put it on fullscreen then does.
On my system it seems to be correcting in both modes. The windowed mode produces a window with dimensions 720 x 432 but there are black bars and the video appears to be 720 x 304.
ChristianHJW
4th June 2003, 06:18
Originally posted by Animaniac On my system it seems to be correcting in both modes. The windowed mode produces a window with dimensions 720 x 432 but there are black bars and the video appears to be 720 x 304.
TCMP with the CDL will show the very same behaviour, dont ask me why that is, obviously DShow is preparing an output window of the original size of the video ( 720 x 432 ) and then is calling the resizing filter to squash vertical resolution down to 304, so that the AR is correct again.
The important thing is happening if yu go fullscreen, because this is where the real advantage is achieved, as now you are expanding a 432 res to something like > 500 lines, instaed of a 304 res to > 500, depending on your monitor resolution ....
ChristianHJW
4th June 2003, 06:20
Originally posted by gabest
I found today that the latest ffdshow can already pass the AR downstream! Try it with v1.0.0.4 of my splitter.
wooooot ! It does ? Do you have any description of how to call other ARs ? And how can you use DShow means to pass the info to it ?
Lobuz
4th June 2003, 06:52
Could someone confirm that with ffdshow that Christian's testing clip looks worse then with XviD dll? It can be noticed at first 50 frames when after animals at left side of screen there are small gray areas. After switching to xvid dll or Xvid decoder it disappeare. Is it the bug of encoder or decoder libavcodec ( tested few versions )? Or something with my comp is bad.
ps. I can't demux only video from this file with mkvmerge.
Regards
Lobuz
Animaniac
4th June 2003, 06:59
Originally posted by Lobuz
Could someone confirm that with ffdshow that Christian's testing clip looks worse then with XviD dll? It can be noticed at first 50 frames when after animals at left side of screen there are small gray areas. After switching to xvid dll or Xvid decoder it disappeare. Is it the bug of encoder or decoder libavcodec ( tested few versions )? Or something with my comp is bad.
ps. I can't demux only video from this file with mkvmerge.
Regards
Lobuz
I saw the grey-spots too, but didn't bother to switch to xvid.dll.
I can confirm that libavcodec has them but xvid does not.
Lobuz
4th June 2003, 07:11
@ChristianHJW
Did You use the latest XviD codec? Could you investigate it and try to find the source of this strange spots. I mean, if it's there with standard options too? So we could bother ffdshow or XviD developers.
Regards
Lobuz
gabest
4th June 2003, 07:29
To me is slows down and skips a lot of frames at one point at the beginning if decoded with ffdshow.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.