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

26
LINES

< > BotCompany Repo | #1006825 // Invert video (output to .mp4) [WORKS]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 1860K of libraries. Click here for Pure Java version (2439L/17K/70K).

1  
!7
2  
3  
import org.jcodec.api.awt.AWTSequenceEncoder8Bit;
4  
5  
static int framesToEncode = 100000;
6  
7  
p {
8  
  inputFilePath("Video to modify", voidfunc(final File video) {
9  
    thread {
10  
      File outFile = prepareProgramFile(addSuffix("inverted-" + video.getName(), ".mp4"));
11  
      AWTSequenceEncoder8Bit enc = AWTSequenceEncoder8Bit.create25Fps(outFile);
12  
      enc.getEncoder().setKeyInterval(25);
13  
      int n = 0;
14  
      for (BufferedImage img : framesFromVideo_reordering(video)) {
15  
        img = invertedImage(img);
16  
        enc.encodeImage(img);
17  
        
18  
        print("Frames: " + n + "/" + framesToEncode);
19  
        if (++n >= framesToEncode) break;
20  
      }
21  
22  
      enc.finish();
23  
      print("Wrote " + f2s(outFile) + " (" + n + " frames)");
24  
    }
25  
  });
26  
}

Author comment

Began life as a copy of #1006716

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006825
Snippet name: Invert video (output to .mp4) [WORKS]
Eternal ID of this version: #1006825/10
Text MD5: d1340e433c15b056996f50a433607dd7
Transpilation MD5: 3903593e00ded09ffd0f0842329c8f65
Author: stefan
Category: javax video
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-05 05:28:08
Source code size: 772 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 448 / 617
Version history: 9 change(s)
Referenced in: [show references]