Skip to content
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

V1.5.6 FFmpegFrameGrabber could not grab frames: avcodec_send_packet() error -1094995529 #1679

Closed
luunn54 opened this issue Aug 4, 2021 · 7 comments
Labels

Comments

@luunn54
Copy link

luunn54 commented Aug 4, 2021

Thanks you for your working hard to release v1.5.6. I tested and found an issue:

Ver 1.5.6 (release version)

Issue: FFmpegFrameGrabber.grab could not grab frames
Test code:

        try {
            FFmpegLogCallback.set();

            FFmpegFrameGrabber g = new FFmpegFrameGrabber("t.mpg");
            g.start();

            int count_frame = 0;
            while (true) {
                Frame frame = g.grab();
                if (frame == null) {
                    break;
                }

                count_frame++;
            }

            g.stop();
            System.out.println("Number of frames: " + count_frame);
        } catch (FFmpegFrameGrabber.Exception e) {
            e.printStackTrace();
        }

Output:

Error: [mp3float @ 0x7fe47316aa00] Header missing

Warning: [mpegts @ 0x7fe471a4d400] DTS 9000 < 12600 out of order

Info: Input #0, mpegts, from 't.mpg':

Info:   Duration: 
Info: 00:00:14.05
Info: , start: 
Info: 0.086122
Info: , bitrate: 
Info: 768 kb/s
Info: 

Info:   Program 1 

Info:   Stream #0:0
Info: [0x12d]
Info: : Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bottom first), 352x288 [SAR 12:11 DAR 4:3]
Info: , 
Info: 25 fps, 
Info: 25 tbr, 
Info: 90k tbn, 
Info: 50 tbc
Info: 

Info:     Side data:

Info:       
Info: cpb: 
Info: bitrate max/min/avg: 500000/0/0 buffer size: 147456 
Info: vbv_delay: N/A
Info: 

Info:   Stream #0:1
Info: [0x12e]
Info: : Audio: mp3 ([3][0][0][0] / 0x0003), 44100 Hz, mono, fltp, 128 kb/s
Info: 

Error: [mp3float @ 0x7fe470204200] Header missing

org.bytedeco.javacv.FFmpegFrameGrabber$Exception: avcodec_send_packet() error -1094995529: Error sending an audio packet for decoding. (For more details, make sure FFmpegLogCallback.set() has been called.)
	at org.bytedeco.javacv.FFmpegFrameGrabber.grabFrame(FFmpegFrameGrabber.java:1414)
	at org.bytedeco.javacv.FFmpegFrameGrabber.grab(FFmpegFrameGrabber.java:1280)
	at abc.Test.main(Test.java:23)
Disconnected from the target VM, address: '127.0.0.1:60978', transport: 'socket'

Process finished with exit code 0

OS: Mac and Centos

Test video:
t.mpg.zip

@saudet
Copy link
Member

saudet commented Aug 4, 2021

Does it work "correctly" if you ignore that error and just keep grabbing?

@luunn54
Copy link
Author

luunn54 commented Aug 4, 2021

yes, it works if I ignore that error.
I report this issue because I though you fixed it in #1673 (comment)

@saudet
Copy link
Member

saudet commented Aug 5, 2021

I "fixed" it for video codecs because I didn't have any failing examples for audio codecs, but it looks like we'll need to do the same for audio codecs, yes.

@luunn54
Copy link
Author

luunn54 commented Aug 5, 2021

👍 thank you

Do you plan to fix it soon? or we have to wait util the next release?

saudet added a commit that referenced this issue Aug 5, 2021
@saudet saudet added the bug label Aug 5, 2021
@saudet
Copy link
Member

saudet commented Aug 5, 2021

Already done in commit f145bf7.

@luunn54
Copy link
Author

luunn54 commented Aug 5, 2021

👍
the issue was fixed in the snapshot build: 1.5.7-20210805.084510-7. Thanks for your support

@saudet
Copy link
Member

saudet commented Feb 10, 2022

The fixes for these regressions have been released with JavaCV 1.5.7. Please let me know if you're still having issues with this though, and thanks to you for helping out! It's very much appreciated.

@saudet saudet closed this as completed Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants