Skip to content

Instantly share code, notes, and snippets.

View mukunm's full-sized avatar

Mukund Manikarnike mukunm

View GitHub Profile
@mukunm
mukunm / tsSegmenter.java
Created August 12, 2018 00:03
tsSegmenter Code for Blog post
double numSegmentFrames = segmentDuration * frameRate;
if(keyFrameInt > numSegmentFrames) {
System.out.println("Key frame interval too high!");
System.out.println(keyFrameInt + " > " + numSegmentFrames);
return;
}
if(numSegmentFrames % keyFrameInt == 0) {
ffmpeg -hide_banner -y -noautorotate -probesize 9.22337e+18 -analyzeduration 600000000 \
-i input.mp4 -c:v h264_videotoolbox -profile:v baseline -level 3.2 -allow_sw 0 -bf 0 -b:v 2700k -g 250 \
-filter_complex [0:0]null[VC];[VC]setpts=N/(FRAME_RATE*TB)[VIDEO] -map [VIDEO] -c:a copy -map 0:1 -sn \
-f mp4 -map_chapters -1 output.mp4