bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.57k stars 1.58k forks source link

JVM Crash When Frame Grabber Stop calls #731

Closed MachineIntelligence6 closed 7 years ago

MachineIntelligence6 commented 7 years ago

Hi Im using JavaCV to GrabFrames from Videos, The process is multiThreaded and work fine, but one the video is crash the app when i stop the grabber. Im using JavaCV 1.3.2 Here is sample of my code and the exception.

****Exception ***

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8e900a24b, pid=9352, tid=0x0000000000001ec4
#
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [ntdll.dll+0x3a24b]
#
# 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 (0x0000000020382000):  JavaThread "Thread-18" [_thread_in_native, id=7876, stack(0x000000002e5e0000,0x000000002e6e0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff

Registers:
RAX=0xaab4aaa9b5a9a9b5, RBX=0x0000000001170000, RCX=0x00000000a9a8b4a8, RDX=0x0000000090000000
RSP=0x000000002e6de450, RBP=0x000000002e6de830, RSI=0x000000002e5dec20, RDI=0x000000002e0ae110
R8 =0x0000000001170304, R9 =0x0000000000000003, R10=0x00007ff8e90e15c0, R11=0x0000000000000000
R12=0x0000000001170150, R13=0x000000000000003a, R14=0x00000000011702c8, R15=0x000000002e5dec30
RIP=0x00007ff8e900a24b, EFLAGS=0x0000000000010283

Top of Stack: (sp=0x000000002e6de450)
0x000000002e6de450:   0000000000000000 0000000000000000
0x000000002e6de460:   0000000000000000 0000000000000000
0x000000002e6de470:   0000000000000000 0000000000000000
0x000000002e6de480:   0000000000000001 0000000000000000
0x000000002e6de490:   0000000000008000 0000000000000001
0x000000002e6de4a0:   0000000000000000 0000000000000000
0x000000002e6de4b0:   0000b4a800010001 0000000000000000
0x000000002e6de4c0:   0000000000001bf8 0000000000000001
0x000000002e6de4d0:   0000003c0000037f 00007ff800000000
0x000000002e6de4e0:   000000002e5dabe0 000000002a068b70
0x000000002e6de4f0:   0000000000000000 000000002e5dabe0
0x000000002e6de500:   000003ff00000000 0000000000000004
0x000000002e6de510:   000000000000003a 00000000000003ff
0x000000002e6de520:   000000000000003a 00007ff8e900ace4
0x000000002e6de530:   0000000001170000 0000000000000000
0x000000002e6de540:   000000000000c000 000000002ded0000 

Instructions: (pc=0x00007ff8e900a24b)
0x00007ff8e900a22b:   85 ff 0f 84 38 0a 00 00 48 8d 83 50 01 00 00 48
0x00007ff8e900a23b:   3b c7 0f 85 a8 03 00 00 4c 8d 7e 10 48 8b 47 08
0x00007ff8e900a24b:   48 8b 08 48 3b cf 0f 85 a9 17 00 00 49 89 3f 49
0x00007ff8e900a25b:   89 47 08 4c 89 38 4c 89 7f 08 0f b7 46 08 48 01 

Register to memory mapping:

RAX=0xaab4aaa9b5a9a9b5 is an unknown value
RBX=0x0000000001170000 is an unknown value
RCX=0x00000000a9a8b4a8 is an unknown value
RDX=0x0000000090000000 is an unknown value
RSP=0x000000002e6de450 is pointing into the stack for thread: 0x0000000020382000
RBP=0x000000002e6de830 is pointing into the stack for thread: 0x0000000020382000
RSI=0x000000002e5dec20 is an unknown value
RDI=0x000000002e0ae110 is an unknown value
R8 =0x0000000001170304 is an unknown value
R9 =0x0000000000000003 is an unknown value
R10=0x00007ff8e90e15c0 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000001170150 is an unknown value
R13=0x000000000000003a is an unknown value
R14=0x00000000011702c8 is an unknown value
R15=0x000000002e5dec30 is an unknown value

Stack: [0x000000002e5e0000,0x000000002e6e0000],  sp=0x000000002e6de450,  free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x3a24b]
C  [ntdll.dll+0x38097]
C  [msvcrt.dll+0x19e50]
C  [msvcrt.dll+0x1952c]
C  [avutil-55.dll+0x2655c]
C  [avutil-55.dll+0x5dea]
C  [avcodec-57.dll+0xb4fa5]
C  [avformat-57.dll+0x13bdfa]
C  [avformat-57.dll+0x1c2cf]
C  [avformat-57.dll+0x13d2b2]
C  [avformat-57.dll+0x1404c0]
C  [avformat-57.dll+0x14153d]
C  0x0000000003779d64

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 3858  org.bytedeco.javacpp.avformat.av_read_frame(Lorg/bytedeco/javacpp/avformat$AVFormatContext;Lorg/bytedeco/javacpp/avcodec$AVPacket;)I (0 bytes) @ 0x0000000003779ce6 [0x0000000003779c80+0x66]
J 3895 C1 org.bytedeco.javacv.FFmpegFrameGrabber.grabFrame(ZZZZ)Lorg/bytedeco/javacv/Frame; (1182 bytes) @ 0x000000000379880c [0x0000000003798300+0x50c]
j  com.msv.ui.PreviewView$GrabThread.run()V+352
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0000000020383800 JavaThread "Thread-19" [_thread_blocked, id=7360, stack(0x000000002e6e0000,0x000000002e7e0000)]
=>0x0000000020382000 JavaThread "Thread-18" [_thread_in_native, id=7876, stack(0x000000002e5e0000,0x000000002e6e0000)]
  0x0000000020379800 JavaThread "JavaCPP Deallocator" daemon [_thread_blocked, id=1416, stack(0x000000002dce0000,0x000000002dde0000)]
  0x000000002037c800 JavaThread "Thread-16" [_thread_blocked, id=6744, stack(0x000000002dae0000,0x000000002dbe0000)]
  0x0000000020379000 JavaThread "pool-4-thread-1" [_thread_blocked, id=6600, stack(0x000000002bec0000,0x000000002bfc0000)]
  0x000000002037f800 JavaThread "SwingWorker-pool-2-thread-6" daemon [_thread_blocked, id=6620, stack(0x000000002bdc0000,0x000000002bec0000)]
  0x000000002037c000 JavaThread "SwingWorker-pool-2-thread-5" daemon [_thread_blocked, id=7540, stack(0x000000002bcc0000,0x000000002bdc0000)]
  0x000000002037a800 JavaThread "SwingWorker-pool-2-thread-4" daemon [_thread_blocked, id=10224, stack(0x000000002bac0000,0x000000002bbc0000)]
  0x0000000020378000 JavaThread "SwingWorker-pool-2-thread-3" daemon [_thread_blocked, id=8484, stack(0x000000002b9c0000,0x000000002bac0000)]
  0x000000002037f000 JavaThread "SwingWorker-pool-2-thread-2" daemon [_thread_blocked, id=336, stack(0x000000002b8c0000,0x000000002b9c0000)]
  0x000000002037b000 JavaThread "SwingWorker-pool-2-thread-1" daemon [_thread_blocked, id=904, stack(0x000000002b7c0000,0x000000002b8c0000)]
  0x000000002037e000 JavaThread "Thread-13" [_thread_blocked, id=6748, stack(0x000000002b6c0000,0x000000002b7c0000)]
  0x0000000020420800 JavaThread "SyntheticaAnimation 70" daemon [_thread_blocked, id=6244, stack(0x000000002a090000,0x000000002a190000)]
  0x0000000020422800 JavaThread "Abandoned connection cleanup thread" daemon [_thread_blocked, id=508, stack(0x0000000029870000,0x0000000029970000)]
  0x0000000020423800 JavaThread "Thread-10" daemon [_thread_blocked, id=9900, stack(0x0000000029770000,0x0000000029870000)]
  0x000000002041f800 JavaThread "TimerQueue" daemon [_thread_blocked, id=2512, stack(0x0000000029050000,0x0000000029150000)]
  0x0000000020425000 JavaThread "Thread-9" [_thread_blocked, id=5520, stack(0x0000000028f50000,0x0000000029050000)]
  0x0000000020424000 JavaThread "pool-1-thread-1" [_thread_blocked, id=5444, stack(0x0000000028e50000,0x0000000028f50000)]
  0x0000000020421000 JavaThread "SyntheticaAnimation 60" daemon [_thread_blocked, id=2360, stack(0x0000000028d50000,0x0000000028e50000)]
  0x0000000020425800 JavaThread "SyntheticaAnimation 50" daemon [_thread_blocked, id=5940, stack(0x0000000028200000,0x0000000028300000)]
  0x000000002041e800 JavaThread "D3D Screen Updater" daemon [_thread_blocked, id=8312, stack(0x00000000274f0000,0x00000000275f0000)]
  0x0000000002b14000 JavaThread "DestroyJavaVM" [_thread_blocked, id=9956, stack(0x0000000002a10000,0x0000000002b10000)]
  0x0000000020146000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=7260, stack(0x0000000022060000,0x0000000022160000)]
  0x000000001fe53800 JavaThread "SyntheticaCleanerThread" daemon [_thread_blocked, id=10148, stack(0x0000000021d60000,0x0000000021e60000)]
  0x00000000205da800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=9052, stack(0x0000000021140000,0x0000000021240000)]
  0x0000000020149800 JavaThread "AWT-Shutdown" [_thread_blocked, id=5040, stack(0x0000000021040000,0x0000000021140000)]
  0x0000000020149000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2508, stack(0x0000000020d10000,0x0000000020e10000)]
  0x000000001e6c5000 JavaThread "Service Thread" daemon [_thread_blocked, id=7572, stack(0x000000001f210000,0x000000001f310000)]
  0x000000001c73d000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=7692, stack(0x000000001f110000,0x000000001f210000)]
  0x000000001e65e000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=1308, stack(0x000000001f010000,0x000000001f110000)]
  0x000000001e659000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=3260, stack(0x000000001ef10000,0x000000001f010000)]
  0x000000001e653800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=4144, stack(0x000000001ee10000,0x000000001ef10000)]
  0x000000001e651000 JavaThread "Attach Listener" daemon [_thread_blocked, id=6844, stack(0x000000001ed10000,0x000000001ee10000)]
  0x000000001e650000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=6264, stack(0x000000001ec10000,0x000000001ed10000)]
  0x000000001e640800 JavaThread "Finalizer" daemon [_thread_blocked, id=9184, stack(0x000000001ea20000,0x000000001eb20000)]
  0x0000000002c08000 JavaThread "Reference Handler" daemon [_thread_blocked, id=8172, stack(0x000000001e520000,0x000000001e620000)]

Other Threads:
  0x000000001c729000 VMThread [stack: 0x000000001e420000,0x000000001e520000] [id=8476]
  0x000000001e6c7800 WatcherThread [stack: 0x000000001f310000,0x000000001f410000] [id=6236]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 84992K, used 18853K [0x000000076ab00000, 0x0000000770c00000, 0x00000007c0000000)
  eden space 74240K, 10% used [0x000000076ab00000,0x000000076b2ec1b0,0x000000076f380000)
  from space 10752K, 99% used [0x000000076fe00000,0x000000077087d4f0,0x0000000770880000)
  to   space 10752K, 0% used [0x000000076f380000,0x000000076f380000,0x000000076fe00000)
 ParOldGen       total 124416K, used 25783K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 20% used [0x00000006c0000000,0x00000006c192dc10,0x00000006c7980000)
 Metaspace       used 32616K, capacity 32956K, committed 33456K, reserved 1079296K
  class space    used 4328K, capacity 4456K, committed 4528K, reserved 1048576K

Card table byte_map: [0x0000000011fd0000,0x00000000127e0000] byte_map_base: 0x000000000e9d0000

