mkv conversion question

If you have questions about compression/encoding/converting look here.
Locked
arcticstorm058
Joined: Fri Sep 08, 2006 4:44 pm
Location: Texas
Contact:
Org Profile

mkv conversion question

Post by arcticstorm058 » Tue Oct 09, 2007 4:03 pm

I have several mkv files that have sepreate audio and subtitles setting. So every time I tried to convert them to avi using COWON jetaudio I all ways get jap dubed with no subs. So two questions, 1. How can I convert the file with the sub activated and 2. How can I convert the file with a different audio setting (its changing the Desert Punk's audio setting from jap to eng).
“I had my suspicions you were no mere mortal, but I had no idea you were actually a cat... Wait a second, what the hell am I saying–where is that idiot?!?”
-Nicholas D. Wolfwood

User avatar
Kionon
I ♥ the 80's
Joined: Fri Mar 02, 2001 10:13 pm
Status: Ayukawa MODoka.
Location: I wonder if you know how they live in Tokyo... DRIFT, DRIFT, DRIFT
Contact:
Org Profile

Post by Kionon » Tue Oct 09, 2007 5:25 pm

Why do you need either? You shouldn't be using downloaded footage to edit with in the first place, but if you are, you shouldn't even need an audio track, much less a subtitle track. If I knew what you were trying to do, maybe I could help you.
ImageImage
That YouTube Thing.

arcticstorm058
Joined: Fri Sep 08, 2006 4:44 pm
Location: Texas
Contact:
Org Profile

Post by arcticstorm058 » Tue Oct 09, 2007 5:32 pm

i know but the man reason i ask is cause i want to put them on my Zen W but it would be nice to be able to understand whats going on
“I had my suspicions you were no mere mortal, but I had no idea you were actually a cat... Wait a second, what the hell am I saying–where is that idiot?!?”
-Nicholas D. Wolfwood

User avatar
Gepetto
Mr. Poopy Pants
Joined: Thu Jun 10, 2004 10:11 pm
Status: Bored to tears
Location: The Tokyo Settlement
Contact:
Org Profile

Post by Gepetto » Wed Oct 10, 2007 11:30 am

You can't "convert them with the subtitles activated". You have to hardburn the subtitles (stick them to the image instead of storing them in a separate stream). I vaguely remember VobSub doing that in the old days of the Gordian Knot RipPack. Does anyone know if it'll still do?
And God spoke unto the Chicken, and He said: "Thou shalt crosseth the road", and the Chicken did cross the road, and there was much rejoicing.
My DeviantART profile

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Post by Phantasmagoriat » Wed Oct 10, 2007 1:36 pm

The way I do it for my iPod is a bit lengthy, but it involves demuxing the video stream, audio stream, and subtitle stream with MKVextract, then recombining everything through an avisynth.avs script that looks like this:

Code: Select all

# first, set some parameters
LoadPlugin("C:\Program Files\Combined Community Codec Pack\Filters\VSFilter.dll")
video = avisource("Vampire_Hunter_D-Bloodlust_divx_Track1.avi")
audio = directshowsource("Vampire_Hunter_D-Bloodlust_AAC_Track3.mp4")
# combine them into a single clip
AudioDub(video, audio)
# add borders so the subtitles appear in a letterbox below a widescreen movie
addborders(0,20,0,100)
# hardsub the subtitles
textsub("Vampire_Hunter_D-Bloodlust_subs_Track4.srt")
[after extracting your required streams, type that into a .txt file, save, then change the extension from .txt to .avs]
[anything after a # is just instructional, and doesn't need to be typed]

feed that avisynth.avs script to "Videora" or "SUPER ©" and recompress to whatever format you need for your portable device.

it also helps if you get virtualdub(/mod), so you can preview your .avs file to make sure everything works.

you will need
-the cccp
-avisynth
-MKVtoolnix, MKVextract, (likely MKVextractGUI also)
-"SUPER ©" or "Videora"

if your video stream is not an .avi, and variable framerate, make your script look like this:

Code: Select all

LoadPlugin("C:\Program Files\Combined Community Codec Pack\Filters\VSFilter.dll")
video = directshowsource("Video_VFR_Track1.mp4", fps=119.88, convertfps=true)
audio = directshowsource("Audio_AAC_Track3.mp4")
AudioDub(video, audio)
Changefps(23.976)
textsub("Vampire_Hunter_D-Bloodlust_subs_Track4.srt")
...anyways, it will always depend on what streams are within the MKV, so it will be a case-by-case basis... but that's generally how I do it...
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."

User avatar
Gepetto
Mr. Poopy Pants
Joined: Thu Jun 10, 2004 10:11 pm
Status: Bored to tears
Location: The Tokyo Settlement
Contact:
Org Profile

Post by Gepetto » Wed Oct 10, 2007 1:59 pm

Oh right, VobSub changed names now. My bad.
And God spoke unto the Chicken, and He said: "Thou shalt crosseth the road", and the Chicken did cross the road, and there was much rejoicing.
My DeviantART profile

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Post by Qyot27 » Wed Oct 10, 2007 4:28 pm

Phantasmagoriat wrote:LoadPlugin("C:\Program Files\Combined Community Codec Pack\Filters\VSFilter.dll")
video = directshowsource("Video_VFR_Track1.mp4", fps=119.88, convertfps=true)
audio = directshowsource("Audio_AAC_Track3.mp4")
AudioDub(video, audio)
Changefps(23.976)
textsub("Vampire_Hunter_D-Bloodlust_subs_Track4.srt")
There is never a need to convert the framerate that high. Just use 29.97 and be done with it. Most normal VFR encodes (that don't go up above 30fps, which I've never seen) keep below 29.97 or 30, so there's no reason to insert more than what 29.97 will take. And doing a ChangeFPS(23.976) isn't a good way of getting it back down to Film framerates either.

And just copy VSFilter.dll to C:\Program Files\AviSynth 2.5\plugins so it'll autoload.

As long as it's not VFR, just use FFmpegSource. Trims a lot of that fat off the script.

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Post by Phantasmagoriat » Wed Oct 10, 2007 7:13 pm

Yeah, I can't remember where I found out about that, I was just happy that it [seemed to] work; thought it had something to do with 119.88 being the LCD of 23.976 and 29.97, so it would make it easier for Changefps(23.976) to work. Using 29.97fps makes sense to me since all the frames would stay intact, however, the majority of a VFR file is usually run at the lower framerate, so adding extra frames to make it 29.97 seems like a waste of space to me [or would they even take up extra space? I thought that was the point of having variable framerates]

what would be an alternative to ChangeFPS(23.976)?

hehe, autoloading... I somehow forgot about that :P

I saw your other post on FFmpegSource, but haven't got around to experimenting.

So now I'm curious, I think I know what your saying, but could you outline the way you would hardsub an MKV that isn't [or is] VFR?
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Post by Qyot27 » Wed Oct 10, 2007 10:51 pm

Phantasmagoriat wrote:So now I'm curious, I think I know what your saying, but could you outline the way you would hardsub an MKV that isn't [or is] VFR?
1) Demux the subtitle stream with MKVExtract.
2a) For CFR:

