Homebrew Converting MKV with subtitles to DPG

Do you want to know how I solved this problem?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
<a href='index.php?act=findpost&pid=2703170'><b><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--> - I've found the solution. Click here for the guide. -<!--sizec--></span><!--/sizec--></b></a>

I have spent an entire day trying to get this to work, so any help is greatly appreciated.

Some definitions:
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> - audio is scratchy, video is blocky, subtitles are unreadable
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->Acceptable<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> - audio is fine but sounds compressed, video is watchable, subtitles are readable
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><!--coloro:#2E8B57--><span style="color:#2E8B57"><!--/coloro-->Great<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> - audio is clear, video is clear, subtitles are how they should be

Well, here's the deal. I am trying to convert a video to DPG format.
It is an .mkv encoded in h264 AVC and AAC with embedded subtitles in both SSA and SRT format.
I want the DPG video to maintain the original 16:9 aspect ratio, and have <!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->Acceptable<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> audio, video and subtitles.

The video info from MediaInfo can be found at the bottom of this post.

I have attempted to convert this video using <b><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->five<!--sizec--></span><!--/sizec--></b> programs, with various settings for each.
It would take too long to describe the settings that I used for all of these programs, so here is a basic rundown.

<b>For audio:</b> I always attempted to use the maximum quality that the GUI would allow. For example, in batchDPG, I chose 128kbps, in SUPER and the others, I chose 256kbps.

<b>For video:</b> I always attempted to use the maximum quality that the GUI would allow without going above the DPG spec for that program. For example, in batchDPG I assumed that it was converting to DPG1/2 so I chose a video bitrate of 256-384kbps, in DPGenc, I chose a video bitrate of 1024kbps.

<b>For subtitles:</b> I did all I could to get the subtitles to encode. DPGenc and Xilisoft do not seem to have support for subtitles. For batchDPG, I extracted the subtitles using mkvtoolnix, and fed them into the GUI. For AlltoAVI, no special setup was needed for the subtitles, but the max size "Arial_28" was too small to be readable on the DS. The output from AlltoAVI was fed through DPGenc, to produce the latest DPG4 spec.

Here are the results from these five methods. These are all being played using an installation of Moonshell 2.1.0 :

<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->DPGenc<ul><li>Video: <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->Acceptable<!--colorc--></span><!--/colorc--></li><li>Audio: <!--coloro:#2E8B57--><span style="color:#2E8B57"><!--/coloro-->Great<!--colorc--></span><!--/colorc--></li><li>Subtitles: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Crashes DS?: <!--coloro:#00FF00--><span style="color:#00FF00"><!--/coloro-->No<!--colorc--></span><!--/colorc--></li><li>Notes: Doesn't support subtitles, DPGenc included with Moonshell 2.1.0</li></ul>
batchDPG<ul><li>Video: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Audio: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Subtitles: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Crashes DS?: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->At Start<!--colorc--></span><!--/colorc--></li><li>Notes: Video output is unplayable, batchDPG u1.6.0</li></ul>SUPER<ul><li>Video: <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->(un)Acceptable<!--colorc--></span><!--/colorc--></li><li>Audio: <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->(un)Acceptable<!--colorc--></span><!--/colorc--></li><li>Subtitles: <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->Acceptable<!--colorc--></span><!--/colorc--></li><li>Crashes DS?: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->At End<!--colorc--></span><!--/colorc--></li><li>Notes: Video and audio are out of sync, but subtitles are simply included from the mkv!</li></ul>
Xilisoft<ul><li>Video: <!--coloro:#2E8B57--><span style="color:#2E8B57"><!--/coloro-->Great<!--colorc--></span><!--/colorc--></li><li>Audio: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Subtitles: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Crashes DS?: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->At End<!--colorc--></span><!--/colorc--></li><li>Notes: Audio is scratchy, doesn't support subtitles</li></ul>AlltoAVI<ul><li>Video: <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro-->Acceptable<!--colorc--></span><!--/colorc--></li><li>Audio: <!--coloro:#2E8B57--><span style="color:#2E8B57"><!--/coloro-->Great<!--colorc--></span><!--/colorc--></li><li>Subtitles: <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Unacceptable<!--colorc--></span><!--/colorc--></li><li>Crashes DS?: <!--coloro:#00FF00--><span style="color:#00FF00"><!--/coloro-->No<!--colorc--></span><!--/colorc--></li><li>Notes: Subtitles are too small to read, even on largest AlltoAVI size of "Arial_28"</li></ul><!--sizec--></span><!--/sizec-->
Now, here is your mission, should you choose to accept it. <a href="http://www.mediafire.com/?ew1mxzzgiew" target="_blank"><b>This is a 30 second sample of the video</b></a> I am trying to encode, as split by mkvtoolnix.
I'd like you to take this video and convert it using any method that you have that produces a video that is <!--coloro:#0000FF--><span style="color:#0000FF"><!--/coloro--><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Acceptable<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--> or above in the four categories listed above.