Marking Bits: (ParMarkBitMap*) 0x000000006b97a6c0
 Begin Bits: [0x0000000013540000, 0x0000000017540000)
 End Bits:   [0x0000000017540000, 0x000000001b540000)

Polling page: 0x0000000002960000

CodeCache: size=245760Kb used=12426Kb max_used=12442Kb free=233333Kb
 bounds [0x0000000002c10000, 0x0000000003850000, 0x0000000011c10000]
 total_blobs=4380 nmethods=3600 adapters=690
 compilation: enabled

Compilation events (10 events):
Event: 19.950 Thread 0x000000001c73d000 4073       3       java.util.IdentityHashMap$IdentityHashMapIterator::<init> (6 bytes)
Event: 19.950 Thread 0x000000001c73d000 nmethod 4073 0x000000000321f510 code [0x000000000321f680, 0x000000000321f808]
Event: 19.950 Thread 0x000000001c73d000 4074       3       java.util.IdentityHashMap$IdentityHashMapIterator::<init> (63 bytes)
Event: 19.950 Thread 0x000000001c73d000 nmethod 4074 0x00000000031e5750 code [0x00000000031e58c0, 0x00000000031e5b50]
Event: 19.951 Thread 0x000000001e65e000 4075       4       sun.java2d.loops.ProcessPath$ActiveEdgeList::isEmpty (13 bytes)
Event: 19.952 Thread 0x000000001e65e000 nmethod 4075 0x0000000002e2cb50 code [0x0000000002e2cc80, 0x0000000002e2ccf8]
Event: 20.039 Thread 0x000000001c73d000 4076       3       javax.swing.plaf.basic.BasicTabbedPaneUI::getIconForTab (41 bytes)
Event: 20.040 Thread 0x000000001c73d000 nmethod 4076 0x000000000381ce10 code [0x000000000381cfe0, 0x000000000381d848]
Event: 20.040 Thread 0x000000001c73d000 4077       3       javax.swing.JTabbedPane::getTabComponentAt (17 bytes)
Event: 20.040 Thread 0x000000001c73d000 nmethod 4077 0x000000000345e8d0 code [0x000000000345ea40, 0x000000000345ed48]

GC Heap History (10 events):
Event: 2.462 GC heap before
{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 76288K, used 49947K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
  eden space 65536K, 76% used [0x000000076ab00000,0x000000076dbc6fa8,0x000000076eb00000)
  from space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
  to   space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
 ParOldGen       total 175104K, used 0K [0x00000006c0000000, 0x00000006cab00000, 0x000000076ab00000)
  object space 175104K, 0% used [0x00000006c0000000,0x00000006c0000000,0x00000006cab00000)
 Metaspace       used 20780K, capacity 21034K, committed 21296K, reserved 1067008K
  class space    used 2719K, capacity 2831K, committed 2864K, reserved 1048576K
Event: 2.471 GC heap after
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 76288K, used 6748K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
  eden space 65536K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076eb00000)
  from space 10752K, 62% used [0x000000076eb00000,0x000000076f197290,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
 ParOldGen       total 175104K, used 96K [0x00000006c0000000, 0x00000006cab00000, 0x000000076ab00000)
  object space 175104K, 0% used [0x00000006c0000000,0x00000006c0018010,0x00000006cab00000)
 Metaspace       used 20780K, capacity 21034K, committed 21296K, reserved 1067008K
  class space    used 2719K, capacity 2831K, committed 2864K, reserved 1048576K
}
Event: 2.471 GC heap before
{Heap before GC invocations=2 (full 1):
 PSYoungGen      total 76288K, used 6748K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
  eden space 65536K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076eb00000)
  from space 10752K, 62% used [0x000000076eb00000,0x000000076f197290,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
 ParOldGen       total 175104K, used 96K [0x00000006c0000000, 0x00000006cab00000, 0x000000076ab00000)
  object space 175104K, 0% used [0x00000006c0000000,0x00000006c0018010,0x00000006cab00000)
 Metaspace       used 20780K, capacity 21034K, committed 21296K, reserved 1067008K
  class space    used 2719K, capacity 2831K, committed 2864K, reserved 1048576K
Event: 2.504 GC heap after
Heap after GC invocations=2 (full 1):
 PSYoungGen      total 76288K, used 0K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
  eden space 65536K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076eb00000)
  from space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
 ParOldGen       total 124416K, used 6482K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 5% used [0x00000006c0000000,0x00000006c06548b0,0x00000006c7980000)
 Metaspace       used 20780K, capacity 21034K, committed 21296K, reserved 1067008K
  class space    used 2719K, capacity 2831K, committed 2864K, reserved 1048576K
}
Event: 11.708 GC heap before
{Heap before GC invocations=3 (full 1):
 PSYoungGen      total 76288K, used 65536K [0x000000076ab00000, 0x0000000770000000, 0x00000007c0000000)
  eden space 65536K, 100% used [0x000000076ab00000,0x000000076eb00000,0x000000076eb00000)
  from space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076f580000,0x000000076f580000,0x0000000770000000)
 ParOldGen       total 124416K, used 6482K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 5% used [0x00000006c0000000,0x00000006c06548b0,0x00000006c7980000)
 Metaspace       used 27816K, capacity 28130K, committed 28720K, reserved 1075200K
  class space    used 3664K, capacity 3773K, committed 3888K, reserved 1048576K
