sarxos / webcam-capture

The goal of this project is to allow integrated or USB-connected webcams to be accessed directly from Java. Using provided libraries users are able to read camera images and detect motion. Main project consist of several sub projects - the root one, which contains required classes, build-in webcam driver compatible with Windows, Linux and Mac OS, which can stream images as fast as your camera can serve them (up to 50 FPS). Main project can be used standalone, but user is able to replace build-in driver with different one - such as OpenIMAJ, GStreamer, V4L4j, JMF, LTI-CIVIL, FMJ, etc.
http://webcam-capture.sarxos.pl
MIT License
2.27k stars 1.11k forks source link

EXCEPTION_ACCESS_VIOLATION (0xc0000005) Problematic frame: C [ntdll.dll+0x50901] #537

Open pavlovaleksei opened 7 years ago

pavlovaleksei commented 7 years ago

Hello! I have a problem with cyclic video recording. The code is taken from the example: Encoder. An error occurs when the loop passes more than 70 iterations. Start-up example:

package Recorder;

public class Start {
    public static void main(String[] args) {
        while(true) {
            try {
                Rec2 r = new Rec2();
                r.m();
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
package Recorder;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamResolution;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.xuggler.ICodec;
import com.xuggle.xuggler.IPixelFormat;
import com.xuggle.xuggler.IVideoPicture;
import com.xuggle.xuggler.video.ConverterFactory;
import com.xuggle.xuggler.video.IConverter;

import java.util.Calendar;

public class Rec2 {

    public void m() {
        String filePath = new File("").getAbsolutePath() + "\\video\\";
        File file = new File(filePath + fileRenamed() + "mp4");

        IMediaWriter writer = ToolFactory.makeWriter(file.getName());
        Dimension size = WebcamResolution.QVGA.getSize();
        writer.addVideoStream(0, 0, ICodec.ID.CODEC_ID_H264, size.width, size.height);

        Webcam webcam = Webcam.getDefault();
        webcam.setViewSize(size);
        webcam.open(true);

        long start = System.currentTimeMillis();

        for (int i = 0; i < 50; i++) {

            System.out.println("Capture frame " + i);

            BufferedImage image = ConverterFactory.convertToType(webcam.getImage(), BufferedImage.TYPE_3BYTE_BGR);
            IConverter converter = ConverterFactory.createConverter(image, IPixelFormat.Type.YUV420P);

            IVideoPicture frame = converter.toPicture(image, (System.currentTimeMillis() - start) * 1000);
            frame.setKeyFrame(i == 0);
            frame.setQuality(0);

            writer.encodeVideo(0, frame);

            // 10 FPS
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        writer.close();
        webcam.close();

        System.out.println("Video recorded in file: " + file.getAbsolutePath());
    }

    private String fileRenamed() {
        Calendar calendar = Calendar.getInstance();
        String fileName = String.valueOf(calendar.getTimeInMillis() + ".");
        return fileName;
    }
}
pavlovaleksei commented 7 years ago

Win 7 x64, Core i3-3210

sarxos commented 7 years ago

Can you provide whole crash log?

pavlovaleksei commented 7 years ago
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077580901, pid=7720, tid=0x0000000000000bf0
#
# JRE version: Java(TM) SE Runtime Environment (8.0_112-b15) (build 1.8.0_112-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b15 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [ntdll.dll+0x50901]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x000000005500b000):  JavaThread "Finalizer" daemon [_thread_in_native, id=3056, stack(0x0000000056390000,0x0000000056490000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000001d55734c8

Registers:
RAX=0x0000009d00001388, RBX=0x00000001d55734c0, RCX=0x000000ffffffffff, RDX=0x0000000000000000
RSP=0x000000005648f190, RBP=0x00000000586296e0, RSI=0x0000000000000000, RDI=0x0000000000000000
R8 =0x00000000586296d0, R9 =0x00000000c4e21668, R10=0x0000000002987f28, R11=0x000000005f9eb530
R12=0x0000000058620000, R13=0x0000000054daae58, R14=0x000000005648f350, R15=0x000000005500b000
RIP=0x0000000077580901, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000005648f190)
0x000000005648f190:   000000005648f1a8 000000005648f1f8
0x000000005648f1a0:   0000000002977d80 00000000586296e0
0x000000005648f1b0:   0000000058628630 000000005648f1b8
0x000000005648f1c0:   00000000546d8814 000000005648f208
0x000000005648f1d0:   000000005500b000 000000005648f350
0x000000005648f1e0:   0000000000000000 0000000000000000
0x000000005648f1f0:   000000005d51aa31 000000005648f328
0x000000005648f200:   0000000054daae58 0000000076f51a7a
0x000000005648f210:   0000000054e2ee28 0000000054daae58
0x000000005648f220:   000000005648f2a0 0000000002978331
0x000000005648f230:   000000005648f2b0 000007fef2c1a750
0x000000005648f240:   00000000586296e0 000000005648f340
0x000000005648f250:   00000000ec450b20 00000000c4e23b60
0x000000005648f260:   0000000054daae58 000007fef2c17288
0x000000005648f270:   000000005648f2c0 00000000547ed7c0
0x000000005648f280:   0000000000000000 00000000546d8060 

Instructions: (pc=0x0000000077580901)
0x00000000775808e1:   ff ff 00 00 00 49 33 dc 48 23 c1 48 c1 eb 04 48
0x00000000775808f1:   33 d8 48 33 1d ce ea 0d 00 48 c1 e3 04 0f 0d 0b
0x0000000077580901:   48 8b 7b 08 49 bd 01 00 00 00 01 00 00 00 49 be
0x0000000077580911:   ff 7f 00 00 ff ff ff ff 41 c6 40 0f 80 41 88 70 

Register to memory mapping:

RAX=0x0000009d00001388 is an unknown value
RBX=0x00000001d55734c0 is an unknown value
RCX=0x000000ffffffffff is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000005648f190 is pointing into the stack for thread: 0x000000005500b000
RBP=0x00000000586296e0 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x00000000586296d0 is an unknown value
R9 =0x00000000c4e21668 is an oop
java.lang.Class 
 - klass: 'java/lang/Class'
R10=0x0000000002987f28 is at code_begin+840 in an Interpreter codelet
method entry point (kind = native)  [0x0000000002987be0, 0x0000000002988540]  2400 bytes
R11=0x000000005f9eb530 is an unknown value
R12=0x0000000058620000 is an unknown value
R13={method} {0x0000000054daae60} 'free' '(J)V' in 'org/bridj/JNI'
R14=0x000000005648f350 is pointing into the stack for thread: 0x000000005500b000
R15=0x000000005500b000 is a thread

Stack: [0x0000000056390000,0x0000000056490000],  sp=0x000000005648f190,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x50901]
C  [kernel32.dll+0x21a7a]
C  [bridj.dll+0xa750]
C  [bridj.dll+0x7288]
C  0x0000000002987f54

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.bridj.JNI.free(J)V+0
j  org.bridj.Pointer$FreeReleaser.release(Lorg/bridj/Pointer;)V+192
j  org.bridj.Pointer$5.release(Lorg/bridj/Pointer;)V+14
j  org.bridj.Pointer$3.release()V+19
j  org.bridj.Pointer$3.finalize()V+1
J 1428 C2 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x0000000002b8f60c [0x0000000002b8f440+0x1cc]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000005752b800 JavaThread "webcam-updater-thread-96" daemon [_thread_blocked, id=6164, stack(0x0000000069580000,0x0000000069680000)]
  0x00000000575f5800 JavaThread "frames-refresher-[0]" daemon [_thread_blocked, id=7452, stack(0x00000000692e0000,0x00000000693e0000)]
  0x000000005687c800 JavaThread "webcam-lock-[Webcam C110 0]" daemon [_thread_blocked, id=3384, stack(0x0000000068d10000,0x0000000068e10000)]
  0x0000000057937800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3392, stack(0x000000005ad80000,0x000000005ae80000)]
  0x000000005766e000 JavaThread "webcam-discovery-service" daemon [_thread_blocked, id=6860, stack(0x0000000058450000,0x0000000058550000)]
  0x0000000057669000 JavaThread "atomic-processor-1" daemon [_thread_in_native, id=7596, stack(0x0000000058330000,0x0000000058430000)]
  0x0000000056820000 JavaThread "Service Thread" daemon [_thread_blocked, id=7484, stack(0x0000000057070000,0x0000000057170000)]
  0x000000005677f000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=5920, stack(0x0000000056d50000,0x0000000056e50000)]
  0x000000005677d000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=5692, stack(0x0000000056e50000,0x0000000056f50000)]
  0x000000005677c000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6540, stack(0x0000000056a20000,0x0000000056b20000)]
  0x000000005675b000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=2804, stack(0x0000000056b70000,0x0000000056c70000)]
  0x0000000055021000 JavaThread "Attach Listener" daemon [_thread_blocked, id=2876, stack(0x0000000056520000,0x0000000056620000)]
  0x000000005502f000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1520, stack(0x0000000055ff0000,0x00000000560f0000)]