Code: Select all

FFmpegSource("video.mkv",atrack=-1)
TextSub("script.ass") #or ssa or srt
2b) For VFR:

Code: Select all

DirectShowSource("video.mkv",fps=29.97,convertfps=true)
TextSub("script.ass") #or ssa or srt
TDecimate(mode=1) #if 23.976 is necessary
Trim(0,4592) #replacing 4592 with the actual final frame
3) Encode as usual. Any resizing for correct aspect ratio (in case the MKV uses aspect flags) should be done prior to TextSub in the script. The Trim() command is an optional step which is sometimes necessary because DirectShowSource outputs grey frames at the end of many H.264 files - FFmpegSource has this behaviour too, but the frames it places there are solid black, and thus far less noticeable unless the video is supposed to end without a fade to black.

The thing about 119fps is that for AVI, which doesn't support VFR, people commonly use the LCR of 23.976 and 29.97 when joining segments together, and those extraneous frames don't have anything in them - in the actual file they can take up to 10 megs or so from reports I've read (when the video itself is standard TV episode length), which is small in comparison to the actual video data, but quite frankly, it's a hack.

The point is, the framerate in a true VFR file fluctuates, but I've never seen a VFR file that peaks way above 29.97 or 30 fps - only the general playback speeds that any other constant framerate file would have for those rates. Therefore, to avoid dropping frames from the segments that are 29.97 or at the very least, higher than 23.976, using fps=29.97, convertfps=true will maintain audio sync by adding frames only in those areas that need it, to bring the whole file truly up to 29.97, thus not dropping any frames, just adding duplicates. It is a relative 'waste' of space to do so (filesize doesn't radically inflate for 29.97 compared to 23.976, provided it's a good encode), but it's the only way to accurately convert the file to a standard framerate whilst preserving both audio sync and motion.

DirectShowSource can load the audio from the file without calling it separately, provided you have a decoder that works through DirectShow - the CCCP should have this ability via ffdshow's audio decoder, otherwise CoreAAC, CoreVorbis, etc. work fine. I doubt this was removed in the newest versions of DirectShowSource, but if it matters, I use an older version of it prior to the change which began requiring Graphedit loading to specify that audio=false even if the graph doesn't link to any audio (thus being audioless when detected anyway; having to specify audio=false is just redundant and would piss me off too much to have to do all the time).

arcticstorm058
Joined: Fri Sep 08, 2006 4:44 pm
Location: Texas
Contact:
Org Profile

Post by arcticstorm058 » Thu Oct 11, 2007 7:52 am

:sweat: well I guess I'll try that and whould you do close to the same steps to change the audio file from the preset jap dub to the eng dub or is it a whole different method
“I had my suspicions you were no mere mortal, but I had no idea you were actually a cat... Wait a second, what the hell am I saying–where is that idiot?!?”
-Nicholas D. Wolfwood

Locked

Return to “Conversion / Encoding Help”