Event: 11.719 GC heap after
Heap after GC invocations=3 (full 1):
 PSYoungGen      total 76288K, used 10740K [0x000000076ab00000, 0x0000000770a00000, 0x00000007c0000000)
  eden space 65536K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076eb00000)
  from space 10752K, 99% used [0x000000076f580000,0x000000076fffd378,0x0000000770000000)
  to   space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
 ParOldGen       total 124416K, used 13439K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 10% used [0x00000006c0000000,0x00000006c0d1ff18,0x00000006c7980000)
 Metaspace       used 27816K, capacity 28130K, committed 28720K, reserved 1075200K
  class space    used 3664K, capacity 3773K, committed 3888K, reserved 1048576K
}
Event: 17.999 GC heap before
{Heap before GC invocations=4 (full 1):
 PSYoungGen      total 76288K, used 76276K [0x000000076ab00000, 0x0000000770a00000, 0x00000007c0000000)
  eden space 65536K, 100% used [0x000000076ab00000,0x000000076eb00000,0x000000076eb00000)
  from space 10752K, 99% used [0x000000076f580000,0x000000076fffd378,0x0000000770000000)
  to   space 10752K, 0% used [0x000000076eb00000,0x000000076eb00000,0x000000076f580000)
 ParOldGen       total 124416K, used 13439K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 10% used [0x00000006c0000000,0x00000006c0d1ff18,0x00000006c7980000)
 Metaspace       used 30884K, capacity 31254K, committed 31920K, reserved 1077248K
  class space    used 4122K, capacity 4231K, committed 4272K, reserved 1048576K
Event: 18.006 GC heap after
Heap after GC invocations=4 (full 1):
 PSYoungGen      total 76288K, used 10720K [0x000000076ab00000, 0x0000000770880000, 0x00000007c0000000)
  eden space 65536K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076eb00000)
  from space 10752K, 99% used [0x000000076eb00000,0x000000076f5781e8,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076fe00000,0x000000076fe00000,0x0000000770880000)
 ParOldGen       total 124416K, used 19194K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 15% used [0x00000006c0000000,0x00000006c12beae8,0x00000006c7980000)
 Metaspace       used 30884K, capacity 31254K, committed 31920K, reserved 1077248K
  class space    used 4122K, capacity 4231K, committed 4272K, reserved 1048576K
}
Event: 19.485 GC heap before
{Heap before GC invocations=5 (full 1):
 PSYoungGen      total 76288K, used 76256K [0x000000076ab00000, 0x0000000770880000, 0x00000007c0000000)
  eden space 65536K, 100% used [0x000000076ab00000,0x000000076eb00000,0x000000076eb00000)
  from space 10752K, 99% used [0x000000076eb00000,0x000000076f5781e8,0x000000076f580000)
  to   space 10752K, 0% used [0x000000076fe00000,0x000000076fe00000,0x0000000770880000)
 ParOldGen       total 124416K, used 19194K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 15% used [0x00000006c0000000,0x00000006c12beae8,0x00000006c7980000)
 Metaspace       used 32546K, capacity 32860K, committed 33456K, reserved 1079296K
  class space    used 4319K, capacity 4424K, committed 4528K, reserved 1048576K
Event: 19.494 GC heap after
Heap after GC invocations=5 (full 1):
 PSYoungGen      total 84992K, used 10741K [0x000000076ab00000, 0x0000000770c00000, 0x00000007c0000000)
  eden space 74240K, 0% used [0x000000076ab00000,0x000000076ab00000,0x000000076f380000)
  from space 10752K, 99% used [0x000000076fe00000,0x000000077087d4f0,0x0000000770880000)
  to   space 10752K, 0% used [0x000000076f380000,0x000000076f380000,0x000000076fe00000)
 ParOldGen       total 124416K, used 25783K [0x00000006c0000000, 0x00000006c7980000, 0x000000076ab00000)
  object space 124416K, 20% used [0x00000006c0000000,0x00000006c192dc10,0x00000006c7980000)
 Metaspace       used 32546K, capacity 32860K, committed 33456K, reserved 1079296K
  class space    used 4319K, capacity 4424K, committed 4528K, reserved 1048576K
}

Deoptimization events (10 events):
Event: 13.091 Thread 0x0000000020146000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000000000351da80 method=javax.swing.RepaintManager.addDirtyRegion0(Ljava/awt/Container;IIII)V @ 99
Event: 13.681 Thread 0x0000000020146000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000337cfb4 method=de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; @ 37
Event: 13.827 Thread 0x0000000020146000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000032f4380 method=sun.awt.SunToolkit.isInstanceOf(Ljava/lang/Class;Ljava/lang/String;)Z @ 14
Event: 14.093 Thread 0x0000000020146000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003608d84 method=sun.java2d.pipe.RenderQueue.ensureCapacity(I)V @ 8
Event: 18.497 Thread 0x0000000020380800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000033486c4 method=java.util.concurrent.ConcurrentHashMap.putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object; @ 98
Event: 18.805 Thread 0x0000000020377800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003790b5c method=org.bytedeco.javacv.Java2DFrameConverter.flipCopyWithGamma(Ljava/nio/ByteBuffer;ILjava/nio/ByteBuffer;IZDZI)V @ 59
Event: 18.991 Thread 0x0000000020380800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002da41b4 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4
Event: 19.029 Thread 0x0000000020380800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000038112bc method=java.lang.Character.isSurrogate(C)Z @ 3
Event: 19.029 Thread 0x0000000020380800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003778c70 method=java.lang.Character.isSurrogate(C)Z @ 3
Event: 20.041 Thread 0x000000002037d800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000037f5098 method=java.nio.Buffer.limit(I)Ljava/nio/Buffer; @ 5

Internal exceptions (10 events):
Event: 11.753 Thread 0x0000000020377800 Exception <a 'sun/nio/fs/WindowsException'> (0x000000076ad823c8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\jni.cpp, line 709]
Event: 18.527 Thread 0x0000000020380800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076d496fc0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 18.527 Thread 0x0000000020380800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076d4974f0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 18.607 Thread 0x0000000020377800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076d1c0de8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 18.608 Thread 0x0000000020377800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076d1c1318) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 19.946 Thread 0x0000000020382000 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076b0c37b8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 19.947 Thread 0x0000000020382000 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076b0c3ce8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 19.950 Thread 0x000000002037d800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076b0e8a08) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 19.950 Thread 0x000000002037d800 Exception <a 'java/lang/UnsatisfiedLinkError': org.bytedeco.javacpp.Pointer.physicalBytes()J> (0x000000076b0e8f38) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\nativeLookup.cpp, line 378]
Event: 20.038 Thread 0x0000000020377800 Exception <a 'java/lang/InterruptedException'> (0x000000076afd5a50) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\runtime\objectMonitor.cpp, line 1495]