=>0x000000005500b000 JavaThread "Finalizer" daemon [_thread_in_native, id=3056, stack(0x0000000056390000,0x0000000056490000)]
  0x0000000054fc4000 JavaThread "Reference Handler" daemon [_thread_blocked, id=7700, stack(0x0000000056280000,0x0000000056380000)]
  0x000000000025f000 JavaThread "main" [_thread_blocked, id=1132, stack(0x00000000025a0000,0x00000000026a0000)]

Other Threads:
  0x0000000054fbc800 VMThread [stack: 0x00000000560f0000,0x00000000561f0000] [id=4164]
  0x0000000056892800 WatcherThread [stack: 0x00000000571d0000,0x00000000572d0000] [id=3856]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 14336K, used 1316K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 9% used [0x00000000ec400000,0x00000000ec549210,0x00000000ed100000)
  from space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 20480K, used 4770K [0x00000000c4c00000, 0x00000000c6000000, 0x00000000ec400000)
  object space 20480K, 23% used [0x00000000c4c00000,0x00000000c50a8a38,0x00000000c6000000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K

Card table byte_map: [0x0000000011d30000,0x0000000011f10000] byte_map_base: 0x000000001170a000

Marking Bits: (ParMarkBitMap*) 0x000000005ffda6d0
 Begin Bits: [0x00000000126b0000, 0x0000000013580000)
 End Bits:   [0x0000000013580000, 0x0000000014450000)

Polling page: 0x0000000000230000

CodeCache: size=245760Kb used=6009Kb max_used=6078Kb free=239750Kb
 bounds [0x0000000002970000, 0x0000000002f80000, 0x0000000011970000]
 total_blobs=2283 nmethods=1787 adapters=409
 compilation: enabled

Compilation events (10 events):
Event: 364.195 Thread 0x000000005677f000 2009       3       org.bridj.AbstractIntegral::safeIntCast (71 bytes)
Event: 364.196 Thread 0x000000005677f000 nmethod 2009 0x0000000002d4bb90 code [0x0000000002d4bdc0, 0x0000000002d4c9f8]
Event: 364.196 Thread 0x000000005677f000 2010       3       org.bridj.Pointer::getBytesAtOffset (61 bytes)
Event: 364.196 Thread 0x000000005677f000 nmethod 2010 0x0000000002d233d0 code [0x0000000002d23560, 0x0000000002d23948]
Event: 373.832 Thread 0x000000005677d000 2011       4       java.lang.AbstractStringBuilder::append (144 bytes)
Event: 373.839 Thread 0x000000005677d000 nmethod 2011 0x0000000002d8cd90 code [0x0000000002d8cf00, 0x0000000002d8d598]
Event: 373.883 Thread 0x000000005677f000 2012       3       java.util.AbstractList::listIterator (6 bytes)
Event: 373.883 Thread 0x000000005677f000 nmethod 2012 0x0000000002dd7490 code [0x0000000002dd7600, 0x0000000002dd7808]
Event: 384.268 Thread 0x000000005677f000 2013 % !   3       java.lang.ref.Finalizer$FinalizerThread::run @ 33 (55 bytes)
Event: 384.269 Thread 0x000000005677f000 nmethod 2013% 0x0000000002d39650 code [0x0000000002d39880, 0x0000000002d3a548]

GC Heap History (10 events):
Event: 379.655 GC heap before
{Heap before GC invocations=222 (full 0):
 PSYoungGen      total 14336K, used 13627K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f6b58,0x00000000ed100000)
  from space 1024K, 34% used [0x00000000ed100000,0x00000000ed158410,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47831K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ab5d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 379.657 GC heap after
Heap after GC invocations=222 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47871K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7abfd40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 381.843 GC heap before
{Heap before GC invocations=223 (full 0):
 PSYoungGen      total 14336K, used 13831K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f9658,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47871K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7abfd40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 381.845 GC heap after
Heap after GC invocations=223 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47911K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ac9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 383.042 GC heap before
{Heap before GC invocations=224 (full 0):
 PSYoungGen      total 14336K, used 13818K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f6370,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47911K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ac9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 383.042 GC heap after
Heap after GC invocations=224 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47951K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad3d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 384.241 GC heap before
{Heap before GC invocations=225 (full 0):
 PSYoungGen      total 14336K, used 13766K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0e9178,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47951K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad3d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 384.244 GC heap after
Heap after GC invocations=225 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47975K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 384.244 GC heap before
{Heap before GC invocations=226 (full 1):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47975K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 384.265 GC heap after
Heap after GC invocations=226 (full 1):
 PSYoungGen      total 14336K, used 0K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 20480K, used 4770K [0x00000000c4c00000, 0x00000000c6000000, 0x00000000ec400000)
  object space 20480K, 23% used [0x00000000c4c00000,0x00000000c50a8a38,0x00000000c6000000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}

Deoptimization events (9 events):
Event: 0.744 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b1677c method=java.lang.String.indexOf([CII[CIII)I @ 3
Event: 1.176 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b0c9f0 method=sun.misc.MetaIndex.mayContain(Ljava/lang/String;)Z @ 38
Event: 1.176 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b959c4 method=sun.misc.MetaIndex.mayContain(Ljava/lang/String;)Z @ 38
Event: 1.355 Thread 0x0000000057669000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b1ba7c method=sun.misc.URLClassPath.getLoader(I)Lsun/misc/URLClassPath$Loader; @ 36
Event: 1.655 Thread 0x0000000057669000 Uncommon trap: reason=range_check action=make_not_entrant pc=0x0000000002c75f10 method=sun.reflect.generics.parser.SignatureParser.current()C @ 34
Event: 2.673 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002ccbcb4 method=java.awt.image.ComponentSampleModel.getDataElements(IILjava/lang/Object;Ljava/awt/image/DataBuffer;)Ljava/lang/Object; @ 101
Event: 6.594 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002cd68e4 method=java.awt.image.ComponentColorModel.getRGB(Ljava/lang/Object;)I @ 4
Event: 38.845 Thread 0x0000000057a64000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002d00f5c method=java.util.concurrent.SynchronousQueue$TransferQueue$QNode.casItem(Ljava/lang/Object;Ljava/lang/Object;)Z @ 20
Event: 248.884 Thread 0x0000000057669000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002e6ec70 method=java.util.concurrent.SynchronousQueue$TransferQueue.transfer(Ljava/lang/Object;ZJ)Ljava/lang/Object; @ 229

Internal exceptions (10 events):
Event: 345.623 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec91beb0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 349.502 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eceb6a10) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 353.439 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec8032b8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 357.377 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ece0ce08) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 361.334 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec75b828) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 365.277 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eccf3fd8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 369.218 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec608720) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 373.072 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ed020770) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 376.983 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec920ea8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 380.859 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eceb9dd8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]

Events (10 events):
Event: 380.859 Thread 0x000000005687c800 Thread exited: 0x000000005687c800
Event: 380.964 Thread 0x000000005687c800 Thread added: 0x000000005687c800
Event: 381.617 Thread 0x00000000575f5800 Thread added: 0x00000000575f5800
Event: 381.653 Thread 0x000000005752b800 Thread added: 0x000000005752b800
Event: 381.843 Executing VM operation: ParallelGCFailedAllocation
Event: 381.845 Executing VM operation: ParallelGCFailedAllocation done
Event: 383.042 Executing VM operation: ParallelGCFailedAllocation
Event: 383.042 Executing VM operation: ParallelGCFailedAllocation done
Event: 384.241 Executing VM operation: ParallelGCFailedAllocation
Event: 384.265 Executing VM operation: ParallelGCFailedAllocation done

Dynamic libraries:
0x000000013fc80000 - 0x000000013fcb7000     c:\Program Files\Java\jdk1.8.0_112\bin\java.exe
0x0000000077530000 - 0x00000000776da000     C:\Windows\SYSTEM32\ntdll.dll
0x0000000076f30000 - 0x000000007704f000     C:\Windows\system32\kernel32.dll
0x000007fefdbf0000 - 0x000007fefdc5b000     C:\Windows\system32\KERNELBASE.dll
0x000007fefdd60000 - 0x000007fefde3b000     C:\Windows\system32\ADVAPI32.dll
0x000007feff700000 - 0x000007feff79f000     C:\Windows\system32\msvcrt.dll
0x000007fefded0000 - 0x000007fefdeef000     C:\Windows\SYSTEM32\sechost.dll
0x000007feff5d0000 - 0x000007feff6fd000     C:\Windows\system32\RPCRT4.dll
0x0000000076e30000 - 0x0000000076f2a000     C:\Windows\system32\USER32.dll
0x000007feff320000 - 0x000007feff387000     C:\Windows\system32\GDI32.dll
0x000007fefde40000 - 0x000007fefde4e000     C:\Windows\system32\LPK.dll
0x000007fefe120000 - 0x000007fefe1ea000     C:\Windows\system32\USP10.dll
0x000007fefbff0000 - 0x000007fefc1e4000     C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\COMCTL32.dll
0x000007fefe0a0000 - 0x000007fefe111000     C:\Windows\system32\SHLWAPI.dll
0x000007fefdea0000 - 0x000007fefdece000     C:\Windows\system32\IMM32.DLL
0x000007fefdf90000 - 0x000007fefe099000     C:\Windows\system32\MSCTF.dll
0x0000000060820000 - 0x00000000608f2000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\msvcr100.dll
0x000000005f7c0000 - 0x000000006005a000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\server\jvm.dll
0x000007fef23b0000 - 0x000007fef23b9000     C:\Windows\system32\WSOCK32.dll
0x000007fefde50000 - 0x000007fefde9d000     C:\Windows\system32\WS2_32.dll
0x000007fefe350000 - 0x000007fefe358000     C:\Windows\system32\NSI.dll
0x000007fefb2e0000 - 0x000007fefb31b000     C:\Windows\system32\WINMM.dll
0x000007fefca90000 - 0x000007fefca9c000     C:\Windows\system32\VERSION.dll
0x00000000776f0000 - 0x00000000776f7000     C:\Windows\system32\PSAPI.DLL
0x0000000061230000 - 0x000000006123f000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\verify.dll
0x00000000607f0000 - 0x0000000060819000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\java.dll
0x0000000072000000 - 0x0000000072023000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\instrument.dll
0x00000000607d0000 - 0x00000000607e6000     c:\Program Files\Java\jdk1.8.0_112\jre\bin\zip.dll
0x000007fefe590000 - 0x000007feff319000     C:\Windows\system32\SHELL32.dll
0x000007fefe380000 - 0x000007fefe583000     C:\Windows\system32\ole32.dll
0x000007fefd990000 - 0x000007fefd99f000     C:\Windows\system32\profapi.dll
0x000007fef72f0000 - 0x000007fef730a000     C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\bin\breakgen64.dll
0x00000000607b0000 - 0x00000000607ca000     C:\Program Files\Java\jdk1.8.0_112\jre\bin\net.dll
0x000007fefd280000 - 0x000007fefd2d5000     C:\Windows\system32\mswsock.dll
0x000007fefd270000 - 0x000007fefd277000     C:\Windows\System32\wship6.dll
0x000007fefd410000 - 0x000007fefd428000     C:\Windows\system32\CRYPTSP.dll
0x000007fefcf00000 - 0x000007fefcf47000     C:\Windows\system32\rsaenh.dll
0x000007fefcce0000 - 0x000007fefccfe000     C:\Windows\system32\USERENV.dll
0x000007fefd8c0000 - 0x000007fefd8cf000     C:\Windows\system32\CRYPTBASE.dll
0x000007fefbf00000 - 0x000007fefbf27000     C:\Windows\system32\IPHLPAPI.DLL
0x000007fefbef0000 - 0x000007fefbefb000     C:\Windows\system32\WINNSI.DLL
0x000007fefbd20000 - 0x000007fefbd31000     C:\Windows\system32\dhcpcsvc6.DLL
0x000007fefbd00000 - 0x000007fefbd18000     C:\Windows\system32\dhcpcsvc.DLL
0x0000000060790000 - 0x00000000607a1000     C:\Program Files\Java\jdk1.8.0_112\jre\bin\nio.dll
0x000000006e740000 - 0x000000006fda5000     C:\Users\a.pavlov\AppData\Local\Temp\xuggle\xuggle5492488285270740980.dll
0x000007fef7310000 - 0x000007fef7327000     C:\Windows\system32\AVICAP32.dll
0x000007fef2c40000 - 0x000007fef2c69000     C:\Windows\system32\MSVFW32.dll
0x00000000605f0000 - 0x0000000060788000     C:\Program Files\Java\jdk1.8.0_112\jre\bin\awt.dll
0x000007fefe270000 - 0x000007fefe348000     C:\Windows\system32\OLEAUT32.dll
0x000007fef2c10000 - 0x000007fef2c39000     C:\Users\a.pavlov\AppData\Local\Temp\BridJExtractedLibraries1250518414653852903\bridj.dll
0x000007fef2b00000 - 0x000007fef2b36000     C:\Users\A5A4F~1.PAV\AppData\Local\Temp\BridJExtractedLibraries1250518414653852903\OpenIMAJGrabber.dll
0x000007fefb6f0000 - 0x000007fefb746000     C:\Windows\system32\uxtheme.dll
0x000007fefdef0000 - 0x000007fefdf89000     C:\Windows\system32\CLBCatQ.DLL
0x000007fee07a0000 - 0x000007fee07b6000     C:\Windows\system32\devenum.dll
0x000007feff3f0000 - 0x000007feff5c7000     C:\Windows\system32\setupapi.dll
0x000007fefda40000 - 0x000007fefda76000     C:\Windows\system32\CFGMGR32.dll
0x000007fefdca0000 - 0x000007fefdcba000     C:\Windows\system32\DEVOBJ.dll
0x000007fefca60000 - 0x000007fefca8d000     C:\Windows\system32\ntmarta.dll
0x000007feff390000 - 0x000007feff3e2000     C:\Windows\system32\WLDAP32.dll
0x000007fefdc60000 - 0x000007fefdc9b000     C:\Windows\system32\WINTRUST.dll
0x000007fefda80000 - 0x000007fefdbed000     C:\Windows\system32\CRYPT32.dll
0x000007fefda30000 - 0x000007fefda3f000     C:\Windows\system32\MSASN1.dll
0x000007fee2e70000 - 0x000007fee2e7d000     C:\Windows\system32\msdmo.dll
0x000007fef2ad0000 - 0x000007fef2aff000     C:\Windows\system32\qcap.dll
0x000007fede380000 - 0x000007fede533000     C:\Windows\system32\quartz.dll
0x000007fefb0c0000 - 0x000007fefb0d8000     C:\Windows\system32\dwmapi.dll
0x000007fee0750000 - 0x000007fee0791000     C:\Windows\system32\ksproxy.ax
0x0000000074d80000 - 0x0000000074d86000     C:\Windows\system32\ksuser.dll
0x000007fef8700000 - 0x000007fef88ff000     C:\Windows\system32\d3d9.dll
0x000007fef86f0000 - 0x000007fef86f7000     C:\Windows\system32\d3d8thk.dll
0x000007fee0740000 - 0x000007fee074b000     C:\Windows\system32\vidcap.ax
0x000007fee0710000 - 0x000007fee0734000     C:\Windows\system32\kswdmcap.ax
0x000007fee05b0000 - 0x000007fee070c000     C:\Windows\system32\MFC42.dll
0x000007fee04f0000 - 0x000007fee05a1000     C:\Windows\system32\ODBC32.dll
0x00000000604c0000 - 0x00000000604f8000     C:\Windows\system32\odbcint.dll
0x000007fedfa70000 - 0x000007fedfb0b000     C:\Windows\System32\qedit.dll
0x000007feff7a0000 - 0x000007feff837000     C:\Windows\system32\COMDLG32.dll
0x000007fefb4d0000 - 0x000007fefb6e6000     C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.19061_none_2b299db671e86e03\gdiplus.dll
0x000007fee2820000 - 0x000007fee2911000     C:\Windows\system32\DDRAW.dll
0x000007fee2810000 - 0x000007fee2818000     C:\Windows\system32\DCIMAN32.dll
0x000007fede6f0000 - 0x000007fede908000     C:\Program Files (x86)\K-Lite Codec Pack\Filters\DirectVobSub64\vsfilter.dll
0x000007fef85c0000 - 0x000007fef8631000     C:\Windows\system32\WINSPOOL.DRV
0x000007fef43b0000 - 0x000007fef4404000     C:\Windows\system32\OLEACC.dll
0x0000000077050000 - 0x00000000771ab000     C:\Windows\system32\WININET.dll
0x0000000077700000 - 0x0000000077703000     C:\Windows\system32\Normaliz.dll
0x00000000771b0000 - 0x00000000773c2000     C:\Windows\system32\iertutil.dll
0x00000000773d0000 - 0x0000000077527000     C:\Windows\system32\urlmon.dll
0x000007fef6ed0000 - 0x000007fef6ed3000     C:\Windows\system32\api-ms-win-core-synch-l1-2-0.DLL
0x000007fef9610000 - 0x000007fef961b000     C:\Windows\system32\msyuv.dll
0x000007fef23c0000 - 0x000007fef24e5000     C:\Windows\system32\dbghelp.dll

VM Arguments:
jvm_args: -javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\lib\coverage-agent.jar=C:\Users\a.pavlov\AppData\Local\Temp\coverageargs -javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\lib\idea_rt.jar=19270:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\bin -Dfile.encoding=UTF-8 
java_command: Recorder.Start
java_class_path (initial): C:\Program Files\Java\jdk1.8.0_112\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\rt.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\out\production\OnlyRecorder;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\logback-classic-1.2.1.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\bridj-0.7-20140918.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\webcam-capture-0.3.12-20161206.184756-3.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\commons-lang3-3.5.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\slf4j-api-1.7.24.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\commons-cli-1.3.1.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\xuggle-xuggler-5.4.jar;C:\Pavlov\Clo
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=c:\Program Files\Java\jdk1.8.0_112\
CLASSPATH=.;.;c:\pavlov\java\JAVA_L~1\lib\sound.jar;c:\pavlov\java\JAVA_L~1\lib\jmf.jar;c:\pavlov\java\JAVA_L~1\lib;
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Git\cmd
USERNAME=a.pavlov
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

---------------  S Y S T E M  ---------------

OS: Windows 7 , 64 bit Build 7601 (6.1.7601.19160)

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, clmul, erms, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 3881288k(303584k free), swap 8252260k(1420236k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.112-b15) for windows-amd64 JRE (1.8.0_112-b15), built on Sep 22 2016 21:31:56 by "java_re" with MS VC++ 10.0 (VS2010)

time: Fri Apr 28 14:36:04 2017
elapsed time: 384 seconds (0d 0h 6m 24s)
pavlovaleksei commented 7 years ago

addition: With recursive invocation (without a cycle while), the result is the same

sarxos commented 7 years ago

Does the same happen when you get rid of Xuggler code and simply take pictures from camera in loop?

    public void m() {
        Dimension size = WebcamResolution.QVGA.getSize();

        Webcam webcam = Webcam.getDefault();
        webcam.setViewSize(size);
        webcam.open(true);

        for (int i = 0; i < 50; i++) {

            webcam.getImage();

            // 10 FPS
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        webcam.close();
    }
pavlovaleksei commented 7 years ago

Response. In this form code is working correctly. In a while loop passed 1000 iterations without crashing.

pavlovaleksei commented 7 years ago

I think that the problem is in Bridj.jar

sarxos commented 7 years ago

I actually think that Xuggler and BridJ natives interacts somehow and cause this crash to happen. If you are unable to work this out I suggest to move from Xuggler to GStreamer Java bindings, but I have no examples on how to use it, however I'm certain it is possible to record video with gstreamer-java.

pavlovaleksei commented 7 years ago

I'm still trying to figure this out. There is a regularity when writing short (up to 5 seconds) files, the error flies to the 14th file, and when more long ones are written (about a minute), then about 340 files are recorded.

In addition, I found a way out by calling recursion and calling the garbage collector. In this form, the code works almost constantly. Below I give you an example of a code in which errors are almost not encountered. Maybe my ideas will help you to improve the library. Thank you!

pavlovaleksei commented 7 years ago
public class Start {
    public static void main(String[] args) {
        rec r = new rec();
        r.m();
    }
}

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamResolution;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.xuggler.ICodec;
import com.xuggle.xuggler.IPixelFormat;
import com.xuggle.xuggler.IVideoPicture;
import com.xuggle.xuggler.video.ConverterFactory;
import com.xuggle.xuggler.video.IConverter;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Calendar;

public class rec {

    BufferedImage image;
    IConverter converter;
    IVideoPicture frame;
    IMediaWriter writer;
    File file;
    String filePath;
    Webcam webcam;
    long start;
    Dimension size;

    public void m() {
        filePath = new File("").getAbsolutePath() + "\\video\\";
        file = new File(filePath + fileRenamed() + "mp4");

        writer = ToolFactory.makeWriter(file.getName());
        size = WebcamResolution.QVGA.getSize();
        writer.addVideoStream(0, 0, ICodec.ID.CODEC_ID_H264, size.width, size.height);

        webcam = Webcam.getDefault();
        webcam.setViewSize(size);
        webcam.open(true);

        start = System.currentTimeMillis();

        for (int i = 0; i < 50; i++) {

            System.out.println("Capture frame " + i);

            image = ConverterFactory.convertToType(webcam.getImage(), BufferedImage.TYPE_3BYTE_BGR);
            converter = ConverterFactory.createConverter(image, IPixelFormat.Type.YUV420P);

            frame = converter.toPicture(image, (System.currentTimeMillis() - start) * 1000);
            frame.setKeyFrame(i == 0);
            frame.setQuality(0);

            writer.encodeVideo(0, frame);

            // 10 FPS
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        writer.close();
        webcam.close();

        filePath = null;
        file = null;
        writer = null;
        size = null;
        webcam = null;
        image = null;
        converter = null;
        frame = null;

        System.gc();

        System.out.println("Video recorded in file: " + file.getAbsolutePath());

        m();
    }

    private String fileRenamed() {
        Calendar calendar = Calendar.getInstance();
        String fileName = String.valueOf(calendar.getTimeInMillis() + ".");
        return fileName;
    }
}
sarxos commented 7 years ago

Hi, if GC is required maybe you should try to give more memory to your process? This can be done by specifying -Xmx flag in java command.

sarxos commented 7 years ago

The default value of -Xmx is 64M which may be too low for video recording.

pavlovaleksei commented 7 years ago

I pointed out and memory jvm settings, and settings for the stack, the situation has not changed radically, works more or less correctly only in this form

pavlovaleksei commented 7 years ago

When installing in 512 MB and without calling the garbage collector, the process drops by OutOfMemory

sarxos commented 7 years ago

Ok, thank you for the info.

pavlovaleksei commented 7 years ago

This problem has been preserved for windows 10. Can you tell me, is it possible to record many short video files (5 - 10 seconds) so that during the recording we connected to the camera 1 time, and while the camera was on, we wrote constantly short files?

kalilmvp commented 5 years ago

Hello, i´ve beem having some issues also regarding the integration of my app and the webcam using this lib. I´m not sure if it´s the memory usage or some corrupt dll, but it´s also one time or another. I wanna get the crash log, but i haven´t seen this info anywhere, where can i find it ?

Thanks!

kalilmvp commented 5 years ago

This problem has been preserved for windows 10. Can you tell me, is it possible to record many short video files (5 - 10 seconds) so that during the recording we connected to the camera 1 time, and while the camera was on, we wrote constantly short files?

Hi

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077580901, pid=7720, tid=0x0000000000000bf0
#
# JRE version: Java(TM) SE Runtime Environment (8.0_112-b15) (build 1.8.0_112-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b15 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [ntdll.dll+0x50901]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x000000005500b000):  JavaThread "Finalizer" daemon [_thread_in_native, id=3056, stack(0x0000000056390000,0x0000000056490000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000001d55734c8

Registers:
RAX=0x0000009d00001388, RBX=0x00000001d55734c0, RCX=0x000000ffffffffff, RDX=0x0000000000000000
RSP=0x000000005648f190, RBP=0x00000000586296e0, RSI=0x0000000000000000, RDI=0x0000000000000000
R8 =0x00000000586296d0, R9 =0x00000000c4e21668, R10=0x0000000002987f28, R11=0x000000005f9eb530
R12=0x0000000058620000, R13=0x0000000054daae58, R14=0x000000005648f350, R15=0x000000005500b000
RIP=0x0000000077580901, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000005648f190)
0x000000005648f190:   000000005648f1a8 000000005648f1f8
0x000000005648f1a0:   0000000002977d80 00000000586296e0
0x000000005648f1b0:   0000000058628630 000000005648f1b8
0x000000005648f1c0:   00000000546d8814 000000005648f208
0x000000005648f1d0:   000000005500b000 000000005648f350
0x000000005648f1e0:   0000000000000000 0000000000000000
0x000000005648f1f0:   000000005d51aa31 000000005648f328
0x000000005648f200:   0000000054daae58 0000000076f51a7a
0x000000005648f210:   0000000054e2ee28 0000000054daae58
0x000000005648f220:   000000005648f2a0 0000000002978331
0x000000005648f230:   000000005648f2b0 000007fef2c1a750
0x000000005648f240:   00000000586296e0 000000005648f340
0x000000005648f250:   00000000ec450b20 00000000c4e23b60
0x000000005648f260:   0000000054daae58 000007fef2c17288
0x000000005648f270:   000000005648f2c0 00000000547ed7c0
0x000000005648f280:   0000000000000000 00000000546d8060 

Instructions: (pc=0x0000000077580901)
0x00000000775808e1:   ff ff 00 00 00 49 33 dc 48 23 c1 48 c1 eb 04 48
0x00000000775808f1:   33 d8 48 33 1d ce ea 0d 00 48 c1 e3 04 0f 0d 0b
0x0000000077580901:   48 8b 7b 08 49 bd 01 00 00 00 01 00 00 00 49 be
0x0000000077580911:   ff 7f 00 00 ff ff ff ff 41 c6 40 0f 80 41 88 70 

Register to memory mapping:

RAX=0x0000009d00001388 is an unknown value
RBX=0x00000001d55734c0 is an unknown value
RCX=0x000000ffffffffff is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000005648f190 is pointing into the stack for thread: 0x000000005500b000
RBP=0x00000000586296e0 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x00000000586296d0 is an unknown value
R9 =0x00000000c4e21668 is an oop
java.lang.Class 
 - klass: 'java/lang/Class'
R10=0x0000000002987f28 is at code_begin+840 in an Interpreter codelet
method entry point (kind = native)  [0x0000000002987be0, 0x0000000002988540]  2400 bytes
R11=0x000000005f9eb530 is an unknown value
R12=0x0000000058620000 is an unknown value
R13={method} {0x0000000054daae60} 'free' '(J)V' in 'org/bridj/JNI'
R14=0x000000005648f350 is pointing into the stack for thread: 0x000000005500b000
R15=0x000000005500b000 is a thread

Stack: [0x0000000056390000,0x0000000056490000],  sp=0x000000005648f190,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x50901]
C  [kernel32.dll+0x21a7a]
C  [bridj.dll+0xa750]
C  [bridj.dll+0x7288]
C  0x0000000002987f54

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.bridj.JNI.free(J)V+0
j  org.bridj.Pointer$FreeReleaser.release(Lorg/bridj/Pointer;)V+192
j  org.bridj.Pointer$5.release(Lorg/bridj/Pointer;)V+14
j  org.bridj.Pointer$3.release()V+19
j  org.bridj.Pointer$3.finalize()V+1
J 1428 C2 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x0000000002b8f60c [0x0000000002b8f440+0x1cc]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000005752b800 JavaThread "webcam-updater-thread-96" daemon [_thread_blocked, id=6164, stack(0x0000000069580000,0x0000000069680000)]
  0x00000000575f5800 JavaThread "frames-refresher-[0]" daemon [_thread_blocked, id=7452, stack(0x00000000692e0000,0x00000000693e0000)]
  0x000000005687c800 JavaThread "webcam-lock-[Webcam C110 0]" daemon [_thread_blocked, id=3384, stack(0x0000000068d10000,0x0000000068e10000)]
  0x0000000057937800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3392, stack(0x000000005ad80000,0x000000005ae80000)]
  0x000000005766e000 JavaThread "webcam-discovery-service" daemon [_thread_blocked, id=6860, stack(0x0000000058450000,0x0000000058550000)]
  0x0000000057669000 JavaThread "atomic-processor-1" daemon [_thread_in_native, id=7596, stack(0x0000000058330000,0x0000000058430000)]
  0x0000000056820000 JavaThread "Service Thread" daemon [_thread_blocked, id=7484, stack(0x0000000057070000,0x0000000057170000)]
  0x000000005677f000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=5920, stack(0x0000000056d50000,0x0000000056e50000)]
  0x000000005677d000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=5692, stack(0x0000000056e50000,0x0000000056f50000)]
  0x000000005677c000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6540, stack(0x0000000056a20000,0x0000000056b20000)]
  0x000000005675b000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=2804, stack(0x0000000056b70000,0x0000000056c70000)]
  0x0000000055021000 JavaThread "Attach Listener" daemon [_thread_blocked, id=2876, stack(0x0000000056520000,0x0000000056620000)]
  0x000000005502f000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1520, stack(0x0000000055ff0000,0x00000000560f0000)]