<b>Ideally, you could show me how to produce a DPG from this video using SUPER that happens to be in-sync, as SUPER is simply able to grab the subtitles from the mkv.</b>

Yes this 30s clip is copyrighted material, but I'm sure that for this educational purpose and due to it's short duration it falls under fair-use laws. It's not even as bad as linking to a YouTube video, as the BBcode help does.

In addition, <a href="http://www.mediafire.com/?eda3hjned3a" target="_blank">here are the "5 best" DPG videos</a> that I have been able to encode using the above programs.

The MediaInfo:
<pre>General
Complete name : C:\Users\~
Format : Matroska
File size : 171 MiB
Duration : 24mn 9s
Overall bit rate : 991 Kbps
Encoded date : UTC 2007-10-27 11:48:04
Writing application : mkvmerge v2.0.2 ('You're My Flame') built on Feb 21 2007 23:40:55
Writing library : libebml v0.7.7 + libmatroska v0.8.1
Cover : Yes / Yes / Yes

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 8 frames
Muxing mode : Container [email protected]
Codec ID : V_MPEG4/ISO/AVC
Duration : 24mn 8s
Nominal bit rate : 857 Kbps
Width : 1 024 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.061
Title : ~
Writing library : x264 core 54 svn-635M
Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / brdo=1 / mixed_ref=1 / me_range=24 / chroma_me=1 /
trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=2 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 /
direct=1 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=857 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 /
qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.0:15.0
Language : English

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : A_AAC
Duration : 24mn 9s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Title : 2.0 AAC
Language : Japanese

Text #1
ID : 3
Format : ASS
Codec ID : S_TEXT/ASS
Codec ID/Info : Advanced Sub Station Alpha
Title : ASS
Language : English

Text #2
ID : 4
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Title : SRT
Language : English

Menu
00:00:00.000 : en:Prologue
00:02:01.100 : en:Opening
00:03:31.700 : en:~
00:22:10.000 : en:Ending
00:23:40.100 : en:Preview</pre>
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
I have found a solution to my problem of the kind that only hours and hours of fiddling can produce.

If anyone is interested please vote on the poll.

I'll post the solution if I get 10 "Yes" votes.

I'll check back after a few hours. Right now I need to sleep.
 

Blackiris

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
217
Trophies
0
Location
5th Street/8th Street
Website
Visit site
XP
81
Country
I agree with JP, but I voted yes anyway. I want to watch K-On on my DS, is all
rofl2.gif
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
Extract the Subs from MKV...
Convert MKV to AVI...
Resize the video to 256x192...
Hard-sub the final video...
Encode to DPG...


Anyway, voted "No" because it is a very stupid and shallow idea to hold the solution to a problem YOU asked.
How would you feel if you asked for help and someone came and posted "I'll answer this if 10 people comment thanking me"?
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,485
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,910
Country
United States
twiztidsinz said:
Extract the Subs from MKV...
Convert MKV to AVI...
Resize the video to 256x192...
Hard-sub the final video...
Encode to DPG...


Anyway, voted "No" because it is a very stupid and shallow idea to hold the solution to a problem YOU asked.
How would you feel if you asked for help and someone came and posted "I'll answer this if 10 people comment thanking me"?
Lol, at least I know that I'm not the only one that takes such a boring route to subtitle a dpg.
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
Well, there's ten votes, but one of them is mine. I suppose it counts.

Here's an easy way to go from MKV to DPG.

1. Download the latest version of AlltoAVI, install it.
2. Before running AlltoAVI, we need to change how it handles subtitle fonts. Go to AlltoAVI's font configuration directory. On 64bit versions of Windows this would be located at %ProgramFiles(x86)%\AlltoAVI\bin\mplayer, or on 32bit versions of Windows, %ProgramFiles%\AlltoAVI\bin\mplayer. Just slap those strings in a run box if you installed to the default path. Otherwise navigate to that directory.
3. Delete everything there. That includes some ISO specified font files, and a directory called "font".
4. Open up notepad, right click and run as administrator. Paste this in: subfont-text-scale=3.5
4a. You just set your font size as a percentage of the frame size. Numbers can vary from 1 to 100. 3.5 works for me.
5. Save the document as mencoder.conf to the mplayer directory indicated above.
6. Now go to your Windows Fonts folder %windir%\fonts , and pick a nice, easy to read, font for your subtitles. Segoe UI Semibold does it for me.
7. Copy the .ttf file into the mplayer directory and rename it subfont.ttf . At this point things should be looking like the screenshot below.
mplayerfolder.png
Note: Once you have completed steps 1 through 7 you never need to do them again.

8. Open AlltoAVI, right click and run as administrator. Add your mkv file, click "no" if it suggests restrictive mode. Set your settings as shown in the screenshot below. Use your media player or mkvtoolnix or mediainfo to determine which subtitle stream is the one that you want. Note that there will be an "Error" next to font folder. DO NOT CLICK THE "CHANGE FONT" button, it will overwrite the files we just created. The height and width depends on your video.
alltoavisetup.png
9. Add the job, click convert, and wait until it is finished. On a modern quad core this takes about 10 minutes for a 24 minute episode.

10.
Look in the directory of your video for a directory called "Converted" to find your avi file, keep this directory open.

11. Download the latest moonshell from the official website, install it onto your NDS memory stick. Obviously you only need to do this every time moonshell is updated.

12.
Look in the moonshell directory for \misctools\DPGTools\dpgenc.exe , open it. Set your options as shown below. Note: Upon further testing, an audio bitrate of 192kbps and a video bitrate of 512kbps may be required for smooth playback of scenes with a lot of action.
dpgencsetup.png
13.
Drag your video onto the portion of the dpgenc window as indicated, and the conversion will start automatically. I recommend dpgenc as it creates proper DPG4 files with thumbnails. This process also takes about 10 minutes on a modern quad core processor for a 24 minute episode.

14. Note that both of these programs support batch encoding. Copy the completed DPG file to your DS and enjoy.

FAQ

1. Your video is ahead of your audio, your video is behind your audio, or the video is cut short:
Make sure to choose the "force no skipping frames' option in AlltoAVI, choose the "hard code all duplicate frames" option in AlltoAVI

2. dpgenc fails to convert:
Choose ffmpeg from the drop down menu at the top of dpgenc's options

3. Are there more options for the way subtitles are displayed?
Yep, just read up on mencoder.conf files.

4. I need a small mkv file to test my subtitle settings.
Well, you're in luck. The subtitle stream that you want to test with is "1 eng" not 0.

5. Does this method require me to have a subtitle file in .srt or SSA?
No, that's the point of using AlltoAVI. It does the subtitle work for you, but you have to manually change the font and size.

6. How did you figure this out?
I got very frustrated with the way AlltoAVI was handling fonts. So I tried some manual mencoder encodes. Turns out it was easy enough to merge my knowledge of mencoder at that point to be used with AlltoAVI. I would contact the developer of AlltoAVI with this information, but he hasn't updated the project in three years so he probably doesn't care.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,485
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,910
Country
United States
Well, it is detailed...although slightly overbearing with the "have it like this" structure.
I wouldn't say 14 steps is all that simple (a simple drag and drop would be nice. Maybe use a .bat file and a command line converter...LAME? I can't even remember what LAME supports xD), but it could have been worse I suppose.
At the rock bottom, at least there is a picture of Mikuru. All things are good with a picture of Mikuru xD...well and you are using a Clannad episode for your example, which also rocks.

-edit-
Oh, AlltoAvi IS a commandline converter xD. Then you should just make a .bat file and tell us to have the stuff we need and then it becomes super simple =D.
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
jurassicplayer said:
Well, it is detailed...although slightly overbearing with the "have it like this" structure.
I wouldn't say 14 steps is all that simple (a simple drag and drop would be nice. Maybe use a .bat file and a command line converter...LAME? I can't even remember what LAME supports xD), but it could have been worse I suppose.
At the rock bottom, at least there is a picture of Mikuru. All things are good with a picture of Mikuru xD...well and you are using a Clannad episode for your example, which also rocks.

-edit-
Oh, AlltoAvi IS a commandline converter xD. Then you should just make a .bat file and tell us to have the stuff we need and then it becomes super simple =D.
Well, I hope you attempted to follow the guide at least once.

If you did, you would have noticed that steps 1-7 only need to be completed once, forever (as long as you don't hit the "change font" button as mentioned).
If you take a look at the rest of the steps, only steps 8, 9, 10, 12, and 13 need to be completed each time you convert a video file.
In addition, I wanted to include enough detail in this guide so that I wouldn't get a huge list of silly responses. Also note that some steps, like step 10, are hardly steps at all.

A batch file is entirely unnecessary for this method. After you have followed the guide once, maybe twice, it all comes down to clicking the "convert" button in two very simple GUI programs that both support batch encoding themselves.

Have fun!
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
ColdPerson said:
>Implying that 32-bit is old
There are 32 bit versions of Windows Vista, Windows 7 and Server 2008.

I only implied that Windows versions older than 2006 are old. I'd say four years is enough time for you to switch.

Edit:
Oh I see what you mean. Sure, I'll change the wording.
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
ashxu said:
Your way to too long. Just use SUPER to convert it with the right settings, then whack it into dpgenc.
Upload a DPG you've encoded using SUPER that was originally an mkv, has the subtitles intact in a nice font, is the correct aspect ratio, and doesnt crash the DS when it ends.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,485
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,910
Country
United States
Heere said:
ashxu said:
Your way to too long. Just use SUPER to convert it with the right settings, then whack it into dpgenc.
Upload a DPG you've encoded using SUPER that was originally an mkv, has the subtitles intact in a nice font, is the correct aspect ratio, and doesnt crash the DS when it ends.
Most likely, he could be just converting it into a nice file for dpgenc, and since Super is amazing as a converter (not directly to .dpg, but to other formats), he probably has a fairly high quality video in a nice format that he can "whack into dpgenc"...I don't know if he has any issues with subtitles (I don't remember if Super supports that), but aspect ratio is jack easy and the .dpg file would only crash if he converted it straight to .dpg....and he clearly states that he "whacks it into dpgenc" which totally circumvents the .dpg0 (was it zero? or maybe one? can't remember) freezing issue...

In any case, I still think having just a .bat file is wonderful enough, just set it up to check everything and all the rest of the stuff once, then just make it go straight to dpgenc, then all you ever have to do for the rest of eternity is drag and drop whatever video file you want onto the .bat file and presto, within strange ranges of time (depending on what you convert) you have a .dpg ready for playing. Only part that isn't great about this idea is that there has to be someone willing to MAKE the .bat file xD.
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
Converting with AlltoAVI then dpgenc is the same as converting with SUPER then dpgenc.

At least with AlltoAVI the aspect ratio is guaranteed (SUPER will stretch the video even if you tell it not to), and the font can be changed.

Again, it is impractical to create a batch file for these two programs (AlltoAvi and dpgenc), as they both support batch encoding, and have very simple GUIs that most people would rather use than editing text switches in a batch file.

If you are really that lazy that you want a batch file, then follow the guide once for a batch of videos and notice how simple it is. I have a feeling you haven't even read the whole guide or you would realize how hold-handy it is and how easy it is to use.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,485
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,910
Country
United States
Heere said:
Converting with AlltoAVI then dpgenc is the same as converting with SUPER then dpgenc.

At least with AlltoAVI the aspect ratio is guaranteed (SUPER will stretch the video even if you tell it not to), and the font can be changed.

Again, it is impractical to create a batch file for these two programs, as they both support batch encoding, and have very simple GUIs that most people would rather use than editing text switches in a batch file.
xD Maybe I'm just a lazy bastard...but I think people would prefer just having something where all they need to do is have a movie/video they want to convert, and drop it into one file that almost nobody cares what is inside (if I ever make a .bat file like that, I'm never looking inside it ever again), just that a couple minutes later, there is a nice working .dpg file on their desktop when they come back.

