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. |
24th October 2020, 19:06 | #901 | Link |
MKVToolNix author
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,281
|
I know you're venting, and I get why. Nevertheless, let me take that opportunity to write a bit about command-line design.
Why do we have to use "--help" instead of "-?"? Why do we have to use "--sync" instead of "-sync"? Why do we have to put file-specific options in front of the file they apply to instead of after them? Because there isn't a Single Right Way to design command line options. There are a lot of different schemes out there, and have been over the years. I do try to be somewhat consistent, I do try to follow existing conventions where that makes sense (e.g. "--help" is the standard for GNU tools and tools for Linux/Unix in general instead of "-?" which is more at home in the Windows world). But often enough there is no precedent for what I'm implementing. So I invent stuff. As for a precedent I couldn't really find one. On Linux/Unix we usually don't have a problem with command-line options as the Unix shells have always had a high length limit (usually 32 KB). On top of that Linux/Unix shells don't have that character set dichotomy that Windows has with its ANSI & OEM character sets & that cmd.exe was basically a piece of shit you couldn't rely on, especially when trying to deal with Unicode file names & Unicode text input & output. Therefore Linux/Unix tools didn't really need & didn't really have options for reading additional command-line options from a file. If you wanted to put those into a file, you did that and used syntax such as "program `cat file-with-options.txt`". However, the backticks `…` are interpreted by the shell before the program is executed, meaning that the shell's limit of 32 KB applied. cmd.exe didn't have such a thing such as backticks. Nowadays cmd.exe is… better. Somewhat. Anyway, the point was that there wasn't a established, commonly-used precedence for such an option I could follow. I did think about using something like "--options" instead of "@", but "--options" would have been way to general for my taste. I though about "--command-line-options", but that's rather long. So I thought about other ways to signal what to do with the file, and I already had my own precedence of prefixing file names with "+" for signalling that the file should be appended. @ has the nice property of not being a special character in shells (bash, zsh, cmd.exe etc.) and doesn't have to be escaped unlike other candidates such as ` * ! < { [ Back in the day I also favored having short option names over longer but explicitly named ones, an stance I've changed opinions on since (see below). Next time you cannot get something to work may I kindly suggest you ask a bit earlier before getting all worked up about something that isn't all that important in the grand scheme of things? We are happy to help. Addendum: here are a couple of things I might design differently if I ever reworked the whole command line interface, in no particular order:
The power of hindsight… It sure would have been nice to have all that insight before I started work on the project, all those nearly 18 years ago.
__________________
Latest MKVToolNix is v83.0 If I ever ask you to upload something, please use my file server. |
24th October 2020, 20:00 | #902 | Link |
RipBot264 author
Join Date: May 2006
Location: Poland
Posts: 7,816
|
Yes, I was frustrated that I was unable to understand how this was supposed to work. Personally I have never seen other command line tool using similar way of loading configuration file. --command-line-options looks logical. I don't care if IT is not ultra short. If you plan to merge all tools use mkvtoolnix name instead of meaningles mtx which will be burrowed in search results.
__________________
Windows 7 Image Updater - SkyLake\KabyLake\CoffeLake\Ryzen Threadripper |
25th October 2020, 11:08 | #903 | Link | |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
Following does not give output due to splatting: Code:
Desktop> Write-Host @aaa Desktop> 2. Here Strings 3. Arrays 4. Hash Tables In mpv(.net): --include=<conf file>
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
25th October 2020, 11:30 | #904 | Link | |
MKVToolNix author
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,281
|
Quote:
That adds another _configuration file_ to parse, not a set of command line options. Not the same thing. Options for parsing additional config files are common for tools that work with config files a lot. And even for those the option names have never been standardized, e.g. "--include" like you wrote for mpv, "--load" for Emacs, "-u" for vim etc. etc. I don't. That was more of an observation of how things might look if MKVToolNix didn't exist and I was just starting implementing it.
__________________
Latest MKVToolNix is v83.0 If I ever ask you to upload something, please use my file server. Last edited by Mosu; 25th October 2020 at 11:35. |
|
25th October 2020, 12:04 | #905 | Link | |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
Using the border property on the command line: --border=yes --border=no --no-border --border In the conf file: border = no Maybe there are many tools that work like this, I know only mpv however.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
25th October 2020, 12:45 | #906 | Link | |
Matroska find' ich toll
Join Date: Apr 2008
Posts: 1,380
|
Quote:
Also hSplit and DiscShare uses such a command-line parameter to load params from external files. I like the "@" prefix. |
|
9th November 2020, 16:13 | #907 | Link |
Registered User
Join Date: Oct 2013
Posts: 207
|
I think I spotted a bug in MKVToolnix. It has to do with splitting and appending. Using last version, of course, and also last Codecguide.com version from the codec pack.
Well, I have a huge file here, and I told MKVtoolnix to split into 5 parts total (never mentioned a number, I put unlimited parts and 15200 MB for each part, to fit a free Google Drive account). Of course later we could use "append" and join all 5 parts. ********* First of all, this is the data (MEDIAINFO) from the original file. As you can see it's huge, and has multiple subtitles and audio tracks. https://pastebin.com/0QWZ6hHM ****** If I open this file with MPC-HC (total lenght: 1 hour and 56 minutes) and go to... (Before mentioning that, I must say that MPC-HC is using madVR (my monitor is old, W2452V), and in filters this is what it says here: I opted to use ffdshow audio... in MPC because it allows me to increase the volume (I use 5 db +), while LAV doesn't. Back to what I was going to say: If I open the original HUGE file (look into pastebin) with MPC-HC (total lenght: 1 hour and 56 minutes) and go to... 1 hour, 9 minutes and 30 seconds... everything plays fine, selecting the 1st audio track, I named "Dolby Atmos". However (and this is where I spotted a problem) the splitted files... When I open file number 4 of 5, it starts playing the moment mentioned above, from 1 hour and 9 minutes. ***** FILE 4 of 5 ***** At 1 second the audio (track: Dolby Atmos) plays, but interrupts and resumes for a very brief moment, I would say 250 ms more or less, however you can hear clearly (no question about this) that there is a dropout (the technical term for this), because it's as if at this very brief moment the audio was interrupted and then resumed at the same time. This video shows exactly what happened with this file (part 4 of 5, splitted by MKVToolnix): https://www.youtube.com/watch?v=lbgz2vVxHow Audio drop out can occur at any time during the playback of a file and can be as short as a frame and up to multiple seconds or minutes. The result is either the back ground music is only heard or the audio goes completely silent while the video is still progressing without issue. Of course I tried playing all other audio tracks to see if (still in MPC) this would happen. Track 2 is named as Dolby Digital 5.1. Track 3 as DTS-HD MA 5.1, track 4 as DTS 5.1. None of them showed audio dropout. Only this DOLBY ATMOS. Again: this has not happened in the original HUGE file, before the splitting. ***** Then, not satisfied, I tried playing this part 4 of 5 in another player: VLC. This is what is reaaaaaaaaaaaaally odd: VLC while playing the track Dolby Atmos HAS NO AUDIO DROPOUT!!!!!!!!!! And opening the original HUGE file everything fine at 1 hour and 9 minutes. ********* So, I had another idea: why not block ffdshow audio processor from MPC... and try with LAV instead? What was the result? No change! Audio dropout still there in file 4 of 5!!!!!!!!!!!! Meaning only MPC had a problem with this. ******** OK, so how do I know this is MKVToolnix's fault? Another great idea: why not... open file "3 of 5" (splitted from the original HUGE) in MKVToolnix... and append with part 4? That way we have files 3 + 4 (of all 5 parts), and we can go directly to the scene with this drppout, however without this dropout happening 1 second after the file starts. FILES 3 + 4 appended = 29 GB (original file has 73 GB). The moment the scene with the issue starts in 3+4 is after 22 minutes and 55 seconds. ********* What happened there? And please note this is using LAV, not ffdshow audio processor: 1) At 23m01s the video FROZE. That's right: THE IMAGE JUST FROZE!!!!!!!!!!!!! Audio was still playing. After 4 seconds the video resumed. 2) At 23m02s the audio was MUTED. This was not a dropout: video frozen, no audio. Only at 23m06s the audio could be heard again. 3) And that's not all! Even though audio resumed at 23m06s, we had a dropout at this precise moment and at 23m07s the audio resumed, and from now on no more problems. If I select any other audio track, such as #2 DD 5.1, #3 DTS-HD MA... it will have the same issue. The only difference is that I believe there will be no audio dropout, however at 23m07s when the audio resumes, we can hear right before, and this is veeeeeeery brief, a harsh sound that is heard when a radio transmission had been interrupted badly and is now being reestablished. ****** More tests: turning ffdshow audio processor ON again in MPC. No change. And I believe 2 audio dropouts during these seconds, 23m02 and 23m07s. What about VLC? (note: same result with ALL tracks) At 23m 0 seconds: video frozen, audio muted. 23m04s video resumed. 23m05s audio resumed. I don't think I heard a dropout, only a technical sound of the audio signal being restablished from a dropout. ******* Bottom line and to sum everything up: - Original file is fine; - After splitting into 5 parts, part 4 of 5 had audio dropout after 1 second of playback; - After appending parts 3 and 4, not only the audio dropout remained there, we now had 4 seconds of lost content, video frozen and audio muted. What is going on here? I never had a similar issue with MKVToolnix. And I have been appending and splitting files FOR YEARS. As you can see this can't be the Dolby Atmos fault, because the video freezing at this scene indicates a problem splitting and appending only in this moment of the movie. If you play the original HUGE file and there is nothing wrong with it, then what's the explanation? P.S. This is MEDIAINFO for part 4 of 5: https://pastebin.com/JKQG7YFG And this is MEDIAINFO for parts 3 + 4 appended: https://pastebin.com/41BY7NK3 Last edited by Perenista; 9th November 2020 at 16:16. |
9th November 2020, 17:41 | #908 | Link |
Matroska find' ich toll
Join Date: Apr 2008
Posts: 1,380
|
I believe the issue is "splitting and appending".
I had used it also for a long time, and mostly it works but for some mkv's not and in such a case I decided me not to split the file. (preserve entire content) After splitting you have at the end of the split files often audio data with bigger timestamps as the video. I'm sure each split file plays fine. But when you append the files this will produce gaps for the video. I suggest you use a binary file splitter like hSplit. Only with this you have after splitting and joining a bit identical file and therefor no playing issues. |
9th November 2020, 17:44 | #909 | Link |
Registered User
Join Date: Oct 2013
Posts: 207
|
OK, I think I figured out what went wrong here. And if that's the case then this isn't MKVToolnix's fault, it's just that MKVToolnix makes the problem evident, when there's something fishy going on.
- While playing the original disc everything looks fine in both MPC and VLC. - After using MAKEMKV to convert into Matroska, we have this huge file, that has 73 GB. - I said this HUGE file had no problems. But that isn't true, sadly. However while playing in MPC and VLC you don't notice if you are not looking with more attention. After this scene (no freezing or audio dropout where I said) a few seconds later there's a very quick audio dropout in MPC, and not in VLC. But (and this is where things get interesting) VLC compensates for the late audio dropout by not letting the movie run smoothly and SKIPPING FRAMES! In other words, the video accelerates in less than a second to the next frame to not let me notice the audio dropout in VLC (yet I could spot after looking carefully!), and this doesn't happen in MPC. What everything I said indicates? - That the original disc was defective in this area from the movie, after 1 hour.... - Perhaps it only affected this specific scene; - Or (another possibility) this is MAKEMKV's fault. When MAKEMKV tried to save the disc as MKV, maybe it did something wrong. Maybe AV synchronization issues due to a bad disc (scratched...) or a problem created by the distributor while handling the DISC, which warrants a RECALL. There's just one thing: that huge file (MKV) had already been handled by MKVToolnix, since I inserted additional tracks in it. So this was not the original file MAKEMKV had created. Meaning this could still be MKVTOOLNIX's fault. I am not seeing how because no errors were reported by it. To figure out the answers once and for all, this is what I am going to do: - Delete everything already created and go back to the original disc. - Use MAKEMKV again to create another file. - Inspect this file and if everything is OK, then use MKVTOOLNIX to edit again. I'll post the results later, and this is the only way to be sure the disc was indeed defective, I don't believe my SSD drive is and a bad block affected this part of the file. This is very bad because it is a silent issue that someone may never notice until it inspects the file. Of course it would be expected from us users to not look into 100% of the files/contents we edit in all these softwares, right after. Even worse is the fact in the original disc everything looks fine, no dropout or skipped frames. Last edited by Perenista; 9th November 2020 at 17:51. |
9th November 2020, 18:23 | #911 | Link | |
Registered User
Join Date: Oct 2013
Posts: 207
|
Quote:
https://i.postimg.cc/J0pF2MrD/XXAs.png Unfortunately this is either a MAKEMKV bug or a defective disc. This is now 100% confirmed, because when I opened the disc again, and saved, I saw this warning: When I looked into this thread: https://www.makemkv.com/forum/viewtopic.php?t=21079 People were saying this was an innocuous warning. It turns out it isn't! And this content HAS Dolby Atmos, too. So this is not a coincidence. Either the media is defective (and I have no reason to believe that) or MAKEMKV is not handling these discs properly. Either way, this was NOT caused by MKVTOOLNIX. Splitting and appending had no bearing in what happened. I'll now check my options and report this to them, too. P.S. I said in the MakeMKV thread this is a bug from MakeMKV + the fact we are including the Dolby Atmos track. Once we leave the Atmos track out, nothing happens: https://www.makemkv.com/forum/viewto...p=99292#p99292 It took me the entire day to figure that out. I'll leave this track outside my file until they fix this bug. Last edited by Perenista; 9th November 2020 at 23:56. |
|
12th November 2020, 13:08 | #912 | Link |
Registered User
Join Date: Mar 2007
Posts: 934
|
Does anyone know of a media player that actually supports MKV's cropping flags? I can set the flags using MKVToolNix GUI and MediaInfo shows the cropped dimensions correctly, but every single player I've tried ignores the flags: Kodi, MPC-HC, VLC.
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 |
12th November 2020, 13:50 | #913 | Link |
Registered User
Join Date: Jun 2020
Posts: 303
|
h264/hevc bitstream crop modification with ffmpeg works ok in most software players (tested in mp4).
https://forum.videohelp.com/threads/...e)#post2592742
__________________
bShaders: realtime Effects/filters for video players |
12th November 2020, 14:27 | #914 | Link |
Registered User
Join Date: Apr 2008
Location: Russia, Vladivostok
Posts: 2,788
|
MPC-BE(with internal filters) support.
__________________
AMD Ryzen 5 3600 /GIGABYTE B450 Gaming X /Patriot 32Gb@3200 /Kingston 500Gb M.2 /RTX 4060 /Samsung U28R550UQI /OLED Philips 55OLED707 /Yamaha RX-V471 + NS-555 + NS-C444 + NS-333 + YST-SW215 |
12th November 2020, 15:46 | #915 | Link | |
Registered User
Join Date: Mar 2007
Posts: 934
|
So it does. Shame it doesn't support madVR out of the box, but I guess that's proof that it does work when properly implemented. It's rather annoying that most players haven't implemented it yet despite some rather old feature tickets being open!
Quote:
Code:
ffmpeg -i "original.mkv" -codec copy -bsf:v h264_metadata=crop_left=240:crop_right=240 -aspect 1440:1080 "test.mkv" I also tried extracting the h264 stream and running that through ffmpeg, then remuxing to MKV. Same issue. I also tried outputting to .mp4...same issue. Tried using both ffmpeg 4.2.4 & 4.3.1. Maybe it's because the video is interlaced? I've uploaded a 10s sample here in case anyone else wants to try. EDIT: Never mind, it works fine but only when cropping in multiples of 64. The closest crop I can get is: Code:
ffmpeg -i "original.mkv" -codec copy -bsf:v h264_metadata=crop_left=192:crop_right=192 -aspect 1536:1080 "test.mkv" Code:
ffmpeg -i "original.mkv" -codec copy -bsf:v h264_metadata=crop_left=192:crop_right=192 -aspect 1575:1080 "test.mkv"
__________________
TV Setup: LG OLED55B7V; Onkyo TX-NR515; ODroid N2+; CoreElec 9.2.7 Last edited by DragonQ; 12th November 2020 at 16:59. |
|
12th November 2020, 18:08 | #916 | Link |
Registered User
Join Date: Jun 2020
Posts: 303
|
I'll have to revisit this.
The cropping part is well supported I think, the issue is that it can mess up the AR when played. I don't know if there is a solution. Landscape top and bottom mod-8 crops may be better supported.
__________________
bShaders: realtime Effects/filters for video players |
13th November 2020, 12:03 | #917 | Link |
Registered User
Join Date: Mar 2013
Posts: 21
|
Hi you fine people. I have a muxing problem. I downloaded a video from the web which has lossy audio. I used a sound editor to make a new audio stream (source is from a lossless 24bit 96khz recording) which is absolutely in sync with the original audio file which I demuxed. I then remuxed the video and the new audio but the sync is way off. I synced many of concerts and replaced plenty of audio streams but this time the procedure is not working. I am encountering the same problem with two concerts. What could be the issue? It is the first time I try this approach. Usually I use Adobe Encore to make a blu-ray but now the videos are 4k and I decided to go for a file version and not alter the video source.
|
13th November 2020, 12:49 | #918 | Link | |
SuperVirus
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
|
Quote:
or even a good guess :-/ The sync problem might be caused by the video streams and not by the new audios... MediaInfo reports and/or sample files would help. |
|
13th November 2020, 13:25 | #919 | Link |
Registered User
Join Date: Mar 2013
Posts: 21
|
thanks! how I can I make a sample? the files are huge.
when I put the demuxed video on a adobe premiere timeline along with the new audio stream I created, it is perfectly in sync, just not when I mux it with mkvmerge or tsmuxer... |
14th November 2020, 12:20 | #920 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,915
|
The rule 6 of this forum
Quote:
__________________
BeHappy, AviSynth audio transcoder. |
|
Tags |
matroska |
|
|