AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.87k stars 316 forks source link

Undefined error=streams: codecs not matched: H264, PCMA => JPEG #885

Open WebDev-Den opened 6 months ago

WebDev-Den commented 6 months ago

Hello everyone. I ran into a problem when receiving an MJPEG source stream. I use a TP-LINK Tapo C110 camera with the following configuration:

api:
  origin: "*"
log:
  level: error 
streams:
  web3D: 
   - rtsp://login:password@192.168.1.65:554/stream1
   - onvif://login:password@192.168.1.65:2020?subtype=profile_1 

I'm trying to get a stream:

http://192.168.1.40:1984/api/stream.mjpeg?src=web3D

As a result, I get an error in the logs: undefined error=streams: codecs not matched: H264, PCMA => JPEG caller=github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166

I tried to install all possible codecs, but the problem persisted.

poucz commented 4 months ago

Same behaviour, any solution?

Using go2rtc version 1.8.5 linux/amd64 in docker

AlexxIT commented 4 months ago

You can't get JPEG codec from H264 (as error said: codecs not matched: H264, PCMA => JPEG). You should use transcoding.

poucz commented 4 months ago

Thank you very much, but how? Can you show me example?

I was try:

camera1:
    - rtsp://192.168.3.25:554/11
    - "ffmpeg:http://127.0.0.1:1984/api/stream.mjpeg?src=camera1#-c:v mjpeg"

without success

AlexxIT commented 4 months ago

https://github.com/AlexxIT/go2rtc#source-ffmpeg