javacv icon indicating copy to clipboard operation
javacv copied to clipboard

avcodec_find_decoder() error: Unsupported audio format or codec not found: 0.

Open IT-LiuGuang opened this issue 2 years ago • 12 comments

How to solve this problem

IT-LiuGuang avatar Oct 14 '21 07:10 IT-LiuGuang

It looks like you're trying to open AV_CODEC_ID_NONE, which doesn't exist. You'll need to pick another from this list: https://github.com/bytedeco/javacpp-presets/blob/master/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avcodec.java#L67

saudet avatar Oct 14 '21 07:10 saudet

This error occurred when capturing a video file without audio

IT-LiuGuang avatar Oct 14 '21 08:10 IT-LiuGuang

That looks like a corrupted file. What happens if you try to use it with the ffmpeg or ffplay program?

saudet avatar Oct 14 '21 08:10 saudet

The file is normal, a camera that does not support audio, the saved video can generate this kind of file

IT-LiuGuang avatar Oct 14 '21 08:10 IT-LiuGuang

Ok, but if the ffmpeg program cannot process that file either, please report this bug upstream: http://ffmpeg.org/bugreports.html

saudet avatar Oct 14 '21 08:10 saudet

Thank you very much for your answer

IT-LiuGuang avatar Oct 14 '21 08:10 IT-LiuGuang

If it works fine with the ffmpeg program though, it means this is an issue with JavaCV, so please try it with the ffmpeg program and let me know! Thanks

saudet avatar Oct 14 '21 08:10 saudet

Use the ffmpeg command to push the stream, and then use VLC to play with no problem

IT-LiuGuang avatar Oct 15 '21 04:10 IT-LiuGuang

See the method you proposed in #1184 , add grabber.setAudioStream(Integer.MAX_VALUE)

IT-LiuGuang avatar Oct 15 '21 04:10 IT-LiuGuang

No errors were reported after joining, and the program runs normally

IT-LiuGuang avatar Oct 15 '21 04:10 IT-LiuGuang

Ok, could you attach here a sample video file that fails like this?

saudet avatar Oct 15 '21 04:10 saudet

Sorry, I can’t provide it, I am using a camera RTSP, I don’t have a video source

IT-LiuGuang avatar Oct 15 '21 04:10 IT-LiuGuang