Oh and after reading the beginning of what you used to test the quality of the .dpg files...I think you shouldn't have tested them that way. It probably would have been better to convert the same video with the same settings for all of the programs. At least then if there is a noticeable difference in quality, you can attribute it to the converter rather than just setting everything at the highest it can possibly go and compare the final results.
In the former case, it can be imagined as a bunch of race cars with the same build, but a different engine.
In the latter case, it can be imagined as a bunch of random cars in a race, and in this case, it is possible that it isn't the car with the best engine that wins, but rather the car with a mediocre engine that still has tires. (If this makes sense that is good...particularly the second sentence is a little bit harder to understand, but I can't think of another way to describe it atm)

-edit-
Unfortunately I do spend the time attempting to read stuff like this. Surprisingly enough, I somehow manage to comprehend a lot in a short amount of time (although at times I wish it were quicker...my MS2 previewer would be done if I had the researching ability and motivation xD)
 

Heere

Active Member
OP
Newcomer
Joined
Mar 24, 2010
Messages
35
Trophies
0
XP
216
Country
United States
You are correct in saying that I shouldn't have varied more than one thing in the original tests (that being the encoding suite), but in essence I was not changing anything by changing the settings. All of them were outputting "the best file that they could". Also recall that I was using the same input file for all methods.

It doesn't really matter what bitrates I was using, all of the original tests produced files that either:

A. Crashed the DS

or

B. Did not support subtitles at all

This guide is actually using one of the methods from the original tests, "AlltoAVI", I simply found a way to change the appearance of the subtitles in order to bring the final DPG to an 'Acceptable' level for video 'Great' level for audio 'Great' level for subtitles, and no DS crash.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: By then I'll have some little mini pc anyway