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

grabber.start()出现问题 #2299

Open
youzipipi opened this issue Nov 20, 2024 · 4 comments
Open

grabber.start()出现问题 #2299

youzipipi opened this issue Nov 20, 2024 · 4 comments

Comments

@youzipipi
Copy link

[rtsp @ 0x7fbbc024a480] Could not find codec parameters for stream 1 (Audio: none, 16000 Hz, mono): unknown codec
Consider increasing the value for the 'analyzeduration' (10000) and 'probesize' (10000000) options
Input #0, rtsp, from 'rtsp://admin:[email protected]:554/Streaming/tracks/401?starttime=20241119t154020&endtime=20241119t154025z':
Metadata:
title : HIK Media Server V4.73.300
comment : HIK Media Server Session Description : standard
Duration: -3767106:-29:-10.-32, start: 0.041000, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 1920x1080, 24.92 tbr, 90k tbn
Stream #0:1: Audio: none, 16000 Hz, mono
org.bytedeco.javacv.FFmpegFrameGrabber$Exception: avcodec_find_decoder() error: Unsupported audio format or codec not found: 0. (For more details, make sure FFmpegLogCallback.set() has been called.)

@saudet
Copy link
Member

saudet commented Nov 20, 2024

What do you get if you call the ffprobe program on that URL?

@youzipipi
Copy link
Author

如果您在该 URL 上调用 ffprobe 程序,您会得到什么?

I've gone through it again. The problem I encountered is that the audio encoding cannot be recognized. But strangely, I've already closed the audio channel:grabber.setAudioChannels(0);

The following is the output of ffprobe with some sensitive information replaced:
[root@localhost order]# ffprobe rtsp://admin:[email protected]:554/Streaming/tracks/401?starttime=20241119t154020&endtime=20241119t154025z
[1] 1751742
[root@localhost order]# ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --prefix=/usr/local/ffmpeg
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
[rtsp @ 0x358fcc0] RTP: dropping old packet received too late
Last message repeated 134 times
[rtsp @ 0x358fcc0] Could not find codec parameters for stream 1 (Audio: none, 16000 Hz, mono): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, rtsp, from 'rtsp://admin:[email protected]:554/Streaming/tracks/401?starttime=20241119t154020':
Metadata:
title : HIK Media Server V4.73.300
comment : HIK Media Server Session Description : standard
Duration: -3767106:-29:-10.-32, start: 0.040000, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 1920x1080, 24.92 tbr, 90k tbn
Stream #0:1: Audio: none, 16000 Hz, mono
Unsupported codec with id 0 for input stream 1

[1]+ 已完成 ffprobe rtsp://admin:[email protected]:554/Streaming/tracks/401?starttime=20241119t154020

The following is the output of the conversion in Java code:
[rtsp @ 0x7f8fd4001340] Could not find codec parameters for stream 1 (Audio: none, 16000 Hz, mono): unknown codec
Consider increasing the value for the 'analyzeduration' (200000) and 'probesize' (20000000) options
Input #0, rtsp, from 'rtsp://admin:[email protected]:554/Streaming/tracks/401?starttime=20241119t154020&endtime=20241119t154025z':
Metadata:
title : HIK Media Server V4.73.300
comment : HIK Media Server Session Description : standard
Duration: -3767106:-29:-10.-32, start: 0.041000, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 1920x1080, 24.92 tbr, 90k tbn
Stream #0:1: Audio: none, 16000 Hz, mono
Output #0, flv, to 'rtmp://172.16.xx.xxx:1945/live/nud':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: hevc (Main) ([12][0][0][0] / 0x000C), yuvj420p(pc, bt709), 1920x1080, q=2-31, 24.92 fps, 1k tbn
[flv @ 0x7f8fd47cee40] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly

@saudet
Copy link
Member

saudet commented Nov 23, 2024

I see. I guess we should skip over streams that have no codecs. This should be fixed with commit 295e89f.
Please give it a try with the snapshots: http://bytedeco.org/builds/

@youzipipi
Copy link
Author

295e89f.

Thank you. Currently, I have changed the encoding used for storage and it has been resolved normally I will try 295e89f again later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants