I always had trouble converting mkvs containing variable framerate h264 to xvid/avi for playing on my standalone DVD player. Mencoder produced artefacts and ffmpeg produced "stuttery" video. This problem got bigger and bigger, because a lot of stuff nowadays comes in mkv container with vfr h264.
With perian everything works fine when you select "Decode with Quicktime" in the ffmpeg settings.
So if you have similar problems, try it out.
http://www.perian.org
EDIT: You can also burn in subs with this (srt or ssa inside the mkv) using ffmpeg. Haven't tried what happens with multiple subs yet. Some water in the wine: Conversions take significantly longer than before, and there are still some jerky moments in the video. Also some audio tracks (5.1 mp3) don't work.
Results 1 to 23 of 23
-
-
Seems my explanations were too short. So here is some more info:
Perian is a Quicktime component. Quicktime can play more container formats with Perian installed, including mkv.
So if you want to convert mkv with ffmpegx and use the Perian component, the decoding has to be done in Quicktime. This option is only available for ffmpeg and mpeg2enc. Therefore you'll have to select one of the ffmpeg or mpeg2enc target formats from the quick preset (like "XviD ffmpeg"). Then go to the "Options" tab and check the "decode with Quicktime" box.
The thing perian does much better than the encoders included in ffmpegx is handling of subtitles. Styled subs (ssa/ass) are burned into the video using original fonts and colours specified in the mkv. Mencoder can only make unstyled, "translucent", one-font only subs and the font-selection, size and position change doesn't work in the latest binaries. Ffmpeg won't burn subs at all.
Also decoding of some mkv containing h264 seems to work better with perian.
There are some drawbacks:
Conversions take much longer.
I still haven't figured out how to select between multiple subtitles.
Some audio tracks (mostly aac 5.1) won't convert. The workaround for this is to uncheck "encode audio" in the audio tab and convert video only. Then convert the audio separately using the standard "movie audio to mp3" setting and mux the audio and the converted video using the mux tool in the mux tab.
So currently im only using perian for mkv containing styled subs or containing h264 that makes problems with ffmpeg or mencoder.
-
Thanks for this.
When I convert using "decode with quicktime" it gives me this in the log:
5.component/Contents/MacOS/DivX 5: error code 4, error number 0 (Library not loaded: /Library/Application Support/DivXNetworks/liblame3.92.dylib
Referenced from: /Library/QuickTime/DivX 5.component/Contents/MacOS/DivX 5
Reason: image not found)
2007-09-14 12:39:58.313 movtoy4m[10783] CFLog (21): Error loading /Library/QuickTime/DivX 5.component/Contents/MacOS/DivX 5: error code 4, error number 0 (Library not loaded: /Library/Application Support/DivXNetworks/liblame3.92.dylib
Referenced from: /Library/QuickTime/DivX 5.component/Contents/MacOS/DivX 5
Reason: image not found)
It seems there's DivX components missing from my library. Was this supposed to be installed by Perian or is this something I have to hunt down?
-
No, if Perian is installed you don't need the divx component any longer. Seems like there is an older divx component installed on your computer, because the error message says "Referenced from: /Library/QuickTime/DivX 5.component"
Look into Library/Quicktime/ and your user account's Library/Quicktime/ for old quicktime components and remove the DivX 5.component. The Perian site says you can also remove the following components:
FFusion, Xvid Delegate, 3ivX, DivX, XviD, msmpeg4v1, msmpeg4v2, AviImporter, EX_M4S2, and Casio AVI Importer
-
could you explain your steps behind burning in stylized subtitles from an mkv, beardfan? i watch a wide spectrum of fansubbed anime and for the ones that are within mkv containers i always get the small, ugly translucent letters burned in when running it through ffmpegx for dixv dvd player playback. i have perian installed, and am on OS 10.4.9
-
Seems we're all watching fansubs
The first series I tried this on is Ookiku Furikabutte (http://a.scarywater.net/saizen/). It has h264 video, 5.1 aac audio and ssa styled subs in an mkv container.
What I do:
Drag the mkv into ffmpegx. Select "DivX ffmpeg" as target format.
Go to the video tab. Correct the framerate to NTSC Film, because in most cases ffmpegx doesn't recognize the correct framerate and shows something like 0.08 or 1000.0. Check if the resolution is ok. Hit the "Best" button for an optimal bitrate.
Go to the audio tab. Uncheck "encode audio".
Go to the options tab. Check the "decode with Quicktime" box. I also always check the "high quality" box.
Hit "Encode"
Go back to the main tab. Select "movie audio to mp3" as target format. Hit "Encode"
After both files finished encoding go to the tools tab and select mux. Select "mux as avi". Now select the encoded avi as video and the mp3 as audio and hit "mux"
The resulting file can be played on your standalone and has nice non-translucent subs with different colors and fonts (of course depending on the source mkv file).
-
Thanks BeardFan. I got it to work after deleting those components. It took 9 hours to convert a 28 minute episode! The only problem I really had with it was that the subtitles got stuck on the video, they can't be turned off, like they got permanently attached to the video after conversion. I tried converting just the h264 file without the audio and subtitles, but it doesn't seem to want to convert that, I always get this: pipe:: Error while opening file.
-
Decoding with Perian will always burn in the subs.
If you don't want the subs, then better try converting the mkv without perian. Try it with the mencoder Divx or ffmpeg Divx target setting and don't select decode with Quicktime. Some h264 mkv work fine that way and it will convert a lot faster.
You also could make a new mkv container without the subs using mkvmerge and put the contents of the old mkv into a new one minus the subs. But don't ask me for the correct mkvmerge parameters
-
Thanks, got the video to go through now.
If you don't mind me asking another question, I'm having trouble with the audio. After it's converted it's twice as long as the original, and because the audio's been stretch to twice it's size it sounds like it's in slow motion.
The movie is 28 minutes long and the audio comes out as 55 minutes, I've tried changing the bitrate and kbps but that doesn't do anything. I can't seem to find an option that has to do with the audio length.
EDIT:
Ahh, I've also noticed the video I converted is 5 minutes longer than the original, so even the video plays slower, there's no way I could even sync the video and audio. What makes the video longer? I've tried matching the bitrate, the FPS, and even set it to stay within 29 minutes, it just keeps converting to 33 minutes.
-
Did you convert the raw video and audio extracted from the mkv?
If so, then my guess is that it's variable framerate video.
Conversions with ffmpegx will only work correctly with vfr video if you keep the video inside the mkv container because the vfr information gets lost when extracting the video. Also probably the sample rate information got lost for the audio.
For the audio you could try doubling the sample rate with audacity.
Does ffmpegx convert the video and audio when you keep it in the mkv?
-
"Did you convert the raw video and audio extracted from the mkv? "
I think so, or that's what I assume it is since it's what I got from the extracting process. The raw files themselves have the correct rates but the conversions are different in length, it sounds like you're right about the variable framerate thing since no matter what conversion settings I use I get the same time difference from raw to conversion.
"Does ffmpegx convert the video and audio when you keep it in the mkv"
I just tried that out, looking at the log it's giving me several hundreds of: error while decoding stream #0.2. I chose that stream because it's the english audio, but it does the same if I use stream 0.1. I decided to cancel that and try getting just the video without using decode with quicktime. It's giving me errors on the video stream too but I'm just going to let it run for the night and see how it goes. If I can just get the video right, then I could use audacity or possibly even garage band to change the sample rate.
-
Those errors in the log are normal, because ffmpeg has problems parsing the mkv. This will result in some stuttery video now and then. ffmpeg has no problem decoding the h264, since the raw video converts fine (but with the timing problems, too long or too short)
Mencoder on the other hand has no problems parsing the mkv, but it can't decode some h264 correct, so this will result in artefact blocks.
This was the reason for me to try out perian (I even upgraded to 10.4 for that).
Problem is that conversion takes too long with perian on my old G4/800, so for all movies without styled subs I'm back to ffmpeg, bearing the stuttery video.
Since ffmpeg has problems with the 5.1 audio sometimes, I do the following:
Encode the mkv to video (no audio) with ffmpeg.
Encode the mkv with mencoder.
Encode the mencoder created avi to mp3 audio only.
Mux the ffmpeg encoded video with the mp3.
-
I'm not having much luck with either ffmpeg or mencoder. When I try converting the non-extracted video on mencoder it fails immediately, when I do it with ffmpeg it stops the encoding at roughly 30%, leaving me with an avi that's only 13 minutes.
I can't convert the audio from the mkv at all, it'll give me a bunch of decoding errors and leave me with an audio file that's zero kb. I can only convert the extracted audio, but that of course will give me an audio file that's twice as long.
The problem for now though, is just the video, as I think I can edit the audio to play the correct rate. I'm going to try decoding with quicktime again to see if it gives me an avi with the right length. x.x, I wish mkv wasn't becoming so popular with anime files.
-
I thought all the One Piece eps came in avi too? Anyway, it's the 6 episode Angel Cop ova series, It's not really a fansub as far as I can tell, it looks like it's a rip from the Manga DVD with both languages and subs. I'm not sure if I'm allowed to link to torrents here, it's the [TOMA] angel cop one. Probably the only torrent of it you'll find anyway.
Hey, how long is muxing supposed to take? I've been muxing a divx avi and an ac3 from the Lensman movie, and it's been going for about 40 minutes. I'm not sure if it's stalled or is actually muxing.
-
-
Yeah, muxing accepts mp3 and ac3. I found what I was doing wrong with the muxing, I was using avi + audio instead of just avi, so it was looking for 2 audio tracks instead of one.
For Angel Cop, I'm planning on converting all 6 eps into vobs, so to save space I'll probably get rid of the subs and japanese audio. That's why I didn't want the subs locked onto the video the first time, because it'll be playing in english anyway.
Thanks for all the help on this, I appreciate it.
-
Download was faster than expected.
Converting episode 1 works fine using the mencoder divx setting. As Steve always says: "It scrolls like butter!". I corrected the framerate to NTSC in the video tab. In contrast to ffmpeg (and perian), mencoder recognizes the correct sampling rate for the audio. Both video and audio converted smoothly (only two frames error in the log and no video artefacts). Took 90 minutes on my ageing machine.
In conclusion I would say:
For mkv:
Try mencoder first. If the converted video is allright stay with mencoder, because it's the fastest.
Try ffmpeg second. Chance is, that the video works better. There may be audio problems.
If ffmpeg video won't work (or source has styled subs), try ffmpeg with perian (video only).
If audio won't work with ffmpeg, convert with mencoder, extract mencoder audio, mux with ffmpeg video only.
For mp4:
Use ffmpeg.
EDIT: Just saw, that you wanted to create VOBs. Then use mpeg2enc with the "decode with mplayer" option. If mencoder works, mplayer works just the same. Just remove spaces and special characters in the path and filename, so that it will work.
-
I used 720x480 at NTSC framerate. While you answered I edit the post above regarding VOBs
Here's my log:
Encoding started on Tue Sep 18 22:01:17 CEST 2007
MEncoder dev-CVS-051126-18:35-3.3 (C) 2000-2005 MPlayer Team
Mac OSX static build for ffmpegX
AltiVec found
CPU: PowerPC
success: format: 0 data: 0x0 - 0xc414429
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
FAAD: compressed input bitrate missing, assuming 128kbit/s!
[mkv] Track ID 2: audio (A_AAC), -aid 0, -alang jpn
[mkv] Track ID 3: audio (A_AAC), -aid 1, -alang eng
[mkv] Track ID 4: subtitles (S_TEXT/UTF8), -sid 0, -slang eng
[mkv] Will play video track 1
[mkv] Will play audio track 2
Matroska file format detected.
VIDEO: [avc1] 720x480 24bpp 29.970 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31 fourcc:0x31637661 size:720x480 fps:29.97 ftime:=0.0334
================================================== ========================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 48000 Hz, 2 ch, s16be, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
================================================== ========================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [scale w=720 h=480]
================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
Forcing output fourcc to 58564944 [XVID]
Building audio filter chain for 48000Hz/2ch/s16be -> 48000Hz/0ch/s8...
Building audio filter chain for 48000Hz/2ch/s16be -> 48000Hz/2ch/s16be...
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> Planar YV12 special converter
videocodec: libavcodec (720x480 fourcc=58564944 [XVID])
1 duplicate frame(s)!
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
1 duplicate frame(s)!
Skipping frame!
Error while decoding frame!
Error while decoding frame!
1 duplicate frame(s)!
Skipping frame!
Flushing video frames
Writing AVI index...
Fixing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Video stream: 2089.875 kbit/s (261234 B/s) size: 433612343 bytes 1659.860 secs 49749 frames
Audio stream: 128.000 kbit/s (16000 B/s) size: 26565888 bytes 1660.368 secs
Encoding completed on Tue Sep 18 23:12:38 CEST 2007
-
Aha!
Notice the difference in the mencoder version numbers. Seems like you don't use the latest version. The version you use is from 230105 and the last, that does the subtitles correctly and came with the s version of ffmpegx.
For h264 you should always use latest version 20060307 that came with the w version of ffmpegx. Of course if you want your subs burned in, this means double conversion (first the latest one, and after that burn the subs in with the s version).
EDIT: seems you figured it out yourself
Similar Threads
-
Trouble with MKV to MP4 Video conversions for Ipod
By Shisehise in forum Video ConversionReplies: 3Last Post: 10th Jan 2012, 01:17 -
Trouble balancing quality vs size in MKV and MTS conversions.
By Omid in forum Video ConversionReplies: 4Last Post: 17th Mar 2011, 18:47 -
MKV conversions using Handbrake
By havash in forum Video ConversionReplies: 1Last Post: 6th Aug 2010, 00:36 -
MKV File: QuickTime (With Perian) - Green Screen; VLC - No Problem
By Valentin in forum Software PlayingReplies: 2Last Post: 4th Aug 2010, 16:24 -
Freeware for mkv conversions...
By aruwin in forum Video ConversionReplies: 1Last Post: 27th Dec 2007, 09:21