You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same problem merge two mp4 videos, two videos have the same rate
below my code:
FFmpegFrameGrabber grabber1 = new FFmpegFrameGrabber(videoPath+"1.mp4");
FFmpegFrameGrabber grabber2 = new FFmpegFrameGrabber(videoPath+"2.mp4");
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(videoOutputPath + "output.mp4",1280,720, 2);
grabber1.start();
grabber2.start();
recorder.start(grabber1.getFormatContext());
AVPacket packet1, packet2;
while ((packet1 = grabber1.grabPacket()) != null) {
recorder.recordPacket(packet1);
}
while ((packet2 = grabber2.grabPacket()) != null) {
recorder.recordPacket(packet2);
}
recorder.stop();
grabber1.stop();
grabber2.stop();
and the error:
Exception in thread "main" org.bytedeco.javacv.FrameRecorder$Exception: av_interleaved_write_frame() error -22 while writing interleaved video packet.
at org.bytedeco.javacv.FFmpegFrameRecorder.writePacket(FFmpegFrameRecorder.java:1222)
at org.bytedeco.javacv.FFmpegFrameRecorder.recordPacket(FFmpegFrameRecorder.java:1255)
at javacvdemo.VideoProcessing.packetRecord(VideoProcessing.java:177)
at javacvdemo.Application.main(Application.java:20)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\work\javacvdemo\1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:03.86, start: 0.000000, bitrate: 701 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 665 kb/s, 26 fps, 26 tbr, 13312 tbn, 52 tbc (default)
Metadata:
handler_name : 片头.mp4.vc.264#video - Imported with GPAC 0.5.1-DEV-rev4102M
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\work\javacvdemo\2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:09.66, start: 0.000000, bitrate: 989 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 946 kb/s, 26 fps, 26 tbr, 13312 tbn, 52 tbc (default)
Metadata:
handler_name : 正前 Comp 1.mp4.vc.264#video - Imported with GPAC 0.5.1-DEV-rev4102M
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s (default)
Metadata:
handler_name : SoundHandler
[mp4 @ 00000000205a7bc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[mp4 @ 00000000205a7bc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mp4, to 'F:\work\javacvdemo\output.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 665 kb/s, 26 fps, 13312 tbn, 26 tbc
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s
[mp4 @ 00000000205a7bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49152 >= -1024
The text was updated successfully, but these errors were encountered:
I have the same problem merge two mp4 videos, two videos have the same rate
below my code:
FFmpegFrameGrabber grabber1 = new FFmpegFrameGrabber(videoPath+"1.mp4");
FFmpegFrameGrabber grabber2 = new FFmpegFrameGrabber(videoPath+"2.mp4");
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(videoOutputPath + "output.mp4",1280,720, 2);
grabber1.start();
grabber2.start();
recorder.start(grabber1.getFormatContext());
AVPacket packet1, packet2;
while ((packet1 = grabber1.grabPacket()) != null) {
recorder.recordPacket(packet1);
}
while ((packet2 = grabber2.grabPacket()) != null) {
recorder.recordPacket(packet2);
}
recorder.stop();
grabber1.stop();
grabber2.stop();
and the error:
Exception in thread "main" org.bytedeco.javacv.FrameRecorder$Exception: av_interleaved_write_frame() error -22 while writing interleaved video packet.
at org.bytedeco.javacv.FFmpegFrameRecorder.writePacket(FFmpegFrameRecorder.java:1222)
at org.bytedeco.javacv.FFmpegFrameRecorder.recordPacket(FFmpegFrameRecorder.java:1255)
at javacvdemo.VideoProcessing.packetRecord(VideoProcessing.java:177)
at javacvdemo.Application.main(Application.java:20)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\work\javacvdemo\1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:03.86, start: 0.000000, bitrate: 701 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 665 kb/s, 26 fps, 26 tbr, 13312 tbn, 52 tbc (default)
Metadata:
handler_name : 片头.mp4.vc.264#video - Imported with GPAC 0.5.1-DEV-rev4102M
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\work\javacvdemo\2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:09.66, start: 0.000000, bitrate: 989 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 946 kb/s, 26 fps, 26 tbr, 13312 tbn, 52 tbc (default)
Metadata:
handler_name : 正前 Comp 1.mp4.vc.264#video - Imported with GPAC 0.5.1-DEV-rev4102M
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s (default)
Metadata:
handler_name : SoundHandler
[mp4 @ 00000000205a7bc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[mp4 @ 00000000205a7bc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mp4, to 'F:\work\javacvdemo\output.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 665 kb/s, 26 fps, 13312 tbn, 26 tbc
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 37 kb/s
[mp4 @ 00000000205a7bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49152 >= -1024
The text was updated successfully, but these errors were encountered: