Opened 13 years ago

Closed 12 years ago

#2460 closed patch (fixed)

Add proper cout buffered logging of libavcodec

Reported by: paulx@… Owned by: Janne Grunau
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords: logging
Cc: Ticket locked: no

Description

I got this idea from mythtv/programs/mythtranscode/mpeg2fix.cpp. By using the av_log_set_callback we can set how the libavcodec library displays its information and error messages. Even what level of message to display too or not at all.

The biggest downside seem to be where to put it. I put it in the mythtv/libs/libmyth/mythcontext.cpp file. While used everywhere libavcodec is used, it is also used when libavcodec isn't. This requires libavutil beening linked into mythuitest, mythbrowser and mtd.

Attachments (3)

libavcodec-log.patch (1.9 KB) - added by paulx@… 13 years ago.
mythcontext changes
libavcodec-log-plugins.patch (1.0 KB) - added by paulx@… 13 years ago.
plugins patch
libavcodec-log-2.patch (2.0 KB) - added by paulx@… 13 years ago.
Update to use VERBOSE to print message.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by paulx@…

Attachment: libavcodec-log.patch added

mythcontext changes

Changed 13 years ago by paulx@…

plugins patch

comment:1 Changed 13 years ago by Stuart Auchterlonie

Keywords: logging added
Milestone: unknown0.21

This is a good starting point. It should use the myth VERBOSE macros with an appropriate level ie. VB_LIBAV rather than cout to print the messages.

Changed 13 years ago by paulx@…

Attachment: libavcodec-log-2.patch added

Update to use VERBOSE to print message.

comment:2 Changed 12 years ago by Janne Grunau

Owner: changed from Isaac Richards to Janne Grunau
Version: 0.20head

comment:3 in reply to:  1 Changed 12 years ago by Nick Morrott <<knowledgejunkie [at] gmail [dot] com>>

Replying to stuarta:

This is a good starting point. It should use the myth VERBOSE macros with an appropriate level ie. VB_LIBAV rather than cout to print the messages.

Should this stop the stream related information I'm seeing in my mythbackend log:

0: start_time: -9223372036854.775 duration: -9223372036854.775
1: start_time: -9223372036854.775 duration: -9223372036854.775
2: start_time: -9223372036854.775 duration: -9223372036854.775
3: start_time: -9223372036854.775 duration: -9223372036854.775
4: start_time: -9223372036854.775 duration: -9223372036854.775
5: start_time: -9223372036854.775 duration: -9223372036854.775
6: start_time: -9223372036854.775 duration: -9223372036854.775
7: start_time: -9223372036854.775 duration: -9223372036854.775
stream: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=10256 kb/s
0: start_time: 1787.081 duration: 342.490
1: start_time: 1787.037 duration: 342.477
2: start_time: 1787.043 duration: 342.468
3: start_time: 1787.037 duration: 342.533
4: start_time: 1787.037 duration: 342.533
5: start_time: 1787.037 duration: 342.533
6: start_time: 1787.037 duration: 342.533
7: start_time: 1787.037 duration: 342.533
stream: start_time: 19855.971 duration: 3805.923 bitrate=4623 kb/s

I've manually applied the patches (files have changed since diffs made) and still see these entries which are not timestamped.

comment:4 Changed 12 years ago by Janne Grunau

Resolution: fixed
Status: newclosed

(In [14411]) Fixes #2460. Wrap libav* log output in AVFormatDecoder

Allows us to filter the output with mythtv's verbose levels. All error and fatal libav log levels go to VB_IMPORTANT, the rest goes to VB_LIBAV and is usually ignored.

based on patch from Paul Andreassen % paulx A andreassen P com P au %

Note: See TracTickets for help on using tickets.