=>0x000000005500b000 JavaThread "Finalizer" daemon [_thread_in_native, id=3056, stack(0x0000000056390000,0x0000000056490000)]
  0x0000000054fc4000 JavaThread "Reference Handler" daemon [_thread_blocked, id=7700, stack(0x0000000056280000,0x0000000056380000)]
  0x000000000025f000 JavaThread "main" [_thread_blocked, id=1132, stack(0x00000000025a0000,0x00000000026a0000)]

Other Threads:
  0x0000000054fbc800 VMThread [stack: 0x00000000560f0000,0x00000000561f0000] [id=4164]
  0x0000000056892800 WatcherThread [stack: 0x00000000571d0000,0x00000000572d0000] [id=3856]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 14336K, used 1316K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 9% used [0x00000000ec400000,0x00000000ec549210,0x00000000ed100000)
  from space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 20480K, used 4770K [0x00000000c4c00000, 0x00000000c6000000, 0x00000000ec400000)
  object space 20480K, 23% used [0x00000000c4c00000,0x00000000c50a8a38,0x00000000c6000000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K

Card table byte_map: [0x0000000011d30000,0x0000000011f10000] byte_map_base: 0x000000001170a000

Marking Bits: (ParMarkBitMap*) 0x000000005ffda6d0
 Begin Bits: [0x00000000126b0000, 0x0000000013580000)
 End Bits:   [0x0000000013580000, 0x0000000014450000)

Polling page: 0x0000000000230000

CodeCache: size=245760Kb used=6009Kb max_used=6078Kb free=239750Kb
 bounds [0x0000000002970000, 0x0000000002f80000, 0x0000000011970000]
 total_blobs=2283 nmethods=1787 adapters=409
 compilation: enabled

Compilation events (10 events):
Event: 364.195 Thread 0x000000005677f000 2009       3       org.bridj.AbstractIntegral::safeIntCast (71 bytes)
Event: 364.196 Thread 0x000000005677f000 nmethod 2009 0x0000000002d4bb90 code [0x0000000002d4bdc0, 0x0000000002d4c9f8]
Event: 364.196 Thread 0x000000005677f000 2010       3       org.bridj.Pointer::getBytesAtOffset (61 bytes)
Event: 364.196 Thread 0x000000005677f000 nmethod 2010 0x0000000002d233d0 code [0x0000000002d23560, 0x0000000002d23948]
Event: 373.832 Thread 0x000000005677d000 2011       4       java.lang.AbstractStringBuilder::append (144 bytes)
Event: 373.839 Thread 0x000000005677d000 nmethod 2011 0x0000000002d8cd90 code [0x0000000002d8cf00, 0x0000000002d8d598]
Event: 373.883 Thread 0x000000005677f000 2012       3       java.util.AbstractList::listIterator (6 bytes)
Event: 373.883 Thread 0x000000005677f000 nmethod 2012 0x0000000002dd7490 code [0x0000000002dd7600, 0x0000000002dd7808]
Event: 384.268 Thread 0x000000005677f000 2013 % !   3       java.lang.ref.Finalizer$FinalizerThread::run @ 33 (55 bytes)
Event: 384.269 Thread 0x000000005677f000 nmethod 2013% 0x0000000002d39650 code [0x0000000002d39880, 0x0000000002d3a548]

GC Heap History (10 events):
Event: 379.655 GC heap before
{Heap before GC invocations=222 (full 0):
 PSYoungGen      total 14336K, used 13627K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f6b58,0x00000000ed100000)
  from space 1024K, 34% used [0x00000000ed100000,0x00000000ed158410,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47831K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ab5d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 379.657 GC heap after
Heap after GC invocations=222 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47871K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7abfd40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 381.843 GC heap before
{Heap before GC invocations=223 (full 0):
 PSYoungGen      total 14336K, used 13831K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f9658,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47871K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7abfd40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 381.845 GC heap after
Heap after GC invocations=223 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47911K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ac9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 383.042 GC heap before
{Heap before GC invocations=224 (full 0):
 PSYoungGen      total 14336K, used 13818K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0f6370,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47911K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ac9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 383.042 GC heap after
Heap after GC invocations=224 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47951K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad3d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 384.241 GC heap before
{Heap before GC invocations=225 (full 0):
 PSYoungGen      total 14336K, used 13766K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 99% used [0x00000000ec400000,0x00000000ed0e9178,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed200000,0x00000000ed288820,0x00000000ed300000)
  to   space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
 ParOldGen       total 48128K, used 47951K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad3d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 384.244 GC heap after
Heap after GC invocations=225 (full 0):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47975K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}
Event: 384.244 GC heap before
{Heap before GC invocations=226 (full 1):
 PSYoungGen      total 14336K, used 546K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 53% used [0x00000000ed100000,0x00000000ed188820,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 48128K, used 47975K [0x00000000c4c00000, 0x00000000c7b00000, 0x00000000ec400000)
  object space 48128K, 99% used [0x00000000c4c00000,0x00000000c7ad9d40,0x00000000c7b00000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
Event: 384.265 GC heap after
Heap after GC invocations=226 (full 1):
 PSYoungGen      total 14336K, used 0K [0x00000000ec400000, 0x00000000ed300000, 0x0000000100000000)
  eden space 13312K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ed100000)
  from space 1024K, 0% used [0x00000000ed100000,0x00000000ed100000,0x00000000ed200000)
  to   space 1024K, 0% used [0x00000000ed200000,0x00000000ed200000,0x00000000ed300000)
 ParOldGen       total 20480K, used 4770K [0x00000000c4c00000, 0x00000000c6000000, 0x00000000ec400000)
  object space 20480K, 23% used [0x00000000c4c00000,0x00000000c50a8a38,0x00000000c6000000)
 Metaspace       used 12239K, capacity 12422K, committed 12672K, reserved 1060864K
  class space    used 1271K, capacity 1325K, committed 1408K, reserved 1048576K
}

Deoptimization events (9 events):
Event: 0.744 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b1677c method=java.lang.String.indexOf([CII[CIII)I @ 3
Event: 1.176 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b0c9f0 method=sun.misc.MetaIndex.mayContain(Ljava/lang/String;)Z @ 38
Event: 1.176 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b959c4 method=sun.misc.MetaIndex.mayContain(Ljava/lang/String;)Z @ 38
Event: 1.355 Thread 0x0000000057669000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b1ba7c method=sun.misc.URLClassPath.getLoader(I)Lsun/misc/URLClassPath$Loader; @ 36
Event: 1.655 Thread 0x0000000057669000 Uncommon trap: reason=range_check action=make_not_entrant pc=0x0000000002c75f10 method=sun.reflect.generics.parser.SignatureParser.current()C @ 34
Event: 2.673 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002ccbcb4 method=java.awt.image.ComponentSampleModel.getDataElements(IILjava/lang/Object;Ljava/awt/image/DataBuffer;)Ljava/lang/Object; @ 101
Event: 6.594 Thread 0x000000000025f000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002cd68e4 method=java.awt.image.ComponentColorModel.getRGB(Ljava/lang/Object;)I @ 4
Event: 38.845 Thread 0x0000000057a64000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002d00f5c method=java.util.concurrent.SynchronousQueue$TransferQueue$QNode.casItem(Ljava/lang/Object;Ljava/lang/Object;)Z @ 20
Event: 248.884 Thread 0x0000000057669000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002e6ec70 method=java.util.concurrent.SynchronousQueue$TransferQueue.transfer(Ljava/lang/Object;ZJ)Ljava/lang/Object; @ 229

Internal exceptions (10 events):
Event: 345.623 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec91beb0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 349.502 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eceb6a10) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 353.439 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec8032b8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 357.377 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ece0ce08) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 361.334 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec75b828) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 365.277 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eccf3fd8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 369.218 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec608720) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 373.072 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ed020770) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 376.983 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000ec920ea8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Event: 380.859 Thread 0x000000005687c800 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000eceb9dd8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u112\7884\hotspot\src\share\vm\prims\jvm.cpp, line 3228]

Events (10 events):
Event: 380.859 Thread 0x000000005687c800 Thread exited: 0x000000005687c800
Event: 380.964 Thread 0x000000005687c800 Thread added: 0x000000005687c800
Event: 381.617 Thread 0x00000000575f5800 Thread added: 0x00000000575f5800
Event: 381.653 Thread 0x000000005752b800 Thread added: 0x000000005752b800
Event: 381.843 Executing VM operation: ParallelGCFailedAllocation
Event: 381.845 Executing VM operation: ParallelGCFailedAllocation done
Event: 383.042 Executing VM operation: ParallelGCFailedAllocation
Event: 383.042 Executing VM operation: ParallelGCFailedAllocation done
Event: 384.241 Executing VM operation: ParallelGCFailedAllocation
Event: 384.265 Executing VM operation: ParallelGCFailedAllocation done

Dynamic libraries:
0x000000013fc80000 - 0x000000013fcb7000   c:\Program Files\Java\jdk1.8.0_112\bin\java.exe
0x0000000077530000 - 0x00000000776da000   C:\Windows\SYSTEM32\ntdll.dll
0x0000000076f30000 - 0x000000007704f000   C:\Windows\system32\kernel32.dll
0x000007fefdbf0000 - 0x000007fefdc5b000   C:\Windows\system32\KERNELBASE.dll
0x000007fefdd60000 - 0x000007fefde3b000   C:\Windows\system32\ADVAPI32.dll
0x000007feff700000 - 0x000007feff79f000   C:\Windows\system32\msvcrt.dll
0x000007fefded0000 - 0x000007fefdeef000   C:\Windows\SYSTEM32\sechost.dll
0x000007feff5d0000 - 0x000007feff6fd000   C:\Windows\system32\RPCRT4.dll
0x0000000076e30000 - 0x0000000076f2a000   C:\Windows\system32\USER32.dll
0x000007feff320000 - 0x000007feff387000   C:\Windows\system32\GDI32.dll
0x000007fefde40000 - 0x000007fefde4e000   C:\Windows\system32\LPK.dll
0x000007fefe120000 - 0x000007fefe1ea000   C:\Windows\system32\USP10.dll
0x000007fefbff0000 - 0x000007fefc1e4000   C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\COMCTL32.dll
0x000007fefe0a0000 - 0x000007fefe111000   C:\Windows\system32\SHLWAPI.dll
0x000007fefdea0000 - 0x000007fefdece000   C:\Windows\system32\IMM32.DLL
0x000007fefdf90000 - 0x000007fefe099000   C:\Windows\system32\MSCTF.dll
0x0000000060820000 - 0x00000000608f2000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\msvcr100.dll
0x000000005f7c0000 - 0x000000006005a000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\server\jvm.dll
0x000007fef23b0000 - 0x000007fef23b9000   C:\Windows\system32\WSOCK32.dll
0x000007fefde50000 - 0x000007fefde9d000   C:\Windows\system32\WS2_32.dll
0x000007fefe350000 - 0x000007fefe358000   C:\Windows\system32\NSI.dll
0x000007fefb2e0000 - 0x000007fefb31b000   C:\Windows\system32\WINMM.dll
0x000007fefca90000 - 0x000007fefca9c000   C:\Windows\system32\VERSION.dll
0x00000000776f0000 - 0x00000000776f7000   C:\Windows\system32\PSAPI.DLL
0x0000000061230000 - 0x000000006123f000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\verify.dll
0x00000000607f0000 - 0x0000000060819000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\java.dll
0x0000000072000000 - 0x0000000072023000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\instrument.dll
0x00000000607d0000 - 0x00000000607e6000   c:\Program Files\Java\jdk1.8.0_112\jre\bin\zip.dll
0x000007fefe590000 - 0x000007feff319000   C:\Windows\system32\SHELL32.dll
0x000007fefe380000 - 0x000007fefe583000   C:\Windows\system32\ole32.dll
0x000007fefd990000 - 0x000007fefd99f000   C:\Windows\system32\profapi.dll
0x000007fef72f0000 - 0x000007fef730a000   C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\bin\breakgen64.dll
0x00000000607b0000 - 0x00000000607ca000   C:\Program Files\Java\jdk1.8.0_112\jre\bin\net.dll
0x000007fefd280000 - 0x000007fefd2d5000   C:\Windows\system32\mswsock.dll
0x000007fefd270000 - 0x000007fefd277000   C:\Windows\System32\wship6.dll
0x000007fefd410000 - 0x000007fefd428000   C:\Windows\system32\CRYPTSP.dll
0x000007fefcf00000 - 0x000007fefcf47000   C:\Windows\system32\rsaenh.dll
0x000007fefcce0000 - 0x000007fefccfe000   C:\Windows\system32\USERENV.dll
0x000007fefd8c0000 - 0x000007fefd8cf000   C:\Windows\system32\CRYPTBASE.dll
0x000007fefbf00000 - 0x000007fefbf27000   C:\Windows\system32\IPHLPAPI.DLL
0x000007fefbef0000 - 0x000007fefbefb000   C:\Windows\system32\WINNSI.DLL
0x000007fefbd20000 - 0x000007fefbd31000   C:\Windows\system32\dhcpcsvc6.DLL
0x000007fefbd00000 - 0x000007fefbd18000   C:\Windows\system32\dhcpcsvc.DLL
0x0000000060790000 - 0x00000000607a1000   C:\Program Files\Java\jdk1.8.0_112\jre\bin\nio.dll
0x000000006e740000 - 0x000000006fda5000   C:\Users\a.pavlov\AppData\Local\Temp\xuggle\xuggle5492488285270740980.dll
0x000007fef7310000 - 0x000007fef7327000   C:\Windows\system32\AVICAP32.dll
0x000007fef2c40000 - 0x000007fef2c69000   C:\Windows\system32\MSVFW32.dll
0x00000000605f0000 - 0x0000000060788000   C:\Program Files\Java\jdk1.8.0_112\jre\bin\awt.dll
0x000007fefe270000 - 0x000007fefe348000   C:\Windows\system32\OLEAUT32.dll
0x000007fef2c10000 - 0x000007fef2c39000   C:\Users\a.pavlov\AppData\Local\Temp\BridJExtractedLibraries1250518414653852903\bridj.dll
0x000007fef2b00000 - 0x000007fef2b36000   C:\Users\A5A4F~1.PAV\AppData\Local\Temp\BridJExtractedLibraries1250518414653852903\OpenIMAJGrabber.dll
0x000007fefb6f0000 - 0x000007fefb746000   C:\Windows\system32\uxtheme.dll
0x000007fefdef0000 - 0x000007fefdf89000   C:\Windows\system32\CLBCatQ.DLL
0x000007fee07a0000 - 0x000007fee07b6000   C:\Windows\system32\devenum.dll
0x000007feff3f0000 - 0x000007feff5c7000   C:\Windows\system32\setupapi.dll
0x000007fefda40000 - 0x000007fefda76000   C:\Windows\system32\CFGMGR32.dll
0x000007fefdca0000 - 0x000007fefdcba000   C:\Windows\system32\DEVOBJ.dll
0x000007fefca60000 - 0x000007fefca8d000   C:\Windows\system32\ntmarta.dll
0x000007feff390000 - 0x000007feff3e2000   C:\Windows\system32\WLDAP32.dll
0x000007fefdc60000 - 0x000007fefdc9b000   C:\Windows\system32\WINTRUST.dll
0x000007fefda80000 - 0x000007fefdbed000   C:\Windows\system32\CRYPT32.dll
0x000007fefda30000 - 0x000007fefda3f000   C:\Windows\system32\MSASN1.dll
0x000007fee2e70000 - 0x000007fee2e7d000   C:\Windows\system32\msdmo.dll
0x000007fef2ad0000 - 0x000007fef2aff000   C:\Windows\system32\qcap.dll
0x000007fede380000 - 0x000007fede533000   C:\Windows\system32\quartz.dll
0x000007fefb0c0000 - 0x000007fefb0d8000   C:\Windows\system32\dwmapi.dll
0x000007fee0750000 - 0x000007fee0791000   C:\Windows\system32\ksproxy.ax
0x0000000074d80000 - 0x0000000074d86000   C:\Windows\system32\ksuser.dll
0x000007fef8700000 - 0x000007fef88ff000   C:\Windows\system32\d3d9.dll
0x000007fef86f0000 - 0x000007fef86f7000   C:\Windows\system32\d3d8thk.dll
0x000007fee0740000 - 0x000007fee074b000   C:\Windows\system32\vidcap.ax
0x000007fee0710000 - 0x000007fee0734000   C:\Windows\system32\kswdmcap.ax
0x000007fee05b0000 - 0x000007fee070c000   C:\Windows\system32\MFC42.dll
0x000007fee04f0000 - 0x000007fee05a1000   C:\Windows\system32\ODBC32.dll
0x00000000604c0000 - 0x00000000604f8000   C:\Windows\system32\odbcint.dll
0x000007fedfa70000 - 0x000007fedfb0b000   C:\Windows\System32\qedit.dll
0x000007feff7a0000 - 0x000007feff837000   C:\Windows\system32\COMDLG32.dll
0x000007fefb4d0000 - 0x000007fefb6e6000   C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.19061_none_2b299db671e86e03\gdiplus.dll
0x000007fee2820000 - 0x000007fee2911000   C:\Windows\system32\DDRAW.dll
0x000007fee2810000 - 0x000007fee2818000   C:\Windows\system32\DCIMAN32.dll
0x000007fede6f0000 - 0x000007fede908000   C:\Program Files (x86)\K-Lite Codec Pack\Filters\DirectVobSub64\vsfilter.dll
0x000007fef85c0000 - 0x000007fef8631000   C:\Windows\system32\WINSPOOL.DRV
0x000007fef43b0000 - 0x000007fef4404000   C:\Windows\system32\OLEACC.dll
0x0000000077050000 - 0x00000000771ab000   C:\Windows\system32\WININET.dll
0x0000000077700000 - 0x0000000077703000   C:\Windows\system32\Normaliz.dll
0x00000000771b0000 - 0x00000000773c2000   C:\Windows\system32\iertutil.dll
0x00000000773d0000 - 0x0000000077527000   C:\Windows\system32\urlmon.dll
0x000007fef6ed0000 - 0x000007fef6ed3000   C:\Windows\system32\api-ms-win-core-synch-l1-2-0.DLL
0x000007fef9610000 - 0x000007fef961b000   C:\Windows\system32\msyuv.dll
0x000007fef23c0000 - 0x000007fef24e5000   C:\Windows\system32\dbghelp.dll

VM Arguments:
jvm_args: -javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\lib\coverage-agent.jar=C:\Users\a.pavlov\AppData\Local\Temp\coverageargs -javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\lib\idea_rt.jar=19270:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2017.1\bin -Dfile.encoding=UTF-8 
java_command: Recorder.Start
java_class_path (initial): C:\Program Files\Java\jdk1.8.0_112\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_112\jre\lib\rt.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\out\production\OnlyRecorder;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\logback-classic-1.2.1.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\bridj-0.7-20140918.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\webcam-capture-0.3.12-20161206.184756-3.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\commons-lang3-3.5.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\slf4j-api-1.7.24.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\commons-cli-1.3.1.jar;C:\Pavlov\Cloud_mail\farmnet\OnlyRecorder\lib_recorder\xuggle-xuggler-5.4.jar;C:\Pavlov\Clo
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=c:\Program Files\Java\jdk1.8.0_112\
CLASSPATH=.;.;c:\pavlov\java\JAVA_L~1\lib\sound.jar;c:\pavlov\java\JAVA_L~1\lib\jmf.jar;c:\pavlov\java\JAVA_L~1\lib;
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Git\cmd
USERNAME=a.pavlov
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

---------------  S Y S T E M  ---------------

OS: Windows 7 , 64 bit Build 7601 (6.1.7601.19160)

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, clmul, erms, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 3881288k(303584k free), swap 8252260k(1420236k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.112-b15) for windows-amd64 JRE (1.8.0_112-b15), built on Sep 22 2016 21:31:56 by "java_re" with MS VC++ 10.0 (VS2010)

time: Fri Apr 28 14:36:04 2017
elapsed time: 384 seconds (0d 0h 6m 24s)

Hi pavlo, i´m sorry if this is a dummy question, but how did you get the crash log ?