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

26
LINES

< > BotCompany Repo | #1006718 // Test reading .mp4 [invidual frames] from #1006716 - WORKS!

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

Uses 1860K of libraries. Click here for Pure Java version (4847L/34K/122K).

1  
!7
2  
lib 1006715 // jcodec 0.2.0
3  
lib 1006717 // jcodec 0.2.0 javase
4  
5  
import org.jcodec.common.io.*;
6  
import org.jcodec.api.awt.*;
7  
8  
p {
9  
  double startSec = 0;
10  
  File inFile = getProgramFile(#1006716, "test.mp4");
11  
  FileChannelWrapper ch = NIOUtils.readableChannel(inFile);
12  
  AWTFrameGrab8Bit grab = AWTFrameGrab8Bit.createAWTFrameGrab8Bit(ch);
13  
  try {
14  
    //grab.seek(startSec);
15  
    for (int i = 0; ; i++) {
16  
      ping();
17  
      BufferedImage img = grab.getFrame();
18  
      if (img == null) { print("Done!"); break; }
19  
      print(img.getWidth() + " * " + img.getHeight());
20  
      quickShowImage(img);
21  
      print("Frame " + (i+1));
22  
    }
23  
  } finally {
24  
    NIOUtils.closeQuietly(ch);
25  
  }
26  
}

Author comment

Began life as a copy of #1006716

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: #1006718
Snippet name: Test reading .mp4 [invidual frames] from #1006716 - WORKS!
Eternal ID of this version: #1006718/17
Text MD5: ee63b510a97f8d56622244f7f08379c7
Transpilation MD5: c35bdd3fa34bb6c9d4acf73dc0c6fbf6
Author: stefan
Category: javax video
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-03 00:00:10
Source code size: 707 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 531 / 588
Version history: 16 change(s)
Referenced in: [show references]