-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
av_interleaved_write_frame() error -22 while writing interleaved video frame #40
Comments
Just posting comments from https://code.google.com/p/javacv/issues: Project Member #1 samuel.a...@gmail.com And please report any additional issues here if possible: Thank you |
Hi Samuel, Thanks for your response, but using JavaCV 0.9 causes me this exception: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "av_input_audio_device_next" referenced by "libjniavdevice.so"... After some searching, I ran into this question on Stackoverflow: Therefore, I used 0.9.1 version from this link: But the original problem still reproduces, Do you know how can I solve it? Here an updated stacktraces (both existed on the 0.8 version too): av_interleaved_write_frame() error -22 while writing interleaved video frame. av_interleaved_write_frame() error -22 while writing interleaved video frame. Thanks |
It sounds like a permission issue.. Could you try to write to the same file, but using some Android API instead? I would like to know if that works or not, thanks. |
Hi, I don't believe its a permission issue, since it is writing the file, but with missing frames (due to the exception). Moreover, the previous version of the app is using MediaRecorder to create the same file with no problems. Shuky. |
Does the |
It looks like it might have something to do with the timestamp: |
Great I will try, thanks |
Hi, I added these lines: if (timestamp > mFrameRecorder.getTimestamp()) { and the error stopped, However I'm curious how come the timestamp of the FFmpegFrameRecording is higher than my timestamp. Do you know what causes this weird behavior? |
Might be because you set the frame rate too low. |
What steps will reproduce the problem?
What is the expected output?
All frame to be recorded
What do you see instead?
Every few frames I get this exception:
org.bytedeco.javacv.FrameRecorder$Exception: av_interleaved_write_frame() error -22 while writing interleaved video frame.
at org.bytedeco.javacv.FFmpegFrameRecorder.record(FFmpegFrameRecorder.java:720)
at org.bytedeco.javacv.FFmpegFrameRecorder.record(FFmpegFrameRecorder.java:624)
at org.bytedeco.javacv.FrameRecorder.record(FrameRecorder.java:290)
What version of the product are you using? On what operating system?
Android 4.4.4, Nexus 5, JavaCV 0.8
Please provide any additional information below.
Hi,
I am initializing FFmpegFrameGrabber to read from a video file, recorded in the past using FFmpegFrameRecorder,
and I want to send this video to an rtmp server using FFmpegFrameRecorder.
So far, I was able to do it, however I do have one problem, not all of the frames are delivered
from the file to the server, one in a few frames cause the FFmpegFrameRecorder to throw the exception mentioned above.
FYI, I am rotating the video since android preview frame is 90 degrees rotated, using the method below.
// Reader initilization part:
FFmpegFrameGrabber mGrabber = new FFmpegFrameGrabber("path-to-file recorded from camera using FFMpegFrameRecorder in the past");
mGrabber.start();
// Writer initilization part:
FFmpegFrameRecorder mFrameRecorder = new FFmpegFrameRecorder("/sdcard/Movies/Camra/final.flv", height, width, 1);
mFrameRecorder.setFormat("flv");
mFrameRecorder.setSampleRate(videoProfile.audioSampleRate);
mFrameRecorder.setFrameRate(videoProfile.frameRate);
mFrameRecorder.setVideoBitrate(videoProfile.bitRate);
mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
mFrameRecorder.setVideoOption("preset", "ultrafast");
mFrameRecorder.start();
// Actual reading-writing:
Frame frame;
while ((frame = getFrame()) != null) {
mFrameRecorder.setTimestamp(timestamp);
}
// Rotate function:
private opencv_core.IplImage rotateImage(opencv_core.IplImage frame) {
if (mRotation != 0) {
opencv_core.IplImage destination;
if (mRotation != 180) {
if (mRotatedImage == null) {
mRotatedImage = opencv_core.cvCreateImage(opencv_core.cvSize(frame.height(), frame.width()), frame.depth(), frame.nChannels());
}
}
return frame;
}
The text was updated successfully, but these errors were encountered: