com.github.mmauro94.mkvtoolnix_wrapper.examples.Identify_Example.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mkvtoolnix-wrapper Show documentation
Show all versions of mkvtoolnix-wrapper Show documentation
An easy to use light kotlin-jvm wrapper for most common mkvmerge and mkvpropedit CLI commands
The newest version!
package com.github.mmauro94.mkvtoolnix_wrapper.examples
import com.github.mmauro94.mkvtoolnix_wrapper.MkvToolnix
import java.io.File
fun main() {
val file = File("myfile.mkv")
MkvToolnix.identify(file).apply {
println(file.absolutePath)
container.properties?.title?.let {
println("Title: $it")
}
container.properties?.duration?.let {
println("Duration: $it")
}
println()
tracks.forEach { t ->
//Print track information
print("Track id ${t.id}: ${t.type.name}")
t.properties?.language?.let { println(", $it") }
t.properties?.codecId?.let { print(", $it") }
t.properties?.trackName?.let { println(", $it") }
}
}
}