Friday, September 04, 2015

How to Split a Matroska MKV file without re encode or any dumb software

The command line is:
"C:\Program Files\MKVToolNix\mkvmerge.exe" -o NewFile.mkv -v --split 3G --link "TheVeryLargeFileYouWantToSplit.mkv"

For a 4 gig file on an SSD, it took a total of 44 seconds.

You can split by size, time, chapters, precise frames, etc.... (note that in my example it would be 3G for 3 Gigabytes) or you can use (01:00:00 for 1 hour chunks)

The crucial option here is the --link option which is dryly explained below, but it basically means that the file looks, acts, feels like you never actually split it, but now it exists on the hard drive in multiple files, that are referencing each other. Your player software will continue on with no gaps, jumps, and the chapters and elapsed time intact. (hopefully you are using MPC-HC & LAV codecs on your computer).
(the -v is for verbose = prints status of what its doing )

Download:
https://www.bunkus.org/videotools/mkvtoolnix/downloads.html#windows
Note:
Using the program MediaInfo, you can open the MKV file you want to split, and read the version of MKVMerge that was used to create it, and its recommended to use at least that version to edit/split/link it, in case its using some new features (probably not - and if not, you can use older mkvmerge versions to split newer files). Also - 
Its possible that you can download too new of a version of MKVToolNix that is incompatible with your player, as sometimes the latest version will write an incompatible header for older players/boxes.  I'm using 6.8.0.0 because i've tested all my devices on it, and using version 8.3.0 which is the latest version as of this blog post, might break small things in edge case scenarios and I won't know until its too late when I go to try to play it back (So i've heard). So test on standalone bluray players/Stream boxes, and if you experience problems on playback, try to download the next major old version, unless you need some new feature, at the cost of retro compatibility. The changelogs are here (and really quite hard to read, but CTRL+F search for "Released v" which you can also use to search builds by date). 

-------------------------

Multiple ways to split:

 as per the --help switch of mkvmerge.exe:

 File splitting, linking, appending and concatenating (more global options):
  --split <d[K,M,G]|HH:MM:SS|s>
                           Create a new file after d bytes (KB, MB, GB)
                           or after a specific time.
  --split timecodes:A[,B...]
                           Create a new file after each timecode A, B
                           etc.
  --split parts:start1-end1[,[+]start2-end2,...]
                           Keep ranges of timecodes start-end, either in
                           separate files or append to previous range's file
                           if prefixed with '+'.
  --split parts-frames:start1-end1[,[+]start2-end2,...]
                           Same as 'parts:', but 'startN'/'endN' are frame/
                           field numbers instead of timecodes.
  --split frames:A[,B...]
                           Create a new file after each frame/field A, B
                           etc.
  --split chapters:all|A[,B...]
                           Create a new file before each chapter (with 'all')
                           or before chapter numbers A, B etc.
  --split-max-files <n>    Create at most n files.

------------------------------

Boring:
Copied from the documentation file in "C:\Program Files\MKVToolNix\doc\en\mkvmerge.html", Section 11:

11. File linking

Matroska(tm) supports file linking which simply says that a specific file is the predecessor or successor of the current file. To be precise, it's not really the files that are linked but the Matroska(tm) segments. As most files will probably only contain one Matroska(tm) segment the following explanations use the term 'file linking' although 'segment linking' would be more appropriate.
Each segment is identified by a unique 128 bit wide segment UID. This UID is automatically generated by mkvmerge(1). The linking is done primarily via putting the segment UIDs (short: SID) of the previous/next file into the segment header information. mkvinfo(1) prints these SIDs if it finds them.
If a file is split into several smaller ones and linking is used then the timecodes will not start at 0 again but will continue where the last file has left off. This way the absolute time is kept even if the previous files are not available (e.g. when streaming). If no linking is used then the timecodes should start at 0 for each file. By default mkvmerge(1) does not use file linking. If you want that you can turn it on with the --link option. This option is only useful if splitting is activated as well.
Regardless of whether splitting is active or not the user can tell mkvmerge(1) to link the produced files to specific SIDs. This is achieved with the options --link-to-previous and --link-to-next. These options accept a segment SIDin the format that mkvinfo(1) outputs: 16 hexadecimal numbers between 0x00 and 0xff prefixed with '0x' each, e.g. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 hexadecimal numbers between 0x00 and 0xff without the '0x' prefixes and without the spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'.
If splitting is used then the first file is linked to the SID given with --link-to-previous and the last file is linked to the SID given with --link-to-next. If splitting is not used then the one output file will be linked to both of the twoSIDs.

---------------------

Side Note as a reason for creating this blog post: 

-You can not just use any old file cutter utility to chop the file in half and then repair it.
-If you search for how to do this online, you get about 100 horrible freeware,shareware, malware laden and general JUNK video editor programs. So annoying....

