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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th March 2020, 14:20   #641  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Is there a better way to fix audio that leads the video?

The source IFO has 10 PGCs (program chains).
Beginning with the 9th program, audio leads the video -- programs 1 to 8 were okay.
By tedious trial-&-error, I worked out that the audio needed to be delayed by 4400ms.
I may encounter something like this in the future.
I wonder whether there's a better way than my work flow.

Work flow:
Step 1: I used MKVToolNix to repackage the VOB as an MKV.
Step 2: I viewed the MKV via the MPV player and saw the audio leading towards the end of the MKV.
Step 3: I reran MKVToolNix and added an audio delay.
Step 4: I viewed the MKV again.
I repeated Steps 3 & 4, adjusting the audio delay until it was right.
Each time, I had to fast forward to the 9th program to see the result.
Between each step, I reran HandBrake to extract the 9th program (based on start/stop times) to verify that, indeed, I was getting what I wanted.
(I realize now that rerunning HandBrake in each loop was probably unnecessary and that I could have extracted the 9th program just once, at the end.)

Is there a better way to determine the needed audio delay than by trial-&-error?
Note that MKVToolNix's "Fix bitstream timing info" check box was unavailable (grayed out).

varekai, I haven't tried all your suggested tools (though I already have and use most of them).

Warm Regards,
Mark.
markfilipak is offline   Reply With Quote
Old 15th March 2020, 14:58   #642  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by tormento View Post
I have a bunch of old AVI file I'd like to convert to MKV but file date is important to remember when they were shot.
Write a small shell script that first determines the modification timestamp of the source file, then muxes them and lastly changes the modification timestamp of the muxed file to the value remembered earlier. For example (this is with bash on Linux, but other OS will surely have similar tools available):

Code:
mtime=$(/usr/bin/stat --format=%Y src.avi)
mkvmerge -o out.mkv src.avi src.mp3
touch -d @$mtime out.mkv
Alternatively create a tag file with the tags you want to use.

