Skip to content

Commit

Permalink
Update CompressVideoUseCaseJvmVlc to use h264/aac encoding.
Browse files Browse the repository at this point in the history
Based on command line testing of video output results.
Issue #750 (desktop video compression)
  • Loading branch information
mikedawson committed Apr 5, 2024
1 parent 584f53d commit e6913a8
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -47,9 +47,9 @@ class CompressVideoUseCaseJvmVlc(
): CompressResult? = withContext(Dispatchers.IO) {
val fromFile = DoorUri.parse(fromUri).toFile()
val destFile = if(toUri != null) {
DoorUri.parse(toUri).toFile().requireExtension("mpg")
DoorUri.parse(toUri).toFile().requireExtension("mp4")
}else {
File.createTempFile(UUID.randomUUID().toString(), ".mpg")
File.createTempFile(UUID.randomUUID().toString(), ".mp4")
}

try {
Expand All @@ -60,7 +60,7 @@ class CompressVideoUseCaseJvmVlc(
val args = listOf(
vlcPath, "-I", "dummy", "--no-repeat", "--no-loop", "-vv",
fromFile.absolutePath,
"--sout=#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:standard{access=file,mux=ps,dst=${destFile.absolutePath}}",
"--sout=#transcode{vcodec=h264,acodec=mp4a,vb=800,ab=128,deinterlace}:standard{access=file,mux=mp4,dst=${destFile.absolutePath}}",
"vlc://quit"
)
println(args.joinToString(separator = " "))
Expand Down

0 comments on commit e6913a8

Please sign in to comment.