[FFmpeg-devel] [PATCH] lavf/img2dec: add ppm pipe demuxer

Clément Bœsch u at pkh.me
Thu Jun 16 11:04:30 CEST 2016


On Fri, Jun 10, 2016 at 04:28:55AM +0200, Michael Niedermayer wrote:
> On Thu, Jun 09, 2016 at 04:35:02PM +0200, Clément Bœsch wrote:
> > On Thu, Jun 09, 2016 at 03:59:30PM +0200, Clément Bœsch wrote:
> > > On Thu, Jun 09, 2016 at 01:35:19PM +0000, Carl Eugen Hoyos wrote:
> > > > Clément Bœsch <u <at> pkh.me> writes:
> > > > 
> > > > > +            if (b[3] == '#')
> > > > > +                return AVPROBE_SCORE_EXTENSION + 1;
> > > > > +            if (b[3] >= '0' && b[3] <= '9')
> > > > > +                return AVPROBE_SCORE_MAX - 1;
> > > > 
> > > > Imo, this should be:
> > > > if (b[3] == '#' || (b[3] >= '0' && b[3] <= '9'))
> > > >   return AVPROBE_SCORE_EXTENSION + 2;
> > > > or similar
> > > > 
> > > > I count 37 and 34 bits which is only a little more than 
> > > > the usual 32 bit for EXTENSION + 1.
> > > > 
> > > 
> > > Sure. Changed locally, will push soon, thanks.
> > > 
> > 
> > For some reasons it makes seeking with pgm somehow working. The reference
> > test doesn't look that great IIUC, but seeking in these file with ffplay
> > is fine AFAICT.
> 
> it seems it messes with pgmyuv detection (which i think was filename extension based)
> 
> example:
> ./ffmpeg -i matrixbench_mpeg2.mpg -pix_fmt yuv420p16be -vframes 1 test.pgmyuv

> ./ffplay-ref test.pgmyuv
> Input #0, image2, from 'test.pgmyuv':B vq=    0KB sq=    0B f=0/0
>   Duration: 00:00:00.04, start: 0.000000, bitrate: 248835 kb/s
>     Stream #0:0: Video: pgmyuv, yuv420p16le, 720x576, 25 tbr, 25 tbn
> 

This currently crashes for me with git/master:

pnm_decode_frame (avctx=<optimized out>, data=0x7fffe8012f40, got_frame=0x7fffecbe89cc, avpkt=<optimized out>) at src/libavcodec/pnmdec.c:225
225	                    v = av_be2ne16(((uint16_t *)s->bytestream)[j]);
(gdb) bt
#0  pnm_decode_frame (avctx=<optimized out>, data=0x7fffe8012f40, got_frame=0x7fffecbe89cc, avpkt=<optimized out>) at src/libavcodec/pnmdec.c:225
#1  0x0000000000cde5e8 in avcodec_decode_video2 (avctx=avctx at entry=0x7fffe8000e00, picture=0x7fffe8012f40, 
    got_picture_ptr=got_picture_ptr at entry=0x7fffecbe89cc, avpkt=avpkt at entry=0x7fffecbe8ac0) at src/libavcodec/utils.c:2217
#2  0x0000000000cdf1c0 in do_decode (avctx=avctx at entry=0x7fffe8000e00, pkt=0x7fffecbe8ac0) at src/libavcodec/utils.c:2727
#3  0x0000000000ce014b in avcodec_send_packet (avctx=avctx at entry=0x7fffe8000e00, avpkt=<optimized out>, avpkt at entry=0x7fffecbe8ac0)
    at src/libavcodec/utils.c:2813
#4  0x0000000000710cf5 in try_decode_frame (s=s at entry=0x7fffe8009240, st=st at entry=0x7fffe8007500, avpkt=avpkt at entry=0x7fffecbe8c40, 
    options=<optimized out>) at src/libavformat/utils.c:2899
#5  0x00000000007194d4 in avformat_find_stream_info (ic=0x7fffe8009240, options=0x7fffe8007880) at src/libavformat/utils.c:3595
#6  0x0000000000487d08 in read_thread (arg=0x7ffff0ae9040) at src/ffplay.c:2880
#7  0x00007ffff647afe8 in ?? () from /usr/lib/libSDL-1.2.so.0
#8  0x00007ffff64bc8a9 in ?? () from /usr/lib/libSDL-1.2.so.0
#9  0x00007ffff6254484 in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007ffff56436dd in clone () from /usr/lib/libc.so.6

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160616/ec169b62/attachment.sig>


More information about the ffmpeg-devel mailing list