Alternatively set the segment header's "date" field with mkvpropedit after muxing.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 15th March 2020, 15:01   #643  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by markfilipak View Post
Ah! I never knew I could right-click on the job in question (there's no indication).
How many programs that make use of context menus have you seen that give explicit hints that there's a context menu available? Serious question. I cannot think of a single one and would like to see how those programs do it.

Quote:
Originally Posted by markfilipak View Post
As you can see, there's no indication why the remux "Failed".
There's a separate box for error messages; the don't show up in the regular output box. What does that error box show?
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 15th March 2020, 15:03   #644  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by giantslirpy711 View Post
EDIT: MOSU, could you possibly help me figure this out.
When I have something to say I usually respond. Therefore: when I don't respond I don't have anything productive to say or don't want to spend time on it.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 15th March 2020, 15:05   #645  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Quote:
Originally Posted by tormento View Post
xvid+mp3/ac3+srt
If your XviD video streams contain b-frames encoded with 'packed bit-stream' I recommend you remove it first - unless MKVToolNix is able to do this now.

Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 15th March 2020, 15:15   #646  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by SeeMoreDigital View Post
If your XviD video streams contain b-frames encoded with 'packed bit-stream' I recommend you remove it first - unless MKVToolNix is able to do this now.



Cheers


Thanks for your precious hint.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 15th March 2020, 16:52   #647  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Thanks for replying.
Quote:
Originally Posted by Mosu View Post
How many programs that make use of context menus have you seen that give explicit hints that there's a context menu available? Serious question. I cannot think of a single one and would like to see how those programs do it.
They indicate it by distinctive text color, or distinctive text background color, or a box, or an underline (like a web page link), or -- least desired -- switching to a finger mouse cursor (like a web page mouse-over on a link). Providing some sort of distinction saves the user having to 'click around' all over the application and it saves the user (me) missing some important info.
Quote:
There's a separate box for error messages; the don't show up in the regular output box. What does that error box show?
I assume you mean the '[X] # errors' thingy in the status panel at the bottom of the application... Right now it says '[X] 0 errors'. I'm pretty sure I clicked it when the failure occurred -- I always do that when an error's indicated. It was my inability either to find an explanation or to find the thing that provides an explanation that prompted me to ask.
markfilipak is offline   Reply With Quote
Old 16th March 2020, 13:58   #648  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by markfilipak View Post
Thanks for replying.

They indicate it by distinctive text color, or distinctive text background color, or a box, or an underline (like a web page link),
All of those methods are only appropriate for cases where context-sensitive content is interspersed in non-conext-sensitive content, such as hyperlinks in otherwise regular text. This isn't the case with MKVToolNix as there all list boxes/tree views have context menus, similar to well-known desktop applications such as Word, Excel or even web browser (where everything actually has a context menu, not just links!). MKVToolNix is a program in the tradition of desktop applications, not a smartphone/tablet app where different rules apply.

Quote:
Originally Posted by markfilipak View Post
I assume you mean the '[X] # errors' thingy in the status panel at the bottom of the application...
No, that isn't what I meant.

Click on the "job output" tool on the left. You'll see a tab with three big text boxes labeled "normal output" (the top one), "warnings" (bottom left) and "errors" (bottom right). Whenever an error occurs, the bottom right box should contain something.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 16th March 2020, 20:10   #649  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Your application is wonderful, but its odd UI and the lack of a log limits usability.
Quote:
Originally Posted by Mosu View Post
All of those methods are only appropriate for cases where context-sensitive content is interspersed in non-conext-sensitive content, such as hyperlinks in otherwise regular text. This isn't the case with MKVToolNix as there all list boxes/tree views have context menus, similar to well-known desktop applications such as Word, Excel or even web browser (where everything actually has a context menu, not just links!). MKVToolNix is a program in the tradition of desktop applications, not a smartphone/tablet app where different rules apply.
I won't push the issue because you're obviously proud of the UI and it's not a big issue to me. But I will say that in 45 years of computer use, I've never seen an app as you describe (aside from MKVToolNix, apparently). The apps that make me happiest are the ones that are 'transparently' easy to use. Let me give you an example: Total Commander; even after 15 years of constant use, I never cease to marvel at its utility and simplicity.

I'm fairly new to MKVToolNix, but I'm pretty happy with it. Inclusion of integrated subtitle & chapter tools (involving some processing of IFO files for DVD, and MPLS files for BD (I think)) would be a very welcome addition.
Quote:
No, that isn't what I meant.

Click on the "job output" tool on the left. You'll see a tab with three big text boxes labeled "normal output" (the top one), "warnings" (bottom left) and "errors" (bottom right). Whenever an error occurs, the bottom right box should contain something.
That's not a log. May I share some firsthand experience? I have no idea why, 11 days ago, an MKV to MKV remux failed at 78%. The failure occurred when I changed the audio stream #s by one place. It wasn't until a couple of days later that I discovered that the source actually had 10 PGCs and that PGCs 9 & 10 had audio that was 4400ms late -- I assume the PTS was in error for the VOB holding those PGCs. I wanted to see whether that was the reason why MKVToolNix failed, but by that time, it was too late to investigate it because MKVToolNix doesn't keep a log.

After I make a MKV using your tool, I use timings from IfoEdit analysis of the IFO to determine the PGCs and then chop the MKV into part-wise MKVs using HandBrake. I'm not really happy with that because HandBrake can't remux and I'm not keen on transcoding. If MKVToolNix allowed me to chop up a source based on the running times shown by IfoEdit, I'd be very happy to do the whole job with MKVToolNix.

Regarding the 4400ms audio error, in that case, I remuxed from VOB to MKV using MKVToolNix, then cut the video apart to make 10 MKVs with HandBrake (with acursed transcoding), and finally, for the 9th & 10th MKVs, moved the audio by 4400ms via MKVToolNix. I'd prefer to cut HandBrake out of the process.

Last edited by markfilipak; 16th March 2020 at 20:26. Reason: Removed prior PS.
markfilipak is offline   Reply With Quote
Old 17th March 2020, 03:35   #650  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
@Mosu

I owe you an apology. Opening 'Job queue' (not 'Job output', as you said) and right-clicking the 'Description' of the failed remux and selecting 'View output' opens a panel (tab) that has an 'Errors' section. That section says, "Could not write to the destination file: 112 (There is not enough space on the disk.)". So there is a log of sorts ...certainly sufficient to figure out what went wrong (at least, in this case).

I complement you for some good documention.

May I ask a question? A chap on the ffmpeg-user list said he uses the MKVToolNix "generate timestamps" option. Is that an undocumented feature? Or was the chap in error?

Warm Regards,
Mark.
markfilipak is offline   Reply With Quote
Old 17th March 2020, 19:28   #651  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by markfilipak View Post
@Mosu

I owe you an apology. Opening 'Job queue' (not 'Job output', as you said)…
Actually I did say that you can right-click on a job in the "job queue" tool & then view its output in the "job output" tool; see this post. But that's fine, often enough I don't read instructions carefully enough myself. So… apology accepted, of course.

Quote:
Originally Posted by markfilipak View Post
May I ask a question? A chap on the ffmpeg-user list said he uses the MKVToolNix "generate timestamps" option. Is that an undocumented feature? Or was the chap in error?
I'm actually not quite sure which particular feature that person is talking about. Normally mkvmerge will re-use existing timestamps for the container a track is read from.

A couple of possibilities:
  1. The "--default-duration" option is the most likely candidate in my opinion. You specify how long each frame or field (depending on how the video was encoded: interlaced or progressive) should be displayed, and mkvmerge will calculate the timestamps from it. mkvmerge will also set the track's "default duration" header field accordingly. With this option mkvmerge does indeed "generate timestamps" from your specification.
  2. With the "--timestamps" option you can specify a file which contains the timestamps for all the frames of a track. mkvmerge will use those timestamps instead of the ones from the source container. There are several file formats for that particular "timestamps file". The option is meant to be used by other tools, not really by humans. With this option mkvmerge does not "generate timestamps" itself, it just uses timestamps someone or something else has generated for mkvmerge.
  3. Maybe the person wasn't talking about timestamps after all but about chapters? mkvmerge can generate chapters based on timestamps, e.g. one chapte every X seconds.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 18th March 2020, 05:05   #652  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Quote:
Originally Posted by Mosu View Post
Actually I did say that you can right-click on a job in the "job queue" tool & then view its output in the "job output" tool; see this post. But that's fine, often enough I don't read instructions carefully enough myself. So… apology accepted, of course.
May I suggest?
"Current Job Output" ...after a job runs
"Current Job Queue" ...before a job runs
"Job History" ...previous job outputs

I like your style, Mosu.
markfilipak is offline   Reply With Quote
Old 18th March 2020, 05:20   #653  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Quote:
Originally Posted by Mosu View Post
I'm actually not quite sure which particular feature that person is talking about. Normally mkvmerge will re-use existing timestamps for the container a track is read from.

A couple of possibilities:
  1. The "--default-duration" option is the most likely candidate in my opinion. You specify how long each frame or field (depending on how the video was encoded: interlaced or progressive) should be displayed, and mkvmerge will calculate the timestamps from it. mkvmerge will also set the track's "default duration" header field accordingly. With this option mkvmerge does indeed "generate timestamps" from your specification.
  2. With the "--timestamps" option you can specify a file which contains the timestamps for all the frames of a track. mkvmerge will use those timestamps instead of the ones from the source container. There are several file formats for that particular "timestamps file". The option is meant to be used by other tools, not really by humans. With this option mkvmerge does not "generate timestamps" itself, it just uses timestamps someone or something else has generated for mkvmerge.
  3. Maybe the person wasn't talking about timestamps after all but about chapters? mkvmerge can generate chapters based on timestamps, e.g. one chapte every X seconds.
Thank you. Yes, I was familiar with all these options. Below is the mailing list thread for your information and perspective. As you see from my query (at the end of the thread), I thought that MKVToolNix might provide a clue regarding the 4400ms audio lead. The early-audio was present only for PGCs 9 & 10 and the only thing I can think of was that the PTS was wrong.
On 03/15/2020 09:41 AM, Mark Filipak wrote:
> On 03/15/2020 09:02 AM, Crazy Red Elephant via ffmpeg-user wrote:
>>> Are they actually disruptive, or could you just keep the original
>>> stream as is, knowing 1 out of 120 frames or something will be
>>> dropped when playing back?
>>
>> To me, yes. I know some other users also reported something about
>> playback issues numerous times but the stream provider doesn't seem to
>> care.
>>
>> I think I mentioned before that remuxing the video with MKVToolNix and
>> the "generate timestamps" option checked...
>
> Can you help me find the "generate timestamps" option? I can't find it.
> I'd like to see what it does with a VOB that has 8 PGCs that are okay,
> but the 9th & 10th PGCs have audio in advance of video by about 4400ms.
>
> Regards,
> Mark.

Last edited by markfilipak; 18th March 2020 at 05:45. Reason: Clarified; "PTS" was "PTC" oops
markfilipak is offline   Reply With Quote
Old 18th March 2020, 11:39   #654  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Remux file oops!

I discovered (the hard way) that MKVToolNix doesn't handle things well if the input and output are the same file name.
It would be nice if overwriting were possible.
markfilipak is offline   Reply With Quote
Old 18th March 2020, 13:02   #655  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by markfilipak View Post
I discovered (the hard way) that MKVToolNix doesn't handle things well if the input and output are the same file name.
It would be nice if overwriting were possible.
Overwriting a file you're reading from is definitely not supported and never will be. mkvmerge should abort with an error message if this is attempted.

The are several reasons, e.g. there's a distinct possibility that data to be written is generated faster than data is read from the source file; in that case data that hasn't been read yet would be overwritten by the output data. Not a good idea.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 18th March 2020, 20:37   #656  |  Link
Liisachan
李姗倩 Lǐ Shān Qiàn
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,340
GUI: the default destination file name may cause errors if --title contains a slash

Hi, I'd like to report a possible issue of the GUI.

The default destination file name, auto-generated by GUI, may cause errors or unexpected behaviors, at least on my Windows machine, in some situations related to a slash (possibly also a colon?) in the --title.

Example 1
You have "La Rose - Partie 2.264" and want to make "La Rose - Partie 2.mkv". You want to give it a title "La Rose / Partie 2". A command line like this will work fine:
Code:
mkvmerge -o "La Rose - Partie 2.mkv" "La Rose - Partie 2.264" "La Rose - Partie 2.ogg" --title "La Rose / Partie 2"
On GUI, when you select source files like above, "La Rose - Partie 2.mkv" is automatically set as the destination, which seems fine. You can type "La Rose / Partie 2" in the "File title" editbox, which seems fine too. But then, when you're happy with the default destination shown and click "Start multiplexing", you got an error like this:
Code:
Errors emitted by job 'Multiplexing to file " Partie 2.mkv" in directory "X:\path\La Rose "' started on 2020-03-18 18:26:13 ---
The file 'X:\path\La Rose \ Partie 2.mkv' could not be opened for writing: open file error.
The problem seems to have two aspects:
1) GUI design: Before and when you click Start, the "Destination file" editbox is saying "X:\path\La Rose - Partie 2.mkv". GUI suddenly changes its mind after you click Start, even though you do want to create "X:\path\La Rose - Partie 2.mkv". If the default destination changes, the editbox showing it should be updated accordingly before the user clicks "Start multiplexing" (e.g. when the "File title" editbox is updated and loses the focus).
2) Technically it's possible to create a file "X:\path\La Rose \ Partie 2.mkv" on Windows (though this is probably not what the user wants to do), but the tools fail to do that: it seems that they can't handle a folder name with a trailing space in this case.

Example 2
Suppose the --title should be "Take a 50/50 Chance!" GUI works fine with this title, but if the destination file name is auto-generated, then a sub-folder "Take a 50" is created, in which a file "50 Chance!.mkv" is written. Obviously this is not what the user wants. Like Example 1, the user doesn't know this will happen until after they click the "Start multiplexing" button.
Liisachan is offline   Reply With Quote
Old 18th March 2020, 23:22   #657  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Nice catch, thanks. I'll have to replace all characters Windows doesn't allow in file names before copying the title to the file name.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 19th March 2020, 06:56   #658  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly San Jose, California)
Posts: 277
Quote:
Originally Posted by Mosu View Post
Nice catch, thanks. I'll have to replace all characters Windows doesn't allow in file names before copying the title to the file name.
As an alternative, you could %-hex the offending characters. For example, "Take a 50/50 Chance!" would become "Take a 50%2F50 Chance!". Or you could simply replace any offending characters with hyphen of course.

Last edited by markfilipak; 19th March 2020 at 06:57. Reason: I know, but I'm not telling
markfilipak is offline   Reply With Quote
Old 19th March 2020, 12:41   #659  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Replacing consecutive invalid characters with a single hyphen is what I was thinking about. I don't like % encoding for normal folks as they don't really understand what's happening and what that's supposed to mean.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 19th March 2020, 13:23   #660  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Mosu View Post
For example (this is with bash on Linux, but other OS will surely have similar tools available)
Ask me anything about hardware but I am a noob about programming software.
Quote:
Originally Posted by Mosu View Post
Alternatively create a tag file with the tags you want to use.
Months ago I asked you to set language from filename convention and at the beginning you were reluctant. After some silent months, you coded it and it's really useful.

I think it would be useful for a lot of people to have the stream file date and time saved in the mkv container, so being resilient to cuts and other manipulations.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Reply

Tags
matroska

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.