bytedeco/javacv

Could not grab frame from http mp4 url InputStream

Open

#714 opened on Jun 7, 2017

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
bughelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Code:

url = new URL("http://dev.exiv2.org/attachments/372/3D_L0064.MP4");
//
              urlConnection = (HttpURLConnection) url.openConnection();
              InputStream inputStream = urlConnection.getInputStream();

              FFmpegFrameGrabber grabber= new FFmpegFrameGrabber(inputStream);
              grabber.setFormat("mp4");
              grabber.start();
              grabber.setFrameNumber(100000);

              Frame frame = grabber.grab();

              frameBitmap = new AndroidFrameConverter().convert(frame);

              grabber.stop();

Error:

/data/app/com.citrusbits.javacvapp-2/lib/arm/libjniavdevice.so: unused DT entry: type 0xf arg 0x47e3
06-07 17:39:39.987 5473-5527/com.citrusbits.javacvapp V/RenderScript: 0xb3704000 Launching thread(s), CPUs 4
06-07 17:39:40.003 5473-5526/com.citrusbits.javacvapp W/System.err: org.bytedeco.javacv.FrameGrabber$Exception: Error on InputStream.close(): 
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err:     at org.bytedeco.javacv.FFmpegFrameGrabber.releaseUnsafe(FFmpegFrameGrabber.java:206)
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err:     at org.bytedeco.javacv.FFmpegFrameGrabber.release(FFmpegFrameGrabber.java:133)
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err:     at com.citrusbits.javacvapp.MainActivity$SavingThread.run(MainActivity.java:97)
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err: Caused by: java.io.IOException: Mark has been invalidated.
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err:     at java.io.BufferedInputStream.reset(BufferedInputStream.java:336)
06-07 17:39:40.004 5473-5526/com.citrusbits.javacvapp W/System.err:     at org.bytedeco.javacv.FFmpegFrameGrabber.releaseUnsafe(FFmpegFrameGrabber.java:203)

Contributor guide