Encoding hard sub optimization HQ

For questions on the technical aspects about how to fansub. Come on, share those pearls of wisdom!
User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Encoding hard sub optimization HQ

Postby Averroes » Thu Nov 13, 2008 10:04 am

Hi everyone,

I have some questions in order to improve the quality of my hardsub release, and why not decreasing the size of these releases.

Currently, I use a simple two pass xvid compression keeping the same size as the raw (more or less) and using textsub.
But I am not proud of the result. Mainly because subtitles rendering is quite pixelized near the subtitles zone

Whatever solution you propose or way to solve this, I don't care about the time that take to my computer to encode.
But the size needs to be below the raw's size.
After few searching, I found out that avisynth comes often in some boards but they talks about anime.

Firstly about Xvid or Divx,
Is there some filters in order to improve the quality of drama hardsubbed?
Or is there a better alternative to Textsub VirtualDub Filter?

If you have some tuto or link, I am not afraid of reading.

Secondly what about H264,
Is virtualdub supporting H264 or is there another software?

Thank you.

My goal is to release the best quality (hardsubbed) but more convenient (H264 is an old PC killer and unfriendly with some devices)

Sorry for my english, but I am french and I need some sleep.

jholic
Global Moderator
Global Moderator
Posts: 4491
Joined: Tue Feb 03, 2004 7:53 pm
Location: missin' hawaii

Postby jholic » Fri Nov 14, 2008 3:32 am

good questions, but since your post is mostly regarding subbing, i'm going to duplicate your post in the fansub section. perhaps you'll get more views.
Use THUMBS UP/DOWN buttons to KEEP or DELETE posts.
If you see SPAM or ABUSE, use the REPORT button.

User avatar
itsukiD
Posts: 111
Joined: Wed May 30, 2007 4:31 am
Location: California

Postby itsukiD » Sat Nov 15, 2008 12:52 am

hmm, ever thought of using the mkv container?

demux your video into video/audio/subtitle... ie sample.avi/sample.mp3/sample.srt
convert your video file into h264, as far as software, maybe sony vegas?

compile final project with mkvtoolnix

u'll have almost the same video quality with optional subtitles that can be turned on n off. no more pixelation around the subs and less encoding (except for the h264 conversion)

g'luck
D

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Sat Nov 15, 2008 1:27 am

Thank you for your response.

I have thought about mkv but it's limited to computers.

For me mkv is dead for some reason that will create some troll.

What I meant behind this post is to advanced encoders share their tricks for giving a good quality in xvid/divx/H264 with a small size.
Because they know the problem with the drama RAW and know how to handle them.

H264 is ok for me but I won't upload a hardsub knowing that 1/3 of downloaders can't play it because of a lack of memory/cpu.

I'm still continuing my tests on some filters for avisynth for the raws of Celeb to Binbo Danshi and my problem of pixels near the subtitles

User avatar
eye
Posts: 120
Joined: Tue May 02, 2006 8:20 pm

Postby eye » Sat Nov 15, 2008 3:31 am

Averroes wrote:I have thought about mkv but it's limited to computers.

For me mkv is dead for some reason that will create some troll.

If you think MKV is dead, don't ask for H.264. Most standalone DVD players can't play back H.264 even if you wrap it in AVI containers.

H264 is ok for me but I won't upload a hardsub knowing that 1/3 of downloaders can't play it because of a lack of memory/cpu.

CPU load of H.264 decoding largely depends on the settings used for encoding. Even iPods can play back H.264 in standard definition (480p).
Image

User avatar
AkumaX
Global Moderator
Global Moderator
Posts: 1227
Joined: Thu Apr 20, 2006 12:50 am
Contact:

Postby AkumaX » Sat Nov 15, 2008 3:52 am

i'd recommend the .mp4 container, since it seems to be the de facto standard for a lot of the major hardware manufacturer brands that support h.264 are using it (psp, iphone, ipod, ps3, xbox, archos, etc...)

