hamoid / video_export_processing

Processing library that interfaces with ffmpeg to export video files
http://funprogramming.org/VideoExport-for-Processing/
GNU General Public License v2.0
116 stars 19 forks source link

ArrayIndexOutOfBoundsException 30000 #4

Closed alpacaaa closed 9 years ago

alpacaaa commented 9 years ago

Hey man, great library!

I'm using it on OSX, I can run the examples fine but unfortunately I get the exception ArrayIndexOutOfBoundsException 30000 in another project of mine. I'm not too familiar with java and processing, so I don't know how to debug this, do you have any hint?

It creates an .mp4 file but it's empty and the whole sketch just crashes. This is a dump of the .txt file created by the library:

ffmpeg version 2.6 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6_1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, bitrate: 90000 kb/s
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 500x250, 90000 kb/s, 30 tbr, 30 tbn, 30 tbc
[libx264 @ 0x7fb1f9825a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fb1f9825a00] profile High, level 2.1
[libx264 @ 0x7fb1f9825a00] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=15.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Users/marco/test/basic.mp4':
  Metadata:
    comment         : Exported using VideoExport for Processing - https://github.com/hamoid/VideoExport-for-Processing
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 500x250, q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.26.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Thank you!

hamoid commented 9 years ago

Thanks! Can you send me a minimum example that suffers from this issue? I need to be able to reproduce the issue to be able to fix it. And as the examples work, maybe it's something that is happening only in your program? Cheers!

alpacaaa commented 9 years ago

Found the issue! I was instantiating the VideoExport object before calling size() so the pixelsByte array was empty. You might want to add this to the docs ;)

Anyway, very helpful and well done library, thanks again!

hamoid commented 9 years ago

Great that you found it! I'll add that to the docs :)

On 07/13/2015 10:17 AM, Marco Sampellegrini wrote:

Closed #4 https://github.com/hamoid/video_export_processing/issues/4.

— Reply to this email directly or view it on GitHub https://github.com/hamoid/video_export_processing/issues/4#event-354101720.

hamoid commented 9 years ago

Better, I will check for this situation in the source code, so you get a message saying that you should call size() first.

alpacaaa commented 9 years ago

That sounds great :)