September 25, 2023

Github Business

Business Printing

Video clip Hacks | Hackaday

Lacking a DVD drive, [jg] was viewing a Television series in the form of a bunch of .avi video information. Of system, when each episode includes a whole intro, it is only a make a difference of time ahead of that gets way too annoying to sit via.

Chapter breaks reliably inserted all around the intro, even when it does not usually occur in the same place.

The standard process of skipping the intro on a simple online video file is a simple a single:

  1. Manually drag the playback ahead past the intro.
  2. Oops which is too significantly, provide it back again.
  3. Ugh reversed it way too substantially, nudge it forward.
  4. All right, which is great.

[jg] was specific there was a superior way, and the solution was making use of audio fingerprinting to insert chapter breaks. The plain video clip information now have a chapter breaks around the intro, letting for effortless skipping straight to content. The cause guiding picking out this strategy is simple: the demonstrate intro is normally 52 seconds prolonged, but it isn’t normally in the identical spot. The intro plays someplace in the first two to 5 minutes of an episode, so just skipping to a distinct timestamp won’t do the trick.

The 1st career is to extract the audio of an intro sequence, so that it can be applied for fingerprinting. Exporting the 1st 15 minutes of audio with ffmpeg very easily creates a wav file that can be trimmed down with an audio editor of alternative. That clip gets fed into the open-resource SoundFingerprinting library as a signature, then each and every online video has its audio keep track of exported and the signature gets discovered within it. SoundFingerprinting thus detects in which (down to the second) the intro exists in every single online video file.

Marking out chapter breaks applying that information is conceptually basic, but ends up staying a little bit roundabout since it appears .avi documents never have a easy way to encode chapters. Even so, .mkv information are another make any difference. To get all-around this, [jg] initial converts every single .avi to .mkv utilizing ffmpeg then splices in the chapter breaks with mkvmerge. One particular significant aspect is that the reformatting in between .avi and .mkv is accomplished devoid of completely re-encoding the online video alone, so it is a fast system. The final result is a bunch of .mkv data files with chapter breaks close to the intro, wherever it may well be!

The script is offered right here for everyone to perform with, and the undertaking web page is a great discovering reference since [jg] kindly supplies all the command-line selections employed for each and every device. Interested in applying audio fingerprinting in your individual assignments? Try to remember to also check out Olaf, the Extremely Light-weight Acoustic Fingerprinting system that can be implemented in embedded systems and web browsers.