ImL0st
Posts: 347
Joined: Thu Oct 25, 2007 12:11 pm

Postby ImL0st » Sat Nov 15, 2008 3:53 am

Used to use virtualdub but it require setting text filter for every sub file. Now I use Mediacoder, it auto regconizes subfiles and I don't see any problem with the text quality (I only did 1 pass). It can do both divx and .h264

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Sat Nov 15, 2008 2:48 pm

Thank you all,

H264 is not dead like MKV container for me (because the same reason mentioned by AkumaX.

I'm going to try Mediacoder

User avatar
itsukiD
Posts: 111
Joined: Wed May 30, 2007 4:31 am
Location: California

Postby itsukiD » Sat Nov 15, 2008 7:02 pm

so here's a little test i did:

i took an ogm file, demux'd to avi file, ogg file, and a ass file.
converted the ogg file to mp3
opened the avi file in vdub, added each stream, then saved.
the final product avi file with toggled subtitle.

did this test once again with a srt file instead of the ass file.
result no subtitles whatsoever.

virtualdub guru's, can someone explain how this happened?

D

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Sat Nov 15, 2008 8:01 pm

Do you use virtualdub or virtualdubmod.

You need to do a full processing on the video (encode) with using Textsub filter for subtitles in order to add subtitles.

User avatar
eye
Posts: 120
Joined: Tue May 02, 2006 8:20 pm

Postby eye » Sat Nov 15, 2008 9:53 pm

Averroes wrote:H264 is not dead like MKV container for me (because the same reason mentioned by AkumaX.

MKV is going to be the official container format for DivX 7. Once you realize that DivX-certified home theater systems are the only reason why fansubbers still use AVI today, you'll know what they will be using tomorrow. MKV will be the new AVI. MP4 will be dead just like MOV.
Image

Hoshiko
Posts: 22
Joined: Sun Mar 16, 2008 4:23 am

Postby Hoshiko » Sat Nov 15, 2008 10:00 pm

eye wrote:
Averroes wrote:H264 is not dead like MKV container for me (because the same reason mentioned by AkumaX.

MKV is going to be the official container format for DivX 7. Once you realize that DivX-certified home theater systems are the only reason why fansubbers still use AVI today, you'll know what they will be using tomorrow. MKV will be the new AVI. MP4 will be dead just like MOV.


I'd have to agree with eye on this one. MKV's quality is much higher and file size is smaller than if it were AVI.

I'm not a real fan of MP4 even if it's compatible with so many electronics. When it comes to quality, it can't beat MKV.

User avatar
AkumaX
Global Moderator
Global Moderator
Posts: 1227
Joined: Thu Apr 20, 2006 12:50 am
Contact:

Postby AkumaX » Sat Nov 15, 2008 10:09 pm

eye wrote:
Averroes wrote:H264 is not dead like MKV container for me (because the same reason mentioned by AkumaX.

MKV is going to be the official container format for DivX 7. Once you realize that DivX-certified home theater systems are the only reason why fansubbers still use AVI today, you'll know what they will be using tomorrow. MKV will be the new AVI. MP4 will be dead just like MOV.


if this is true, and my iphone/psp/ps3/xbox all start supporting .mkv, then i will wholeheartedly support .mkv

there is one device i've found that supports .mkv, its definitely worth taking a look:

http://www.d-addicts.com/forum/viewtopic_67456.htm

________________________________________________


Hoshiko wrote:I'd have to agree with eye on this one. MKV's quality is much higher and file size is smaller than if it were AVI.

I'm not a real fan of MP4 even if it's compatible with so many electronics. When it comes to quality, it can't beat MKV.


do you even know what the difference is between .mkv and .mp4...

User avatar
eye
Posts: 120
Joined: Tue May 02, 2006 8:20 pm

Postby eye » Sun Nov 16, 2008 12:09 am

AkumaX wrote:if this is true, and my iphone/psp/ps3/xbox all start supporting .mkv, then i will wholeheartedly support .mkv

I think we all know that those devices will never support MKV, but even if they did, it would not help because right now it is very difficult, if not impossible, to produce high quality H.264 files compatible with all of these devices. They share a common container format but not much else. For example, the iPhone/iPod does not support the H.264 main profile, i.e. it can't handle B-frames, 8x8 DCT, CABAC etc. -- basically most of the stuff that makes H.264 superior in the first place. The other devices have similar restrictions. Their common container format won't save you from re-encoding the content.

MP4 is the "official" container not just for H.264 but for MPEG-4 SP/ASP (aka. Xvid) as well. On the other hand, Xvid in AVI had been a dirty hack from the very beginning (remember "packed bitstreams"?), but sometimes de-facto standards surpass the official ones in popularity. And that is exactly what happened here, due to DivX Inc. working closely with manufacturers of cheap multi-format DVD players. Their market penetration seems to be much larger than Apple's or Sony's. When they adopt DivX 7, x264 will be the new Xvid, and MKV will be the preferred container format for "non-premium content".
Image

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Sun Nov 16, 2008 1:19 am

Of course all that is a good debate to take on and speculate.

I'm going to redefine my first topic.
My mind now is to do the best AVI quality with the less size and improve the quality of the rendering subs by Textsub. So I'm going to stick to DIVX/XVid and MP3.

I don't care for now about mkv and mp4 for the reason that you can see above. (Support (mkv)and no standard between devices (mp4))

Does anyone have a good avs script for avisynth that can improve the quality of the raws and the subs rendering?
If there is another way to improve, I'm ok but it's need to be Xvid/Divx and MP3.
For a simple reason, that I'm not here to educate on codec installation and to face some computer performance issue.
In IRL I work with some people that write on a post it there birthdate, using as password, because they are afraid to forget it. So if I tell them to install this and configure I'm going to shoot my self before Windows/Leopard starts.

User avatar
itsukiD
Posts: 111
Joined: Wed May 30, 2007 4:31 am
Location: California

Postby itsukiD » Tue Nov 18, 2008 6:14 am

Averroes wrote:Do you use virtualdub or virtualdubmod.

You need to do a full processing on the video (encode) with using Textsub filter for subtitles in order to add subtitles.


i used virtualdubmod... thats the thing, for both "tests" i didnt use full processing, i just added the subtitle files as streams, direct stream copy. I know i how to hard sub, but like you i dont usually get the quality that I'm happy with, so I did these tests.

when the first test worked, i was happy, cuz i didnt have to re-encode the video with full processing or fast recompress and the subtitles can be selected or deselected in the future when the desired language is learned and the file size is maybe a 1 MB more.

u can also do this with divxmuxGUI but the catch here is you have to play them on DIVX approved software or hardware in order enable the subtitles. tried playin one of these files on WMP/MPC/VLC no subtitles to be found.

aite... good luck
D

User avatar
bmwracer
Posts: 2789
Joined: Fri Aug 12, 2005 12:12 am
Location: Juri-chan's speed dial

Postby bmwracer » Tue Nov 18, 2008 6:36 am

Averroes wrote:Does anyone have a good avs script for avisynth that can improve the quality of the raws and the subs rendering?
If there is another way to improve, I'm ok but it's need to be Xvid/Divx and MP3.

When I hardsub with VirtualDub, I never fool around with any scripts: I just use the TextSub filter and set my xViD encoding to the maximum quality setting (q=1)... The encoded files do get large, but it's the price you pay for the best image quality. :)
If you need me to seed Ueno Juri-chan or Yonekura Ryoko-chan stuff, please PM me. :salut:

User avatar
AkumaX
Global Moderator
Global Moderator
Posts: 1227
Joined: Thu Apr 20, 2006 12:50 am
Contact:

Postby AkumaX » Tue Nov 18, 2008 3:47 pm

Averroes wrote:Of course all that is a good debate to take on and speculate.

I'm going to redefine my first topic.
My mind now is to do the best AVI quality with the less size and improve the quality of the rendering subs by Textsub. So I'm going to stick to DIVX/XVid and MP3.

I don't care for now about mkv and mp4 for the reason that you can see above. (Support (mkv)and no standard between devices (mp4))
Does anyone have a good avs script for avisynth that can improve the quality of the raws and the subs rendering?
If there is another way to improve, I'm ok but it's need to be Xvid/Divx and MP3.
For a simple reason, that I'm not here to educate on codec installation and to face some computer performance issue.
In IRL I work with some people that write on a post it there birthdate, using as password, because they are afraid to forget it. So if I tell them to install this and configure I'm going to shoot my self before Windows/Leopard starts.


yes, we went off on a tangent here, but at least there might be people that might/would be interested in what we have to say :)

so going back to your refined question then, the only thing i could think of is possibly installing the latest DivX (6.8.2?), since "they" say its higher quality than XviD, and of course doing 2-pass.

itsukiD has a point with "muxed softsubs", the newest DivX has a new "softsub" feature (selectable on/off streams), which converts .srt to (DivX) XSUB (think idx/sub files from a dvd - they are essentially .bmp's), and PS3's can use them also, but you'd have to use the Official DivX Desktop Player to play them (as itsukiD also said, nothing else like vlc/mpc/etc.. supports them)

you're hoping to teach people how to do this when they need post-it notes for their birthdays? *shudder*

-------------------------------------------------------------
eye wrote:I think we all know that those devices will never support MKV, but even if they did, it would not help because right now it is very difficult, if not impossible, to produce high quality H.264 files compatible with all of these devices. They share a common container format but not much else. For example, the iPhone/iPod does not support the H.264 main profile, i.e. it can't handle B-frames, 8x8 DCT, CABAC etc. -- basically most of the stuff that makes H.264 superior in the first place. The other devices have similar restrictions. Their common container format won't save you from re-encoding the content.


how to tackle this...
if you say divx 7 will get .mkv, then PS3 will have to get .mkv since it is a DivX certified device, so :D
uhhh yeah, you're going to have to re-encode no matter what, regardless of container
you'd have to re-encode as to per that device/software. is high profile exactly necessary in a device that only supports resolutions up to 480x320? there is one thing though.. (see below)
i feel this is like hd-dvd vs. blu-ray, but for video media containers. i don't care who wins, i just want it to be standardized!!

MP4 is the "official" container not just for H.264 but for MPEG-4 SP/ASP (aka. Xvid) as well. On the other hand, Xvid in AVI had been a dirty hack from the very beginning (remember "packed bitstreams"?), but sometimes de-facto standards surpass the official ones in popularity. And that is exactly what happened here, due to DivX Inc. working closely with manufacturers of cheap multi-format DVD players. Their market penetration seems to be much larger than Apple's or Sony's. When they adopt DivX 7, x264 will be the new Xvid, and MKV will be the preferred container format for "non-premium content".


XviD/DivX in .avi is considered de-facto, because of the wide popularity (and compatibility also in many devices). virtualdubmod's avi muxing also has a LOT of overhead, more than you would think! (thank you packed bitstreams :\) however, h.264 in an .avi is definitely a hack since nothing can read them but a PC -_-.

the new h.264 (SVC?) will have the ability for older/simpler devices to decode playable streams from more complicated streams (as in, a special way of encoding High Profile for HD devices, but having simple devices still be able to play them back (probably in Baseline mode or something). as to what container theyre going to use, ???
but it's kinda stupid, because if you have a device that only supports Baseline Profile, why would you want to stuff it with a giant (Hi Profile) file that takes up tons of space...

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Tue Nov 18, 2008 4:57 pm

Thank you AkumaX.

I'm going to try Divx softsub feature and see the quality.

I know it's very interesting this debate about container, which for a normal person implies (this or that codec), but unfortunatly there will never be any standardization except if Divx company promote the support on all devices (Ipod too :p).

User avatar
eye
Posts: 120
Joined: Tue May 02, 2006 8:20 pm

Postby eye » Tue Nov 18, 2008 7:17 pm

AkumaX wrote:is high profile exactly necessary in a device that only supports resolutions up to 480x320?

Not high profile, but main profile. The latest iPods actually support full DVD resolution up to 720x576. You can connect them to standard TV sets to take advantage of that. H.264 main profile support would make perfect sense here. There are other portable players (e.g. by COWON) that already support it (and MKV too). But unlike DivX, Apple is not interested in setting interoperability standards, except between Macs and iPods of course. :D

DivX 7 will implement H.264 main profile, level 4.0. Of course it aims at HD content, but SD content will benefit too. Smaller files, faster downloads, without sacrificing quality.
Image

User avatar
AkumaX
Global Moderator
Global Moderator
Posts: 1227
Joined: Thu Apr 20, 2006 12:50 am
Contact:

Postby AkumaX » Tue Nov 18, 2008 7:41 pm

eye wrote:
AkumaX wrote:is high profile exactly necessary in a device that only supports resolutions up to 480x320?

Not high profile, but main profile. The latest iPods actually support full DVD resolution up to 720x576. You can connect them to standard TV sets to take advantage of that. H.264 main profile support would make perfect sense here. There are other portable players (e.g. by COWON) that already support it (and MKV too). But unlike DivX, Apple is not interested in setting interoperability standards, except between Macs and iPods of course. :D

DivX 7 will implement H.264 main profile, level 4.0. Of course it aims at HD content, but SD content will benefit too. Smaller files, faster downloads, without sacrificing quality.


Yeah, currently today's "simple" devices mostly only support Baseline. Bummer.
If DivX 7 bring a revolution of Main profile into today's devices, that would be a welcome change.

Well, you know that Apple's official compatibly for its ipods/iphones are Baseline 3. At least the good thing about it is if any movie (say, a 1080p HD movie trailer) is QuickTime compatible, it's most likely iTunes compatible, which means you can go into iTunes/Advanced and have it convert to ipod compatible media.

User avatar
atskv9
Posts: 891
Joined: Mon Aug 06, 2007 12:09 am

Postby atskv9 » Tue Nov 18, 2008 11:37 pm

AkumaX wrote:virtualdubmod's avi muxing also has a LOT of overhead, more than you would think! (thank you packed bitstreams :\)

I'm sorry to go off on a tangent again, but do you have a recommendation for software that causes less overhead?

boyhuesd
Posts: 4
Joined: Mon Oct 20, 2008 4:53 pm

Postby boyhuesd » Wed Jan 28, 2009 3:15 pm

Averroes wrote:Of course all that is a good debate to take on and speculate.

I'm going to redefine my first topic.
My mind now is to do the best AVI quality with the less size and improve the quality of the rendering subs by Textsub. So I'm going to stick to DIVX/XVid and MP3.

I don't care for now about mkv and mp4 for the reason that you can see above. (Support (mkv)and no standard between devices (mp4))

Does anyone have a good avs script for avisynth that can improve the quality of the raws and the subs rendering?
If there is another way to improve, I'm ok but it's need to be Xvid/Divx and MP3.
For a simple reason, that I'm not here to educate on codec installation and to face some computer performance issue.
In IRL I work with some people that write on a post it there birthdate, using as password, because they are afraid to forget it. So if I tell them to install this and configure I'm going to shoot my self before Windows/Leopard starts.


I don't expert in encoding but I may share my experiences, what i got through testing and googling.
- stop using virtualdub (mod) in encoding, instead I advice you to be familiar now with MeGUI. It's pretty better. (support Mpeg 4 AVC and ASP (Xvid and H264), also three popular container are mkv, avi, mp4)
- And then, if you want to use MeGUI, you must know how to write AVS script, go to: http://avisynth.org
- When you know how to write an AVS script and how to configure your codec (Xvid or H264) to the best settings for you video output. Try some AVS tricks to get a better video and compressing here: http://www.aquilinestudios.org/avsfilters/index.html (thought it's focus about anime video but some filters is good for compressing your drama videos)
- and remember 2 things: testing and googling.
All of things you need is fully explained somewhere. just find it.

and... I'm not really good at English, so sorry for any grammar errors. :-)

boyhuesd
Posts: 4
Joined: Mon Oct 20, 2008 4:53 pm

Postby boyhuesd » Wed Jan 28, 2009 3:20 pm

and, just a bit recommend, if the original Mp3 Audio of your raws don't take too much in total size of your release, just demux it from the raws. Then re-mux it with your re-encoded video.

User avatar
Averroes
Posts: 130
Joined: Sun Nov 09, 2008 11:22 pm
Location: Paris, France

Postby Averroes » Wed Jan 28, 2009 3:21 pm

Thank you boyhuesd.

I was looking for the avs script tricks. I found a lot for anime but I was wondering if someone is using specifc that are more relevant to Drama.

Edit : I always demux my Audio before reecondig with subs

boyhuesd
Posts: 4
Joined: Mon Oct 20, 2008 4:53 pm

Postby boyhuesd » Wed Jan 28, 2009 3:26 pm

My friends (he's a good encoder in anime) tell me that anime video and drama video is different, so don't rely so much in avisynth filters in drama video encoding. Just use some soft filters. :)

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 3577
Joined: Sun May 02, 2004 8:33 pm
Location: Land of the Sub-Prime

Postby XrayMind » Wed Feb 11, 2009 11:33 pm

Having done both anime and drama encoding in XviD/DivX and h264. I use avisynth for both anime and drama without any issues.

For SD output. I will write up an avisynth script avisource or directshowsource the video, resize the video if needed or textsub any needed subtitles. Unlike the previous poster said, I rely heavily on the filters in avisynth and I can also load in vdub filter, but it's a bit tricky. I only use the filters when I capture the video myself, as they are broadcast in interlace and color/brightness/contrast are off. Then I load the avs script into VirtualDubMod and load in the demux mp3 from the source. Set vdub to faster processing, as I don't use any filter in vdub, and always do a 2 pass encoding. Around 900kbps for anime and 1200kps for drama.

For 1280x720 HD output. On anime, I don't bother to re-encode the video or audio. Take the 1280x720 mp4/mvk raw file, mux the subtitle file(s), attached the need font(s), create the chapter file, and mvkmerge all them into one .mvk file. On drama or anime, where you want the file to be a fix size. Then create the avs script just with directshowsource without any filtering and load in subtitles, if needed. Load the avs script into megui. Figure out how big is the demux audio file and if you are doing softsub, the subtitles and font files sizes. If you are doing hardsub and re-encoding the audio to AAC, then let megui AutoEncode to the size you want. I use x264: DXVA-HD-Balanced for video.

Now, for people who are familiar with vdub's filters and want to use it and output to mp4 or mkv. Just start using vdub's frame server. I won't go into how to setup the frame server, but I tell you how to use it with megui. Google how to setup vdub frame server, if needed. So run vdub or vdubmod, have filters apply to your video, start frame server under the File menu, start the frameserver with the default name, and save under .vdr name(don't save as .avi). Create avs script with avisource pointing to .vdr file. Load the avs file into megui, it will add 'ConvertToYV12' for you or you could manually put that in. Note: On my system, megui will crash or give you an error before each of the 2 video passes. Just restart megui and change the status to waiting on error pass and restart failed pass.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.


Who is online

Users browsing this forum: No registered users and 1 guest