[FFmpeg-devel] [PATCH] ffprobe: Support adding av_log output to frames

Dave Rice dave at dericed.com
Wed Jun 8 19:55:38 CEST 2016


> On Jun 8, 2016, at 12:30 PM, Michael Niedermayer <michael at niedermayer.cc> wrote:
> 
> On Tue, Jun 07, 2016 at 08:06:35PM -0400, Dave Rice wrote:
>> 
>>> On May 31, 2016, at 3:23 PM, Michael Niedermayer <michael at niedermayer.cc> wrote:
>>> 
>>> adding demuxer and other logs should be easy
>>> This forces single threaded decoding for simplicity
>>> It also requires pthreads, this could be avoided either with
>>> some lockless tricks or simply by assuming av_log would never be called from
>>> another thread.
>> 
>> I’ve been testing this patch, but currently the logging does not appear within the log node. For instance with a fuzzed mpeg2video in QuickTime when I run:
>> 
>> ./ffprobe -i /Users/davidrice/fuzzed_mpeg2video.mov -show_log 1 -show_frames -of xml
> [...]
>> 
>> When the mpeg2video decoding log appears in sdterr, then the <logs> node is written but empty. During a frame when there is no logged message, there is no <logs> node.
>> 
>> Also I’m uncertain what the value to use with -show_log means. I’m using -show_log 1 for now. Is this for verbosity?
> 
> you need to set the log level in -show_log high enough so the messages
> that you are interrested in are included

OK, the value just needs to be higher than I expected.

I created a test file with:
ffmpeg -f lavfi -i testsrc -bsf noise -t 1 -c:v mpeg2video fuzzed_mpeg2video.mov

I don't actually get log info until the -show_log value is up to 16. Then this works:
ffprobe fuzzed_mpeg2video.mov -show_log 16 -show_frames -of xml

But it outputs invalid xml:

            <logs>
                <(null) key="context" value="mpeg2video"/>
 level="16" category="6"                <(null) key="message" value="[mpeg2video @ 0x7fa4a3800000] skipped MB in I frame at 3 0
"/>
                <(null) key="context" value="mpeg2video"/>
 level="16" category="6"                <(null) key="message" value="[mpeg2video @ 0x7fa4a3800000] ac-tex damaged at 16 9
"/>
                <(null) key="context" value="mpeg2video"/>
 level="16" category="6"                <(null) key="message" value="[mpeg2video @ 0x7fa4a3800000] ac-tex damaged at 11 11
"/>
                <(null) key="context" value="mpeg2video"/>
 level="16" category="6"                <(null) key="message" value="[mpeg2video @ 0x7fa4a3800000] invalid mb type in I Frame at 9 13
"/>
                <(null) key="context" value="mpeg2video"/>
 level="16" category="6"                <(null) key="message" value="[mpeg2video @ 0x7fa4a3800000] Warning MVs not available
"/>
            </logs>

The 'log' node is called '(null)' and the level and category attributes are outside of a node.

> all messages are still printed to stderr too, maybe that is confusing
> but feels consistent behavior

I agree.

[...]

Dave Rice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160608/79a6b40b/attachment.sig>


More information about the ffmpeg-devel mailing list