Motion - Ffmpeg Avicodec Logging

Ffmpeg Avicodec Logging

Description of Patch

This patch will give a voice to ffmpeg's avicodec, etc libraries.

Installation of Patch

Download the patch file. If it is packed as a gz or tar.gz unpack it first. Then copy it to the motion source directory and issue the command (assuming the patch file is called filename_of_patch_file.diff)

patch < filename_of_patch_file.diff

Then re-build Motion and test the patch.

Change History of Patch

  • 1.0 Initial revision

Discussion and Comments

Moved your patch version 2 to here.

But instead of
void ffmpeg_avcodec_log(void *ignoreme ATTRIBUTE_UNUSED, int errno_flag, const char *message, va_list vars)
{
    char *t_message;
    const char *pre_message = "ffmpeg_avcodec_log: ";

    /* Prefix the passed in message with our "ffmpeg_avcodec_log: " */
    t_message = mymalloc( strlen( message ) + strlen( pre_message ) );
    strcpy( t_message, pre_message );
    strcat( t_message, message );

    motion_log(LOG_ERR, 0, t_message, vars);

    /* Clean up the memory */
    free( t_message );
 }

I would think this would do the job. Since it is dark I do not get any messages from ffmpeg when I move my cameras.

void ffmpeg_avcodec_log(void *ignoreme ATTRIBUTE_UNUSED, int errno_flag, const char *message, va_list vars)
{
    motion_log(LOG_ERR, 0, "ffmpeg_avcodec_log: %s", message, vars);
}

That seems simpler and should work.

I also got clipping errors in the log. They seem harmless. They used to come in greater numbers in older versions of ffmpeg. I thought they were gone. Maybe they are just not reported now. I only see them at daylight. It may just be low level warnings that means nothing. In that case we should not show them either. Maybe by filtering by the errno_flag.

-- KennethLavrsen - 23 May 2006

I decided to check in my changed code. And I am running that now on my 11 cameras for testing.

SVN 78.

-- KennethLavrsen - 23 May 2006

I am getting many warnings now like

ffmpeg_avcodec_log: warning, clipping 134669894 dct coefficients to -1245878676..0

That becomes syslog flooding and we cannot have that. So we need to silence these in normal operation. We can enable them in debug mode.

-- KennethLavrsen - 25 May 2006

I am also getting many of the same messages. It is fun trying to wheedle through the libavcodec code trying to find out the meaning of DCTs. The "log on debug only" will probably be very simple to add as well. Thank you for the fix to the code, btw.

-- PeterS - 25 May 2006

Since you've rolled this into SVN, I'd recommend changing the PatchStatus on here. I've also posted a fix regarding the 'va_list' being problematic.

-- PeterS - 31 May 2006

In 3.2.7

-- KennethLavrsen - 20 Oct 2006

Topic revision: r6 - 20 Oct 2006, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.