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

14
LINES

< > BotCompany Repo | #1025056 // ffmpeg_makeAudioSpliceFilter

JavaX fragment (include)

1  
// ranges: ranges in seconds
2  
sS ffmpeg_makeAudioSpliceFilter(L<DoubleRange> ranges) {
3  
  new LS out;
4  
  int i = 0;
5  
  fOr (DoubleRange r : ranges) {
6  
    int lbl = ++i;
7  
    S start = ffmpeg_formatSeconds(r.start);
8  
    S end = ffmpeg_formatSeconds(r.end);
9  
    out.add("[0:a]atrim=start=" + start + ":end=" + end + ",asetpts=PTS-STARTPTS[a" + lbl + "]");
10  
  }
11  
  S concat = "concat=n=" + l(ranges);
12  
  out.add(joinMap(iota(i), j -> "[a" + j + "]") + concat + ":v=0:a=1[outa]");
13  
  ret joinWithSemicolon(out);
14  
}

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: #1025056
Snippet name: ffmpeg_makeAudioSpliceFilter
Eternal ID of this version: #1025056/1
Text MD5: 83c15761f4ccf089ac1f0618654a2dfe
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-03 20:12:52
Source code size: 513 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 225 / 264
Referenced in: [show references]