Monday, August 17, 2015

Bring your own device + Virtualization / KVM idea, to combine two computers into one seamless software experience.

I just thought of an incredible Idea that would make me a millionaire if i was able to prove the concept
imagine putting your entire computer on a USB flash drive, like live-USB basically
and then you bring it to someones house and you plug it in
this is the current method which is clunky and its either Theirs or Yours, and requiring reboots
Now imagine if its not ONLY storage - but has blue-tooth,WiFi, and a CPU, like a compute stick
barely enough hardware to make it work.
and there's a "synergy" interface between the two devices
and you can basically run programs from your computer ON theirs
no reboots. It would run inside a host app.
the hurdle is to like remove all the software barriers of doing such a thing so anyone can do it
and then find the proper device to really help this idea thrive.
i mean, I can attempt such a thing today with a great deal of prep-work and manual configuration
All that's required is to create the automatic interoperability software

a better way to explain it would be:
 "a blue-tooth enabled computer that pairs to someone else's computer" with software to remove barriers between the two, so you could use BOTH computers at once
not all that far fetched IMO!
it would rely heavily on virtualization and sandboxing just to keep things secure
essentially, a virtualization, KVM, sandbox, VM host App 
the appearance of x86 phones really make this sound possible to me
the phone only needs a WiFi chip, a cpu, minimal amount of ram to run a hypervisor, ~256gb-1TB+ storage to fit everything you want to bring with you
and then blue-tooth to initiate the pairing. which then hands-off to WiFi
you open the VM/sandbox app on the host PC, initiate the blue-tooth pairing process, and then your hard drives are made available, the host reads your icons, programs, registry, documents, and sorts EVERYTHING out (not as hard as it sounds)

phase 2 of the idea would be getting the mobile device powerful enough to where you could comfortably do the reverse - probably 5 years away
Nobody has thought of this probably, because laptops are self sufficient, do not need pairing, and phones are typically ARM and largely incompatible and off in their own ecosystem and seen as an impossible task which even microsoft nor apple cannot unify or accomplish.
however, i do believe we're closer to this on Windows 10 + x86 than Apple is with OSX + IOS, and that independent developers can even be the one to prove this before the big guys take over.

who knows, in a few years, our addiction to carrying around phones, and making phone calls, and calling the thing a "phone" will be gone, and we just call it a computer.....
and theyd be able to basically have this like "cellular chip" that plugs into a flap on the back to enable phone calls. that may be taking the concept too far too soon but there you have it!
you could even implement a docking station to connect @ Thunderbolt 3's 40Gbps or USB 3.1 10gbps + Displayport, and improve pairing and connectivity speeds.

Tuesday, January 20, 2015

Stop External USB Hard Drive from Auto-Playing in Windows 7

The instructions on the internet are very long, and confusing and for some reason this can only be done through the registry.

To disable it one drive letter at a time:

ZYXWVUTSRQPONMLKJIHGFEDCBA
00000000000000000000000000

This chart above is important and the key to this process. It is in binary code. 
Copy it into notepad for editing. Under the letter you want to disable, change it from 0 to 1.
0 means enabled. 1 means disabled.

  1. Open calculator. Click the menu "View | Programmer".
  2. On the left of the 4 bubbles, select "Bin" (for binary). 
  3. Now copy and paste the binary numbers from notepad into calc.exe
  4. Now click the bubble "Hex" (to convert to hex).
  5. Copy the result (or remember).
Now open regedit.exe and navigate to: 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

On the right side, you should see a bunch of stuff already there.

Click the menu "Edit | New > DWORD (32-bit) Value"
Give it the name: NoDriveAutoRun
Enter the value from calc.exe (and make sure the bubble is on Hex)
DONE!

To disable it for one Type of drive:

There is another method that disables it for an entire type:
(Removable (USB flash or HD) / Non-Removable (HDD) / Network / CD-DVD / RAMdisk).

The process is the same as above, in the same registry location but the entry is called:
NoDriveTypeAutoRun

Using the chart below, change the appropriate column from 0 to 1, and follow steps 1-5 shown above.

00000000

