-
Notifications
You must be signed in to change notification settings - Fork 552
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
MJPEG source -> MJPEG output quality degradation #559
Comments
I have no difference in similar test for my Dahua camera. |
@AlexxIT I suggest adding |
[root@localhost ffmpeg]# ./ffmpeg -f v4l2 -video_size 1920x1080 -i /dev/video0 -c:v mjpeg -an -f mjpeg out.mp4
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 48535.066005, bitrate: 331776 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 331776 kb/s, 10 fps, 10 tbr, 1000k tbn ↑ Before (Go2RTC default parameters without -hide_banner -v error) [root@localhost ffmpeg]# ./ffmpeg -f v4l2 -input_format mjpeg -video_size 1920x1080 -i /dev/video0 -c:v mjpeg -an -f mjpeg out.mp4
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 48573.005768, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 50 fps, 50 tbr, 1000k tbn |
@TsLenMo go2rtc not using ffmpeg for transfer rtsp mjpeg to http mjpeg |
this is the config file. |
Because my device provides two streams, one is YUY2 and the other is MJPEG. I observed that ffmpeg uses YUY2 by default. |
I think I understand more about how go2rtc works :) |
OK, Sorry. |
@TsLenMo your config wrong. If your USB camera supports MJPEG, of course you should use input mjpeg. Check WebUI |
Thanks. |
Please let me know if the problem is relevant |
I have the exact same issue, with the exact same type of degradation in the image - I also have a hikvision camera, so probably something weird with their mjpeg streams over rtsp? I will open the rtsp feed from the camera so you can check it yourself as requested, I will message you the link. |
@mvdarend - After giving @AlexxIT access to my hikvision stream, he confirmed hikvision has a weird non-standard mjpeg stream implementation, and quickly implemented a fix for handling it - now my streams look identical. The change is in the master branch, you can get a binary of it here - https://nightly.link/AlexxIT/go2rtc/workflows/build/master |
Hi there,
Hopefully someone can help with a problem I'm having with 're-streaming' an MJPEG stream, when I do this the quality of the new stream is much worse than the original. I'm probably missing a setting somewhere but my searches haven't resulted in a solution so far. One of the software packeges we're using at the moment can only process MJPEG streams, so we're stuck with that for them time being.
The source is a sub-stream from a Hikvision camera:
When streaming this original as an RTSP stream in VLC it looks like this:
When streaming through Go2Rtc it ends up looking like this:
Here is the relevant part of the config, ffmpeg settings have been left default:
I've tried playing around with all sorts of settings to no avail, anyone have an idea of what it could be?
If I set the stream from the camera to H.264 instead of MJPEG it is much better but once I try transcoding that stream to MJPEG the quality drops again to a similar level as above.
Relevant info
Edit: Spelling mistakes and better screnshot of Go2Rtc stream showing address bar.
The text was updated successfully, but these errors were encountered: