Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st June 2014, 21:03 | #1 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
Remux MKV to MP4 with correct timestamps?
I'm trying to use a video editor that doesn't support MKV and it really struggles with TS files too (Sony Vegas Pro). It seems MP4 is the best input format for it, and it works for some files, but I'm not having any joy remuxing some 1080i/25 TV recordings (AVC/AC3 in an MKV) into working MP4s with correct timestamps.
I'm using ffmpeg to remux and have tried a few different things (straight from MKV to MP4, from MKV to TS to MP4, MKV to elementary stream to MP4) but the resulting MP4 just doesn't play properly in MPC-HC, let alone within Vegas Pro (the frames jump around out-of-order). For example, using this input line: Code:
ffmpeg -i "D:\input.mkv" -vcodec copy -acodec copy "D:\output.mp4" Code:
Non-monotonous DTS in output stream 0:0; previous: 3119681, current: 3119040; changing to 3119682. This may result in incorrect timestamps in the output file. Thanks for any advice.
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 |
21st June 2014, 22:07 | #3 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
How do I extract timecodes? Also, I've tried MP4Box (via YAMB), it also produces a dodgy MP4 file like ffmpeg does.
EDIT: OK I see I can use timecodes_v2 (don't see this option in MKV Extract GUI 2). Are there any GUIs that will let me make an MP4 using the timecode files? EDIT: Every time I download a Windows binary of MP4Box GPAC I get the error "installer integrity check has failed".
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 Last edited by DragonQ; 21st June 2014 at 22:42. |
21st June 2014, 22:54 | #4 | Link |
Registered User
Join Date: Jan 2012
Posts: 91
|
I only use the official, latest GPAC mp4box.exe extracted from the installer. They do have a much older stable release. I don't like using GUIs, the command line has so much more options... Maybe gMKVExtractGUI will work... don't know, haven't tried it before...
An easier method may just be using LATEST!!!!! ffmpeg... it is updated daily... and mux it into a MP4 then using the GPAC mp4box and remux it into a "better/fixed" MP4... The method I presented earlier is rather complex, even I get so confused that I use a custom batch script.... |
21st June 2014, 22:56 | #5 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
OK well I can't find any information about how to use mp4box to mux using timecodes. Any help?
Simply remuxing the MKV into an MP4 using ffmpeg and then remuxing that MP4 into another MP4 using mp4box doesn't help. Looks like I need the timecodes...
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 Last edited by DragonQ; 21st June 2014 at 23:01. |
21st June 2014, 23:08 | #6 | Link |
Registered User
Join Date: Jan 2012
Posts: 91
|
latest ffmpeg, when convert from mkv to mp4 is suppose to preserve the timecodes... is the mkv file container broken or too old? you may need to "upgrade" the mkv container on your video file to the latest version, then convert using latest ffmpeg... it's trial and error sometimes, when dealing with uncooperative files
|
21st June 2014, 23:09 | #7 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
I have the latest ffmpeg (updated yesterday before trying this stuff) and latest MKV Merge. I only made the MKV a few days ago.
ITV HD probably has a dodgy stream though. I know that MediaPortal reports continuity errors constantly when watching ITV HD (not for other channels) even though the video plays fine (50 fps, no dropped frames).
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 Last edited by DragonQ; 21st June 2014 at 23:12. |
22nd June 2014, 00:29 | #12 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
OK using mp4fpsmod I can get a working MP4 with correct timestamps, woo! Unfortunately, Vegas Pro won't bloody open it, despite opening some other MP4 files with AVC fine.
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 |
22nd June 2014, 01:09 | #14 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
If I remove the audio before muxing (don't need it anyway), Vegas Pro opens the file. However, in the preview window the timestamps are all messed up again, even though the MP4 plays fine in MPC-HC. It also says it's 125 fps despite clearly playing at 50 fps in the preview window.
Sigh.
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 |
22nd June 2014, 09:04 | #18 | Link |
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
I still do not understand the reason of converting MKV to MP4 ...
Vegas Pro accepts individual streams (assets), so a demux should be he only thing you need. Then place them on the timeline (slugs) as needed. I know no device that records in MKV, but if there is an issue with the MKV, then the problem has to be searched on that device. Again TC/IVTC and NDF/DF are issues not present in raw/captured videos, only in edited ones.
__________________
Born in the USB (not USA) |
22nd June 2014, 09:51 | #19 | Link | ||
Registered User
Join Date: Mar 2007
Posts: 934
|
Quote:
Quote:
The timestamps are screwed up when I simply import the H264 stream without a container, just like when using the MP4 file.
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 |
||
22nd June 2014, 14:53 | #20 | Link |
Registered User
Join Date: Jan 2012
Posts: 91
|
The problem is you may handling variable bitrate files and if you take a look at the video w/ MediaInfo you will see alot of strange values... However those values will be carried over when you re-mux to MP4.... "Fix bitstream timing information" adjusts such info to match the container...
|
|
|