I have noticed that when transcoding recent mkv files to mp4 that the video plays back significantly faster than what it should. I have tried transcoding the files to mp4 using both GOTSent and YAMB (off the top of my head I think I only used YAMB to "mux" them back together, I think I used the mkv toolbox GUI to split the file) with the same result. I have also tried an older mkv file and it works ok. I therefore suspect that it is something different between the older and newer mkv files.
I have posted the details of the MKV (and bad MP4) files below - which are from MediaInfo. The only difference I can see between the ok and bad mkv file (that means anything to me) is the good one is 25fps and the bad one is 50fps.
Details of ok MKV
Details of bad MKVCode:General Unique ID : 190837446784740164631015799390638002086 (0x8F91F49054B130ECDCA41623E4A14FA6) Format : Matroska File size : 1.46 GiB Duration : 1h 1mn Overall bit rate : 3 402 Kbps Encoded date : UTC 2011-06-26 20:24:59 Writing application : mkvmerge v2.9.8 ('C'est le bon') built on Aug 13 2009 16:16:13 Writing library : libebml v0.7.7 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Format settings, GOP : N=1 Codec ID : V_MPEG4/ISO/AVC Duration : 1h 1mn Bit rate : 2 950 Kbps Nominal bit rate : 3 207 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.128 Stream size : 1.26 GiB (87%) Writing library : x264 core 105 r1732 2b04482 Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=2pass / mbtree=0 / bitrate=3207 / ratetol=1.0 / 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.00 Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Mode extension : CM (complete main) Codec ID : A_AC3 Duration : 1h 1mn Bit rate mode : Constant Bit rate : 384 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Side: L R, LFE Sampling rate : 48.0 KHz Bit depth : 16 bits Compression mode : Lossy Stream size : 169 MiB (11%)
Details of bad MKV converted to MP4 (specifically note the length of the video track)Code:General Unique ID : 225171590909705966843017806474790216097 (0xA96678908FB656FA96333E6CEB9EA1A1) Format : Matroska File size : 1.84 GiB Duration : 1h 1mn Overall bit rate : 4 259 Kbps Encoded date : UTC 2012-02-11 19:51:02 Writing application : mkvmerge v5.2.0 ('I can't explain') built on Dec 18 2011 18:12:03 Writing library : libebml v1.2.3 + libmatroska v1.3.0 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 9 frames Muxing mode : Header stripping Codec ID : V_MPEG4/ISO/AVC Duration : 1h 1mn Bit rate : 3 982 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 50.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.086 Stream size : 1.72 GiB (94%) Writing library : x264 core 120 r2146 bcd41db Encoding settings : cabac=1 / ref=9 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 Language : English Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Mode extension : CM (complete main) Muxing mode : Header stripping Codec ID : A_AC3 Duration : 1h 1mn Bit rate mode : Constant Bit rate : 192 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Bit depth : 16 bits Compression mode : Lossy Stream size : 84.9 MiB (5%)
In the above details you can see that the MP4 thinks the video is only 43 minutes long, compared to the 61 minutes it should be, and it still says that it is 50 fps. I have tried opening it another PC, using both media info and an actual video player (vlc & WMP) with the same effect.Code:General Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 1.83 GiB Duration : 1h 1mn Overall bit rate : 4 232 Kbps Encoded date : UTC 2012-03-14 10:40:28 Tagged date : UTC 2012-03-14 10:40:28 Video ID : 2 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 9 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 42mn 53s Bit rate mode : Variable Bit rate : 5 860 Kbps Maximum bit rate : 36.1 Mbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 50.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.127 Stream size : 1.76 GiB (96%) Writing library : x264 core 120 r2146 bcd41db Encoding settings : cabac=1 / ref=9 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 Encoded date : UTC 2012-03-14 10:40:32 Tagged date : UTC 2012-03-14 10:41:37 Audio ID : 1 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 1h 1mn Bit rate mode : Variable Bit rate : 163 Kbps Maximum bit rate : 201 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy Stream size : 72.0 MiB (4%) Encoded date : UTC 2012-03-14 10:40:28 Tagged date : UTC 2012-03-14 10:41:37
The factor/ratio of 43 to 61 is 0.704 or 1.4186 which doesn't seem to line up with anything that makes sense (e.g. 25(fps) to 30 or 30 to 50 or anything else I could think of).
Any ideas on what may be causing this? In case you ask, the reason for transcoding the file is because the 50fps mkv files won't play on my xBox (using Windows Media Center) whereas older ones work fine.
+ Reply to Thread
Results 1 to 8 of 8
-
-
Last edited by bat999; 20th Mar 2012 at 10:39.
-
Maybe you need to make an mp4 file with constant frame rate 25fps.
Do you know how to do this?) but wasn't able to find anything, so I'll say no.
Were you able to tell that one of the mkvs was vfr and the other was vfr from the MediaInfo details (I couldn't (and still can't) see anything in the mediaInfo details that show this). -
Hi
Yes, information is from MediaInfo.
Code:Frame rate mode : Variable
Use latest FFmpeg build from here --> http://ffmpeg.zeranoe.com/builds/
For first attempt...
Try a command like this:-
Code:ffmpeg -i filename.mkv -vsync 1 -r 25 -c:v libx264 -c:a copy filename.mp4
Last edited by bat999; 21st Mar 2012 at 05:26.
-
Not wanting to sound like someone who can't help themselves, but when I run the below command I get an error about the codec frame size not being set and another error (which I assume is due to the first one). I've done a brief search on codec frame size is not set and couldn't find anything that appeared to be useful (and the hex code returns nothing).
Code:ffmpeg -i "E:\Input.mkv" -vsync 1 -r 25 -c:v libx264 -c:a copy "E:\Output.mp4" [mp4 @ 0000000003E9FA50] track 1: codec frame size is not set Output #0, mp4, to 'Output.mp4': Metadata: creation_time : 2012-02-17 00:52:16 encoder : Lavf54.2.100 Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 tbn, 25 tbc (default) Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 192 kb/ s (default) Stream mapping: Stream #0:0 -> #0:0 (h264 -> libx264) Stream #0:1 -> #0:1 (copy) Could not write header for output file #0 (incorrect codec parameters ?)
-
Last edited by bat999; 21st Mar 2012 at 12:12.
-
Thanks for that bat999. That command worked. I haven't checked it on my xbox, but playing the converted mp4 on my PC it look like it should be good.
-
If it is OK, then it will be easy to use latest WinFF from here ---> http://winff.org/html_new/
And make your own preset ---> http://code.google.com/p/winff/wiki/HowToMakePresets
EDIT
And if you do use WinFF...
you can change this:-
Code:-c:a aac -strict experimental -q:a 100 -ac 2 -ar 48000
Code:-c:a libfaac -q:a 100 -ac 2 -ar 48000
Last edited by bat999; 22nd Mar 2012 at 06:28.
Similar Threads
-
MKV guide, Play MKV, MKV to AVI, MKV to DVD, MKV to MP4, MKV to Blu-ray
By Baldrick in forum Newbie / General discussionsReplies: 55Last Post: 29th Jun 2012, 11:19 -
MP4 to AVI conversion results in a ghost-effect video .. !
By ahmadka in forum Video ConversionReplies: 1Last Post: 10th Mar 2011, 03:49 -
Converting to H264 [.MP4] (mencoder) results in video playing too fast
By ChrisMtl in forum ffmpegX general discussionReplies: 4Last Post: 12th Nov 2008, 16:02 -
x264 encoded mkv/mp4 transcode to xvid encoded avi
By graysky in forum Video ConversionReplies: 4Last Post: 9th Aug 2008, 18:55 -
My results from blu ray backup and Encode/transcode
By ultraman36 in forum DVD RippingReplies: 8Last Post: 19th Dec 2007, 16:21