Bit numberBit patternDrive type
200000100Disk that can be removed from the drive (such as a floppy disk or USB flash drive)
300001000Disk that cannot be removed from drive (usually a hard disk)
400010000Network drive
500100000CD/DVD drive
601000000RAM disk
Notice the 3rd column is Bit #2 because binary starts with 0. Bit #1 does not seem to exist.
(not listed above, Bit #0 and Bit #7 controls Disables AutoRun on drives of unknown type.)

The default is 0x00000091 (91 Hex) or "145" (Dec) or "1001 0001" (Binary)
Meaning by default, unknown types and network drives are disabled, and everything else is enabled.

Cheat Sheet:
ValueDescription
91AutoRun is enabled for CD/DVD drives and USB flash drives
95AutoRun is disabled for USB flash drives
B1AutoRun is disabled for CD/DVD drives
B5AutoRun is disabled for CD/DVD drives and USB flash drives

To disable it for everything:

Follow the process for "type" and use the same key ( NoDriveTypeAutoRun )

If you want to disable all the types listed above:
Use the bit-mask "01111100" in binary, or "7C"(Hex) or "124" (Dec)

If you want to disable EVERYTHING (even drives with an unknown type):
The bit-mask "11111111" in binary, or "FF" (Hex) and "255" (Dec) 

Just fill in this hex code into the NoDriveTypeAutoRun entry.
Theoretically Autoplay would never show up again.
Enjoy.

Sub-Note:  The NoDriveTypeAutoRun subkey value in registry has higher priority than the setting in the "Control Panel > AutoPlay Options".
So if AutoRun for a drive is disabled via NoDriveTypeAutoRun then you can not enable it by using the Control Panel. 

Side Note: Apparently, you can edit the same location in HKEY_LOCAL_MACHINE to make it machine wide, instead of per-user.

Saturday, January 10, 2015

SB X-Fi Titanium HD JP2 pinout

Sound Blaster X-Fi Titanium HD
The expansion port is labeled JP2.

The old audigy/sb Live AUD_EXT Pinout (above right) does not match this sound card!!!! This image is provided for curiosity only.


A standard 40 wire IDE cable is able to be plugged into the JP2 port, which I used to make testing the individual pins easy. Pin 1 (the Pink wire) corresponds to the marked arrow.

Voltages of JP2 in Millivolts:

 1  -  0
 2  -  23 mv
 3  -  0
 4  -  0
 5  -  23
 6  -  0
 7  -  3210
 8  -  23
 9  -  0
10  -  0
11  -  24
12  -  123-139
13  -  0
14  -  0
15  -  1460
16  -  23
17  -  168
18  -  50-80
19  -  0
20  -  26
21  -  0
22  -  0
23  -  3230
24  -  2500
25  -  1466
26  -  24
27  -  25
28  -  3210
29  -  24
30  -  0
31  -  24
32  -  24
33  -  1295
34  -  22
35  -  1520
36  -  23
37  -  1636
38  -  30
39  -  50-80
40  -  23

Monday, June 02, 2014

Lucid Dream and Levitate

I just had a shocking lucid dream. If I find that I have complete control in the dream, I can levitate my 1st person view and I woulda thought that to anyone in the dream they could see my body levitate. But nobody ever can. I always levitate to try to shock the dream subjects, and its useless, nobody can even see it let alone appreciate it....... But just now, there was a girl in the dream at a family party, decided to levitate (indoors, so only a couple feet off the ground) and she was the only person who could see it even though others in the room were looking right at me. Shoulda seen the expression on her face, she let out a gasp of shock put her hand on her head and she ran into the bathroom, so I came down out of levitation and I said "You can see that?" and she just nodded yes, and I said "sorry, can i come in?" and she let me into the bathroom with her. (to find out the explanation). Before I could explain anything I was jolted awake and onto my feet within a split second and stumbled around my room before I could walk properly.

I'm posting this because out of hundreds of times of levitating in box stores, parking lots, open fields, music festivals, (in the dream obviously) not one person has ever been able to see it. I just do it for my own fun. But she could. And I was jarred awake before the universe could let me explain it to her. I think because there's some kind of inherent protection where the dream subjects can't know they're part of a dream.(because I have been jarred awake by other conversations, and if you try to coax information out of the dream subjects about supernatural phenomenon or anything that a normal physical bodied human wouldn't be able to answer they just stay silent with a blank stare). And inevitably I would have revealed to her that she was part of my dream (really cause its the only true explanation, and yes I know very well the dream is a dream while i'm dreaming it), so I was jarred awake so forcefully that it even prevented me from re-entering the dream. (which I can make happen maybe 1% of the time).

For anyone wondering about the levitation, It's sort of like floating but you can control it. Its as if I were space, with little jet thrusters, they can overshoot the target so if you are going too fast, you can't land or turn properly. The jets are basically mounted to my upper back or shoulders, because when flying fast, my legs trail behind me at maybe a 45 degree angle, not straight back like superman. I've gone as high as the hi-voltage overhead main distribution power lines, which is about 300-500 feet i suppose. One time I wanted to see if I could be entangled in the power lines and the answer was no. For example its exactly as if I was in No-clip mode in the video game Doom.  I haven't been able to try to go through more solid objects, it might be impossible because my brain has no reference for what seeing through  solid objects looks like. I think that perhaps my body but not my head can pass through objects, or that only the upper shoulders/neck/head is prevented from going through solid objects, because I have experienced what i presume were my legs (or where biopositioning tells me my legs should be) having gone through tables and cars.