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

26
LINES

< > BotCompany Repo | #1006826 // Re-encode video without changes to see how fast that is

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

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

!7

import org.jcodec.api.awt.AWTSequenceEncoder8Bit;

static int framesToEncode = 100000;

p {
  inputFilePath("Video to copy", voidfunc(final File video) {
    thread {
      File outFile = prepareProgramFile(addSuffix("reencoded-" + video.getName(), ".mp4"));
      AWTSequenceEncoder8Bit enc = AWTSequenceEncoder8Bit.create25Fps(outFile);
      enc.getEncoder().setKeyInterval(25);
      int n = 0;
      for (BufferedImage img : framesFromVideo_reordering(video)) {
        img = invertedImage(img);
        enc.encodeImage(img);
        
        print("Frames: " + n + "/" + framesToEncode);
        if (++n >= framesToEncode) break;
      }

      enc.finish();
      print("Wrote " + f2s(outFile) + " (" + n + " frames)");
    }
  });
}

Author comment

Began life as a copy of #1006825

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006826
Snippet name: Re-encode video without changes to see how fast that is
Eternal ID of this version: #1006826/1
Text MD5: b63fc915aea72ec126c386f3f76e95dd
Transpilation MD5: 122ec371b19a84b5aaaf36cedcc0b142
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:46:13
Source code size: 771 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 353 / 418
Referenced in: [show references]