distortion in video (ffmpeg, vlc and iSPY)

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
Hi

I'm using few IP cameras with below configuration:

- 3xFullHD cameras from China - capturing with ffmpeg on Linux computer
- 1x1.3MP camera Icybox CAM2002 - capturing with VLC on Linux

all cameras are also connected to the second computer with iSPY - which is detecting motion only.

I replaced all cables, bought Gig-LAN router, but I still have distortions

it looks like a "shadow" when for example someone is walking, like the frames before the person are freezing.
I thought this is a network problem - but replaced everything - no difference, no packet loss, no dropped packets etc, logs are clear.

Problem is for all different kind cameras
and I see this on 2 separate computers and for 3 different capture method.

any idea what can I check?

btw do you know where can I find latest firmware for camera:

looks like this:

6993abfe63003077b6d0f9bc42cbfc12.jpg

Device Type: C6F0SgZ3N0P0L0
Software Version: V6.1.10.2.1-20151201

Thanks
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
reduce Noise Reduction levels in Video Processing if possible

try forcing tcp streams instead of UDP, if you dropping UDP packets it gets ugly.. I believe both ffmpeg and vlc default to UDP and you'll need to tune the default receive buffers to get HD video to go smooth.
 

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
Ok, so now I have:

Maximum frame rate: 25
Key frame interval: 25 (it was 50)

I will check tomorrow if it is better or not, if it doesn't help I will try with TCP instead of UDP.

Thank you
 

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
I tested Key frame interval: 25 (default was 50) but it didn't help.

I set 2 for now, tomorrow I will make next test.
This is value is seconds right?

and "Maximum frame rate" is 25, but in movie properties I see 12,5 fps.

Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,038
Location
USA
Your key-frame interval is in frames, not seconds. It usually is frames, but when the default is 50, it definitely is in frames. Usually, security camera streams have an iframe interval between 1 and 4 seconds (between 1 and 4 times the frame rate).

So if you set it to 2, then every other frame will be an iframe and the compression will be pretty bad.
 

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
ok, understand. First I will see if with 2 is ok, if yes, then I will increase this value to get good picture and quite-good compression.
But of course, video without distortion is the priority.

Thanks.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
have you tried: -rtsp_transport tcp ​on your ffmpeg command yet?
 

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
Hi

No, I didn't try TCP yet, this is because I have this problem also in iSPY so I prefer to fix it first from the camera side.
ok, today when the value is 2, I see that file is about 5-6 times bigger so I hope quality is much much better.
I will let you know.
 

tomasz320

n3wb
Joined
Oct 12, 2016
Messages
6
Reaction score
0
I just checked and I have already -rtsp_transport tcp for ffmpeg.

Today I played with the Key frame interval, for sure is much much better now, not perfect yet but better.

What else can I check? below is the screen from my camera settings:

settings.png
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,038
Location
USA
I suggest you try a lower frame rate (less work for the camera to do) of around 15 FPS. And also CBR (constant bit rate) encoding may be more reliable as it is conceptually simpler than VBR (variable bit rate). Harder for them to screw up CBR. However if it is anything like my old chinese cameras, the only thing that really matters is that iframe interval.

Oh and also, some cameras have an interface option for using TCP or UDP as the transport layer for RTSP streaming. If you have not already you should hunt for that option. I've heard of chinese cameras having buggy TCP implementations before, such that someone actually patched a firmware image to fix the bug (that is way above my pay grade haha).
 
Joined
Nov 8, 2016
Messages
1
Reaction score
0
Hi

This is tomasz320, I forgot my password so I have to create new account.
Of course your suggestions about Key frame interval were very useful and with that I have now my video more "smooter".

but I resolved finaly the problem with -rtsp_transport tcp for ffmpeg but
it must be right after "ffmpeg" command, if it is later, after for example stream address, the rtsp_transport is ignored.

So, this is working:

ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.201:554/11 -c:v copy -an out.mkv

this is not working:

ffmpeg -i rtsp://192.168.1.201:554/11 -c:v copy -rtsp_transport tcp -an out.mkv

Thanks
 
Top