Events (10 events):
Event: 20.037 Executing VM operation: RevokeBias
Event: 20.038 Executing VM operation: RevokeBias done
Event: 20.038 Executing VM operation: RevokeBias
Event: 20.038 Executing VM operation: RevokeBias done
Event: 20.038 Thread 0x0000000020377800 Thread exited: 0x0000000020377800
Event: 20.041 Thread 0x000000002037d800 Uncommon trap: trap_request=0xffffff65 fr.pc=0x00000000037f5098
Event: 20.041 Thread 0x000000002037d800 DEOPT PACKING pc=0x00000000037f5098 sp=0x000000002e8df200
Event: 20.041 Thread 0x000000002037d800 DEOPT UNPACKING pc=0x0000000002c5582a sp=0x000000002e8df1a0 mode 2
Event: 20.042 loading class java/lang/Throwable$WrappedPrintStream
Event: 20.042 loading class java/lang/Throwable$PrintStreamOrWriter

Dynamic libraries:
0x00007ff604bf0000 - 0x00007ff604c27000     C:\Program Files\Java\jdk1.8.0_111\bin\javaw.exe
0x00007ff8e8fd0000 - 0x00007ff8e91a1000     C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ff8e6560000 - 0x00007ff8e660c000     C:\WINDOWS\System32\KERNEL32.DLL
0x00007ff8d7b50000 - 0x00007ff8d7b83000     C:\Program Files\AVAST Software\Avast\x64\aswhooka.dll
0x00007ff8e5650000 - 0x00007ff8e586d000     C:\WINDOWS\System32\KERNELBASE.dll
0x00007ff8e86c0000 - 0x00007ff8e8762000     C:\WINDOWS\System32\ADVAPI32.dll
0x00007ff8e8c20000 - 0x00007ff8e8cbe000     C:\WINDOWS\System32\msvcrt.dll
0x00007ff8e8820000 - 0x00007ff8e8879000     C:\WINDOWS\System32\sechost.dll
0x00007ff8e8a50000 - 0x00007ff8e8b71000     C:\WINDOWS\System32\RPCRT4.dll
0x00007ff8e84d0000 - 0x00007ff8e8635000     C:\WINDOWS\System32\USER32.dll
0x00007ff8e5a10000 - 0x00007ff8e5a2e000     C:\WINDOWS\System32\win32u.dll
0x00007ff8e8220000 - 0x00007ff8e8254000     C:\WINDOWS\System32\GDI32.dll
0x00007ff8e5b30000 - 0x00007ff8e5cb0000     C:\WINDOWS\System32\gdi32full.dll
0x00007ff8d85d0000 - 0x00007ff8d884a000     C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.953_none_42151e83c686086b\COMCTL32.dll
0x00007ff8e7b20000 - 0x00007ff8e7de8000     C:\WINDOWS\System32\combase.dll
0x00007ff8e5a30000 - 0x00007ff8e5b25000     C:\WINDOWS\System32\ucrtbase.dll
0x00007ff8e54d0000 - 0x00007ff8e553a000     C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007ff8e8bf0000 - 0x00007ff8e8c1e000     C:\WINDOWS\System32\IMM32.DLL
0x000000006c990000 - 0x000000006ca62000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\msvcr100.dll
0x000000006b160000 - 0x000000006b9fa000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\server\jvm.dll
0x00007ff8e82c0000 - 0x00007ff8e82c8000     C:\WINDOWS\System32\PSAPI.DLL
0x00007ff8ce550000 - 0x00007ff8ce559000     C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ff8e8dc0000 - 0x00007ff8e8e2a000     C:\WINDOWS\System32\WS2_32.dll
0x00007ff8e38c0000 - 0x00007ff8e38e3000     C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ff8db5c0000 - 0x00007ff8db5ca000     C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ff8e3860000 - 0x00007ff8e388b000     C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ff8e5920000 - 0x00007ff8e5962000     C:\WINDOWS\System32\cfgmgr32.dll
0x000000006c970000 - 0x000000006c97f000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\verify.dll
0x000000006c940000 - 0x000000006c969000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\java.dll
0x000000006b140000 - 0x000000006b156000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\zip.dll
0x00007ff8e6610000 - 0x00007ff8e7b18000     C:\WINDOWS\System32\SHELL32.dll
0x00007ff8e5e80000 - 0x00007ff8e655a000     C:\WINDOWS\System32\windows.storage.dll
0x00007ff8e5480000 - 0x00007ff8e54cc000     C:\WINDOWS\System32\powrprof.dll
0x00007ff8e8640000 - 0x00007ff8e8692000     C:\WINDOWS\System32\shlwapi.dll
0x00007ff8e5470000 - 0x00007ff8e547f000     C:\WINDOWS\System32\kernel.appcore.dll
0x00007ff8e5870000 - 0x00007ff8e5919000     C:\WINDOWS\System32\shcore.dll
0x00007ff8e5450000 - 0x00007ff8e5464000     C:\WINDOWS\System32\profapi.dll
0x000000006afa0000 - 0x000000006b138000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\awt.dll
0x00007ff8e82d0000 - 0x00007ff8e838f000     C:\WINDOWS\System32\OLEAUT32.dll
0x00007ff8e5970000 - 0x00007ff8e5a0c000     C:\WINDOWS\System32\msvcp_win.dll
0x00007ff8e39e0000 - 0x00007ff8e3a5a000     C:\WINDOWS\SYSTEM32\apphelp.dll
0x00007ff8e3bc0000 - 0x00007ff8e3c55000     C:\WINDOWS\system32\uxtheme.dll
0x00007ff8e88e0000 - 0x00007ff8e8a3a000     C:\WINDOWS\System32\MSCTF.dll
0x00007ff8ddf40000 - 0x00007ff8ddf88000     C:\Program Files (x86)\TeamViewer\tv_x64.dll
0x00007ff8e8390000 - 0x00007ff8e84c8000     C:\WINDOWS\System32\ole32.dll
0x00007ff8d6260000 - 0x00007ff8d62f8000     C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll
0x00007ff8e3030000 - 0x00007ff8e3056000     C:\WINDOWS\system32\dwmapi.dll
0x000000006af50000 - 0x000000006af97000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\fontmanager.dll
0x00007ff8bf090000 - 0x00007ff8bf21d000     C:\WINDOWS\system32\d3d9.dll
0x00007ff8e09d0000 - 0x00007ff8e0c5d000     C:\WINDOWS\SYSTEM32\d3d10warp.dll
0x000000006af30000 - 0x000000006af4a000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\net.dll
0x00007ff8e4d10000 - 0x00007ff8e4d6c000     C:\WINDOWS\system32\mswsock.dll
0x000000006af10000 - 0x000000006af21000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\nio.dll
0x000000006aec0000 - 0x000000006af02000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\t2k.dll
0x00007ff8e4eb0000 - 0x00007ff8e4ec7000     C:\WINDOWS\SYSTEM32\CRYPTSP.dll
0x00007ff8e4910000 - 0x00007ff8e4943000     C:\WINDOWS\system32\rsaenh.dll
0x00007ff8e5380000 - 0x00007ff8e53ab000     C:\WINDOWS\SYSTEM32\bcrypt.dll
0x00007ff8e4b90000 - 0x00007ff8e4baf000     C:\WINDOWS\SYSTEM32\USERENV.dll
0x00007ff8e5370000 - 0x00007ff8e537b000     C:\WINDOWS\SYSTEM32\CRYPTBASE.dll
0x00007ff8e4a90000 - 0x00007ff8e4ac8000     C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
0x00007ff8e8a40000 - 0x00007ff8e8a48000     C:\WINDOWS\System32\NSI.dll
0x00007ff8e0d30000 - 0x00007ff8e0d46000     C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
0x00007ff8e0d00000 - 0x00007ff8e0d1a000     C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
0x0000000180000000 - 0x0000000180038000     C:\Users\Admin\AppData\Local\Temp\jna-63116079\jna6951906364028339139.dll
0x000000006ae90000 - 0x000000006aebe000     \\?\C:\PROGRA~1\VideoLAN\VLC\libvlc.dll
0x000000006abe0000 - 0x000000006ae8d000     \\?\C:\PROGRA~1\VideoLAN\VLC\libvlccore.dll
0x00007ff8a9130000 - 0x00007ff8a9b01000     C:\Users\Admin\Desktop\video-viewer\native_lib\opencv\lib\opencv_java2410.dll
0x00007ff8d9a90000 - 0x00007ff8d9ab0000     C:\WINDOWS\SYSTEM32\AVIFIL32.dll
0x00007ff8d7840000 - 0x00007ff8d7869000     C:\WINDOWS\SYSTEM32\MSVFW32.dll
0x00007ff8d8940000 - 0x00007ff8d8958000     C:\WINDOWS\SYSTEM32\AVICAP32.dll
0x00007ff8dde50000 - 0x00007ff8dde6c000     C:\WINDOWS\SYSTEM32\MSACM32.dll
0x00007ff8e8780000 - 0x00007ff8e881f000     C:\WINDOWS\System32\clbcatq.dll
0x00007ff8d7190000 - 0x00007ff8d733a000     C:\Windows\System32\uiautomationcore.dll
0x00007ff8e5270000 - 0x00007ff8e5308000     C:\WINDOWS\SYSTEM32\sxs.dll
0x000000006ab30000 - 0x000000006abd2000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\mlib_image.dll
0x00007ff8d5940000 - 0x00007ff8d59a5000     C:\Windows\System32\OLEACC.dll
0x00007ff8d7510000 - 0x00007ff8d758d000     C:\WINDOWS\SYSTEM32\twinapi.dll
0x00007ff8e3e60000 - 0x00007ff8e3f7c000     C:\WINDOWS\SYSTEM32\twinapi.appcore.dll
0x000000006c930000 - 0x000000006c93d000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\management.dll
0x00007ff8e20e0000 - 0x00007ff8e212d000     C:\WINDOWS\SYSTEM32\pdh.dll
0x00007ff8de6c0000 - 0x00007ff8de6cf000     C:\WINDOWS\System32\perfproc.dll
0x00007ff8d7db0000 - 0x00007ff8d7dbe000     C:\WINDOWS\System32\perfos.dll
0x00007ff8e1f30000 - 0x00007ff8e20d8000     C:\WINDOWS\SYSTEM32\WindowsCodecs.dll
0x00007ff8d2800000 - 0x00007ff8d2849000     C:\WINDOWS\system32\dataexchange.dll
0x00007ff8e0ed0000 - 0x00007ff8e1186000     C:\WINDOWS\system32\d3d11.dll
0x00007ff8e33b0000 - 0x00007ff8e3501000     C:\WINDOWS\system32\dcomp.dll
0x00007ff8e43c0000 - 0x00007ff8e445f000     C:\WINDOWS\system32\dxgi.dll
0x000000006be40000 - 0x000000006befa000     C:\Users\Admin\AppData\Local\Temp\sqlite-3.8.7-34d9c8d9-7e02-422d-87c3-e225d248277c-sqlitejdbc.dll
0x000000006ab00000 - 0x000000006ab2a000     C:\Program Files\Java\jdk1.8.0_111\jre\bin\dcpr.dll
0x00007ff8b84e0000 - 0x00007ff8b8582000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\avutil-55.dll
0x000000006fe00000 - 0x000000006fe81000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniavutil.dll
0x00007ff8d7410000 - 0x00007ff8d7437000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\swresample-2.dll
0x0000000070080000 - 0x00000000700ac000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniswresample.dll
0x00007ff8a7450000 - 0x00007ff8a9126000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\avcodec-57.dll
0x000000006a1c0000 - 0x000000006a257000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniavcodec.dll
0x00007ff8aa010000 - 0x00007ff8aa395000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\avformat-57.dll
0x00007ff8e1d60000 - 0x00007ff8e1d6c000     C:\WINDOWS\SYSTEM32\Secur32.dll
0x00007ff8e50a0000 - 0x00007ff8e50cc000     C:\WINDOWS\SYSTEM32\SSPICLI.DLL
0x0000000021a60000 - 0x0000000021aec000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniavformat.dll
0x00007ff8b8020000 - 0x00007ff8b80b3000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\swscale-4.dll
0x0000000067cc0000 - 0x0000000067cf1000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniswscale.dll
0x00007ff8d6b80000 - 0x00007ff8d6ba8000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\postproc-54.dll
0x000000006a0c0000 - 0x000000006a0ec000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jnipostproc.dll
0x00007ff8b3f90000 - 0x00007ff8b4175000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\avfilter-6.dll
0x0000000064400000 - 0x000000006444a000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniavfilter.dll
0x00007ff8d5830000 - 0x00007ff8d585c000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\avdevice-57.dll
0x0000000021af0000 - 0x0000000021b21000     C:\Users\Admin\.javacpp\cache\ffmpeg-3.1.2-1.2-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniavdevice.dll
0x00007ff8e1a20000 - 0x00007ff8e1bb2000     C:\WINDOWS\SYSTEM32\dbghelp.dll

