Close

FFmpeg processing options?

Having trouble with Sighthound Video? Post here for help.

Moderator: Staff

no avatar
beeftube
 
Posts: 21
Joined: Fri Nov 07, 2014 2:19 pm

FFmpeg processing options?

by beeftube » Sun Nov 09, 2014 12:44 pm

Hey guys,

I'm getting some artifacts/smearing from my MPEG camera (Hikvision 2cd-2032-i) intermittently during daylight hours. I've noticed this before when using FFmpeg without a certain set of flags (for instance, it also occurred in ZoneMinder before I adjusted the FFmpeg settings that ZM used for processing).

It looks like you guys include the FFmpeg license in the SightHound application directory, which tells me you're using FFmpeg for decoding. Is there anywhere I can tweak the processing options that FFmpeg is using on the back end?

Optionally, is there any way to use VLClib instead of FFmpeg? VLClib (and thus, the VLC player) have no issues decoding the stream out of the box.

Thanks!

no avatar
beeftube
 
Posts: 21
Joined: Fri Nov 07, 2014 2:19 pm

Re: FFmpeg processing options?

by beeftube » Sun Nov 09, 2014 1:07 pm

A little more information for developers -- the artifacts/smearing is largely an issue of corrupted RTP packets, and a common fix is to force these packets over TCP. However, in some versions of FFmpeg, this functionality is broken and the RTP packets cannot be sent over TCP, even if you specify a "?tcp" on the end of the stream URL.

Indeed, if I provide my RTSP URL to SightHound:
rtsp://visitor:[email protected]:554 ... Channels/1

...I notice the smearing on a regular basis. If I run a packet capture via WireShark, these packets are being sent across via UDP.

If I stop that stream by turning off the camera in SightHound (or ending a VLC stream), and the modify the URL to include "?tcp" on the end:
rtsp://visitor:[email protected]:554 ... nels/1?tcp

I see the video start up again in SightHound, still receiving artifacts. If I run a packet capture via WireShark, I see all the packets coming across as UDP still.

As I mentioned before, this seems to be an issue with some versions of FFmpeg. I wonder if SightHound has any plans to update the version of FFmpeg (now avconv) on the SightHound backend?

Links detailing the issue from FFmpeg's mailing list:
http://ffmpeg.org/pipermail/ffmpeg-deve ... 27010.html

Other developers on another project (ZoneMinder) also note the problem:
https://github.com/ZoneMinder/ZoneMinder/issues/323

Any info/workarounds?

Edit: Corrected typo involving TCP and UDP.
Last edited by beeftube on Sun Nov 09, 2014 4:12 pm, edited 1 time in total.

User avatar
ryan
 
Posts: 1015
Joined: Wed Aug 25, 2010 2:52 pm
Location: Palo Alto, California

Re: FFmpeg processing options?

by ryan » Sun Nov 09, 2014 3:14 pm

Hi beeftube,

Happy to help out. While Sighthound Video does utilize FFmpeg libraries for a variety of video processing functionality there isn't a direct passthrough, nor 1:1 mapping. Forcing TCP in Sighthound Video does happen to work in a similar manner to what you mentioned, but the flag is "?svforcetcp" rather than "?tcp". Note that I don't believe the "?tcp" flag addition has been supported by the FFmpeg command line tool for a while, instead you would need to use "-rtsp_transport tcp" in your parameter list.

As an informational side note since you seem to be interested on your own, your comment on "FFmpeg (now avconv)" isn't quite correct - the whole thing is a fairly confusing. Several years ago the developers of FFmpeg had a rather nasty split with some forking the project and taking the name "libav", which is actually the name of FFmpeg's libraries, while ffmpeg is simply the command line utility. The libav group then named their command line utility "avconv", but only after distributing versions of "ffmpeg" with a deprecated warning message. Things have settled down a bit and the two groups are finally making some steps to be less antagonistic to each other, though ffmpeg.org and libav.org are and will continue to be separate projects. FFmpeg has a policy to take bug/security fixes and improvements from the libav project while the reverse is not true, so FFmpeg tends to be a bit more 'complete'. FFmpeg 2.4.3 (released Novemeber 2) has already been integrated into the app so that will be in the next release.

Best,
- ryan
Learn more about Sighthound Video in our support pages - Reference Guide | All Articles
Are you a developer? Check out our cloud APIs - Demo | Docs

no avatar
beeftube
 
Posts: 21
Joined: Fri Nov 07, 2014 2:19 pm

Re: FFmpeg processing options?

by beeftube » Sun Nov 09, 2014 4:32 pm

Thanks very much for the reply and the great information - you guys certainly know your stuff, I'm just a casual Googler when I run into issues. :)

Sure enough, I've added "?svforcetcp" to the end of my streaming URL, and indeed my RTP packets appear to be using TCP according to Wireshark.

I'll certainly be keeping an eye on it and see if there's any improvement!


Return to Technical Support