Streamedian / html5_rtsp_player

Play RTSP stream from IP camera in browser in this HTML5 player without plugins
Apache License 2.0
2.61k stars 598 forks source link

rtsp_player_audio.js:41 [mse] Error occured: PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding #102

Closed salim-hbk closed 5 years ago

salim-hbk commented 6 years ago

Hi, Streamedian Thanks for making this project open source. I'm getting below error on Chrome browser on version above 63.

rtsp_player_audio.js:41 [mse] Error occured: PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding: timestamp=103936000 duration=64000 size=144 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (us)=(0, 0)

If I doesn't handle the Audio, then MSE doesn't throw the exception. Quite interestingly this kind of bug also being raised by some other people on HLS player (https://github.com/video-dev/hls.js/pull/1867)

I've customised the code to fit my use-case as I'm getting multiple rtp data in every packet accordingly changed the code to fit.

It quite frequently also prints below lines to console [remuxer:h264] invalid AVC sample duration at PTS/DTS: 3142926/3142926|lastDTS: 3145380:-2454.

Could you please suggest me how to handle this situation. below I've attached the file containing the video data.

dataNew (2).txt

salim-hbk commented 6 years ago

Hi is there any update on above question

victorgrenke commented 6 years ago

try to use the version 1.8.2 https://streamedian.com/cabinet/downloads/player/

salim-hbk commented 6 years ago

Thank you, I will test and get back to you in a day

salim-hbk commented 6 years ago

Hi: Victor G I've tested the build version 1.8.2. I'm getting the same behaviour from the player but this time it is not throwing [mse] Error occured: PIPELINE_ERROR_DECODE. It all together halts video play back(A kind of Crash behaviour). If you could possibly guide me what is going wrong I can try to fix it. I can provide you additional information if you want.

victorgrenke commented 6 years ago

what's audio format in your stream?

salim-hbk commented 6 years ago

Hi: Victor Audio format you have requested is AAC. below is the DESCRIBE response of audio part. Let me know if you need some more info.

m=audio 0 RTP/AVP 98 a=rtpmap:98 mpeg4-generic/16000/1 a=fmtp:98 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1408; SizeLength=13;IndexLength=3; IndexDeltaLength=3; Profile=1;

Log from the player

[remuxer:base] Initial pts=108477 dts=108477 offset=0 [remuxer:base] Initial pts=0 dts=0 offset=0 [mse] Use codec: video/mp4; codecs="avc1.640028" [mse] Use codec: audio/mp4; codecs="mp4a.40.2" [remuxer:h264] invalid AVC sample duration at PTS/DTS: 186831/186831|lastDTS: 189345:-2514 [remuxer:h264] invalid AVC sample duration at PTS/DTS: 198882/198882|lastDTS: 201396:-2514

victorgrenke commented 6 years ago

a=rtpmap:98 mpeg4-generic/16000/1 - it's MPEG-4 Elementary Streams, should be H264/90000

salim-hbk commented 6 years ago

Hi: Victor Thanks a lot for your reply could you please put some more light on above issue you have mentioned. I really appreciate your response. If I have to resolve this issue what steps I need to do.

Is it not a valid case, that camera can sample it for 16K for Audio.

salim-hbk commented 6 years ago

Is it possible change anything at client side to support sampling of 16K audio. As I have read online for human speech sampling rate of 16K is sufficient.

salim-hbk commented 5 years ago

Hi, I have resolved this issue, Player is working all good, you can close this ticket. Thank you again for this open source project.