VM Arguments:
jvm_args: -Djava.library.path=C:\Users\Admin\Desktop\video-viewer\native_lib\opencv\lib -Dfile.encoding=Cp1252 
java_command: com.msv.MainWindow
java_class_path (initial): C:\Users\Admin\Desktop\video-viewer\bin;C:\Users\Admin\Desktop\video-viewer\lib\jcodec-0.1.5.jar;C:\Users\Admin\Desktop\video-viewer\lib\jmu-0.0.3.jar;C:\Users\Admin\Desktop\video-viewer\lib\platform-3.5.2.jar;C:\Users\Admin\Desktop\video-viewer\lib\synthetica.jar;C:\Users\Admin\Desktop\video-viewer\lib\syntheticaBlackEye.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\poi-3.10.1-20140818.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\poi-excelant-3.10.1-20140818.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\poi-ooxml-3.10.1-20140818.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\poi-ooxml-schemas-3.10.1-20140818.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\poi-scratchpad-3.10.1-20140818.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\ooxml-lib\dom4j-1.6.1.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\ooxml-lib\stax-api-1.0.1.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\ooxml-lib\xmlbeans-2.6.0.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\lib\commons-logging-1.1.jar;C:\Users\Admin\Desktop\video-viewer\lib\poi-3.10.1\lib\junit-4.11.jar;C:\Users\Admin\Desktop\video-viewer\lib\antlr-2.7.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\antlr-runtime-3.3.jar;C:\Users\Admin\Desktop\video-viewer\lib\avalon-framework-api-4.3.1.jar;C:\Users\Admin\Desktop\video-viewer\lib\avalon-framework-impl-4.3.1.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-anim-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-awt-util-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-bridge-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-css-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-dom-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-ext-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-extension-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-gvt-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik-js-1.7.jar;C:\Users\Admin\Desktop\video-viewer\lib\batik
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:/Program Files/Java/jre1.8.0_111/bin/server;C:/Program Files/Java/jre1.8.0_111/bin;C:/Program Files/Java/jre1.8.0_111/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\EmEditor;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;;C:\WINDOWS\system32;
USERNAME=Admin
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel

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

OS: Windows 10.0 , 64 bit Build 14393 (10.0.14393.1198)

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

Memory: 4k page, physical 16776692k(11125636k free), swap 19267060k(12673904k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.111-b14) for windows-amd64 JRE (1.8.0_111-b14), built on Sep 22 2016 19:24:05 by "java_re" with MS VC++ 10.0 (VS2010)

time: Thu Jun 29 19:49:34 2017
elapsed time: 20 seconds (0d 0h 0m 20s)
saudet commented 7 years ago

Try this fix: https://github.com/bytedeco/javacv/commit/32fbadde6c56096580be3d4e7d171ac6c94995d7

MachineIntelligence6 commented 7 years ago

Thank you i have tried the fix, but still getting the same problem. before stopping the grabber, i get an exception in the catch block.

java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:275) at org.bytedeco.javacv.FFmpegFrameGrabber.processImage(FFmpegFrameGrabber.java:776) at org.bytedeco.javacv.FFmpegFrameGrabber.grabFrame(FFmpegFrameGrabber.java:945) at com.msv.util.FrameCreator.run(FrameCreator.java:90) at java.lang.Thread.run(Thread.java:745)

after that in the final block in my code , i stop the grabber, and app crashes. if i didn't get the above exception, then it works fine, with multi threaded code also.

saudet commented 7 years ago

Sounds like there is a race condition somewhere in your code then.

MachineIntelligence6 commented 7 years ago

I'm copying the sample of my code. Our goal is the app should not crash for any reason, it should catch the exception. Thank you for your support. 🥇

package com.video.util;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.bytedeco.javacpp.avutil;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.Java2DFrameConverter;

import com.video.MainWindow;
import com.video.controls.CheckVideoIntegrete;
import com.video.model.Video;
import com.video.util.VideoThumbnailsCreator.ThumbnailListener;

public class FrameCreator implements Runnable {
    private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(FrameCreator.class);
    private final Video input;
    private final ThumbnailListener listener;
    private final AtomicBoolean interrupted;
    private boolean grabSecondOnly=true;
    private long predefinedLen=0;
    boolean bySeconds;

    private FFmpegFrameGrabber grabber=null;
    private long gap;

    public FrameCreator(Video input, ThumbnailListener listener, MainWindow vcjMain, AtomicBoolean interrupted,boolean bySeconds) {
        this.input = input;
        this.listener = listener;
        this.interrupted = interrupted;
        this.bySeconds=bySeconds;
    }

    public void setLength(long length){
        predefinedLen = length;
    }

    @Override
    public void run() {
        avutil.av_log_set_level(avutil.AV_LOG_QUIET);
        grabber = new FFmpegFrameGrabber(input.getFile());
        grabber.setOption("max_nal_size", "1024");
        try {
            grabber.start();

           //if(!CheckVideoIntegrete.check(input))
                //throw new Exception("Video is Corrpt");

            long totalTime = grabber.getLengthInTime();
            listener.obtainVideoLength(this,formatFrameTime(totalTime / 1000));

            if(predefinedLen>0) totalTime=predefinedLen*1000;

            long totalSecond = totalTime / 1000000;

            long totalFrame;
            if(!bySeconds){
                totalFrame = (MainWindow.getSettings().getFrameNumber()+1);
                if (grabSecondOnly && totalFrame > totalSecond) {
                    totalFrame = (int) totalSecond;
                }
                gap = (totalTime / totalFrame);
                if (gap == 0) {
                    gap++;
                }
            } else {
                gap = (MainWindow.getSettings().getFrameNumber())*1000000;
                if(gap<=0) gap=1000000;
                totalFrame = totalTime / gap;
            }

            Java2DFrameConverter converter = new Java2DFrameConverter(); 
            long timestamp;
            long realtime;
            Frame frame=null;
            int countErrors=bySeconds?0:10;
            for (int i = 0; i < totalFrame || countErrors<10; i++) {
                if(interrupted.get()) {break;}
                timestamp=1+i*gap;
                if (!bySeconds && timestamp > totalTime) break;
                try {
                    grabber.setTimestamp(timestamp);
                    realtime = timestamp;
                    while(realtime<timestamp+gap){
                        frame = grabber.grabFrame(false,true,false,false);
                        frame = grabber.grabFrame(false,true,true,false);
                        realtime = grabber.getTimestamp();
                        if(frame==null || frame.image!=null) break;
                    }
                    if (frame != null && frame.image!=null && realtime!=0) {
                        listener.thumbnailCreated(this,null, realtime / 1000, i+1, 
                                deepCopy(converter.convert(frame)),(int)totalFrame);
                        listener.updateProgress(this,i+1, totalSecond,(int)totalFrame);
                    } else {
                        log.error("grab error at "+timestamp);
                        if(bySeconds && timestamp>totalTime) countErrors++;
                    }
                } catch (java.lang.Exception e) {
                    log.error("grab error at "+timestamp+ " "+e.getMessage());
                    log.trace("",e);
                    e.printStackTrace();
                }
            }
        } catch (Exception e) {
            listener.onUnsupportedVideo(this);
            log.error("Error load video grabber "+e.getMessage());
            log.trace("",e);
        } finally {
            if(grabber!=null) try {grabber.stop();} catch (Exception e) {e.printStackTrace();}
            grabber = null;
            listener.onFinish(this);
        }

    }

    private static String formatFrameTime(long totalTime) {
        return String.format(
                "%02d:%02d:%02d",
                TimeUnit.MILLISECONDS.toHours(totalTime),
                TimeUnit.MILLISECONDS.toMinutes(totalTime)
                        - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(totalTime)),
                TimeUnit.MILLISECONDS.toSeconds(totalTime)
                        - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(totalTime)));
    }

    public static BufferedImage deepCopy(BufferedImage o) {
        ColorModel cm = o.getColorModel();
        boolean isAlpha = o.isAlphaPremultiplied();
        WritableRaster r = o.copyData(null);
        return new BufferedImage(cm, r, isAlpha, null);
    }

    public boolean isGrabSecondOnly() {
        return grabSecondOnly;
    }

    public void setGrabSecondOnly(boolean grabSecondOnly) {
        this.grabSecondOnly = grabSecondOnly;
    }

}

`

saudet commented 7 years ago

So, the same grabber never gets used by more than one thread?

MachineIntelligence6 commented 7 years ago

Yes, that's why we have to stop the grabber, when the thread is finish. in the final block.

saudet commented 7 years ago

Does it also happen with only one thread?

MachineIntelligence6 commented 7 years ago

yes currently the video crash with only one thread. We know the video is corrupt. Im testing the code with only one video. and it crash.

saudet commented 7 years ago

Oh, then it's a bug in FFmpeg probably. Try FFmpeg 3.3.2 see if it's fixed.

MachineIntelligence6 commented 7 years ago

let me check it, i will get back shortly, after testing it with 3.3.2

MachineIntelligence6 commented 7 years ago

I have downloaded the javacpp-presets-platform-1.3-bin.zip (516 MB) ans use the ffmpeg from it, here is the link from which i download https://github.com/bytedeco/javacpp-presets. or i have to build the src from this link https://github.com/bytedeco/javacpp-presets/tree/master/ffmpeg? I use the javacpp-presets and replace the jars with them, but still getting the same crash. I really appreciated your support. Thanks once again.

saudet commented 7 years ago

Try the SNAPSHOT version: https://github.com/bytedeco/javacpp-presets/tree/master/ffmpeg#the-pomxml-build-file

saudet commented 7 years ago

If you prefer to replace the JAR files manually, we can download them from the browser here: https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/ffmpeg/3.3.2-1.3.3-SNAPSHOT/

saudet commented 7 years ago

In the end, were you able to reproduce this issue with FFmpeg 3.3.2?

MachineIntelligence6 commented 7 years ago

Yes, In my testing I found out the problem in grabber.setTimestamp(timestamp);

setTimestamp() method in your code has two while loops inside it, I was seeking frame by mouse movements, I check when I move forward and then seek frame backward, it remain in the while and never get out for some corrupt videos and hangs my app.

I remove the code for while loop in setTimestamp() method, and it start working, but then I found out that for some videos the frame I was grabbing was for wrong timestamp.

so again I uncomment the code for while loop and but put a fix for it that it remain in the loop for not more then 10 times.

saudet commented 7 years ago

Sounds good, could you send a pull request? And maybe we can even make the limit 100 or 1000? Thanks for the feedback!