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. |
19th May 2010, 14:57 | #2 | Link |
MKVToolNix author
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,281
|
mkvmerge does that automatically. Make sure you actually append the two files. The difference between "mkvmerge -o out.mkv in1.mkv in2.mkv" and "mkvmerge -o out.mkv in1.mkv +in2.mkv" are subtle, but the resulting files are completely different. Same goes for using mmg; use the "add" button for the first and the "append" button for the second file.
__________________
Latest MKVToolNix is v83.0 If I ever ask you to upload something, please use my file server. |
26th May 2010, 18:43 | #3 | Link | |
Pinhead
Join Date: Sep 2002
Location: Twin Cities, MN, USA
Posts: 158
|
Quote:
I solved the problem by writing my own program that takes a chapter file and rewrites it based on a new starting chapter, and length of previous video file so I can concatenate them manually, and add them in to the final MKV. |
|
29th May 2010, 03:07 | #5 | Link |
Pinhead
Join Date: Sep 2002
Location: Twin Cities, MN, USA
Posts: 158
|
Sure. Unrefined C code hack.
Code:
#include <stdio.h> #include <stdlib.h> // use: chapadd chap_start_num time_to_add chapter_file // limitation: < 100 chapters int main(int argc, char **argv) { int hour, min, sec, thousands; int chap_num; int h, m, s, t; FILE *fp; char buffer[128]; if (argc != 4) { fprintf(stderr, "Usage: chapadd chapter_start start_time chapter_file\n"); fprintf(stderr, " - chapter_start: the new chapter to start at\n"); fprintf(stderr, " - start_time: length of first movie file [hh:mm:ss.hhh]\n"); fprintf(stderr, " - chapter_file: OGG chapter file to rewrite\n"); return 0; } chap_num = atoi(argv[1]); sscanf(argv[2], "%d:%d:%d.%d", &hour, &min, &sec, &thousands); fp = fopen(argv[3], "rt"); if (fp == NULL) { fprintf(stderr, "Error opening OGG chapter file.\n"); return 0; } // Loop through chapter file // Expected input format: // CHAPTERnn=hh:mm:ss.hhh // CHAPTERnnNAME=Chapter n while (fgets(buffer, 128, fp) != NULL) { sscanf(&buffer[10], "%d:%d:%d.%d", &h, &m, &s, &t); t += thousands; if (t >= 1000) { s++; t -= 1000; } s += sec; if (s >= 60) { m++; s -= 60; } m += min; if (m >= 60) { h++; m -= 60; } h += hour; // output new chapter data to stdout (user can copy/paste from there) printf("CHAPTER%02d=%02d:%02d:%02d.%03d\n", chap_num, h, m, s, t); printf("CHAPTER%02dNAME=Chapter %d\n", chap_num, chap_num); chap_num++; fgets(buffer, 128, fp); // discard the second line of each chapter } fclose(fp); return 0; } |
Thread Tools | Search this Thread |
Display Modes | |
|
|