Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1024637 // ffmpeg_makeSpliceFilter_multipleInputVideos

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2152L/14K).

// ranges: ranges in seconds
sS ffmpeg_makeSpliceFilter_multipleInputVideos(LL<DoubleRange> vids) {
  new LS out;
  int i = 0;
  for iVid over vids:
    fOr (DoubleRange r : vids.get(iVid)) {
      int lbl = ++i;
      S start = ffmpeg_formatSeconds(r.start);
      S end = ffmpeg_formatSeconds(r.end);
      out.add("[" + iVid + ":v]trim=start=" + start + ":end=" + end + ",setpts=PTS-STARTPTS[v" + lbl + "]");
      out.add("[" + iVid + ":a]atrim=start=" + start + ":end=" + end + ",asetpts=PTS-STARTPTS[a" + lbl + "]");
    }

  S concat = "concat=n=" + i;
  out.add(joinMap(iota(i), j -> "[v" + j + "]") + concat + "[outv]");
  out.add(joinMap(iota(i), j -> "[a" + j + "]") + + concat + ":v=0:a=1[outa]");
  ret joinWithSemicolon(out);
}

Author comment

Began life as a copy of #1024579

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024637
Snippet name: ffmpeg_makeSpliceFilter_multipleInputVideos
Eternal ID of this version: #1024637/4
Text MD5: 81be7992a9c96b62421c93f4c05d0be4
Transpilation MD5: 3ed93cbedf5b174ddede4589db65b2c8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-21 14:06:48
Source code size: 758 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 117 / 177
Version history: 3 change(s)
Referenced in: [show references]