[FFmpeg-devel] [PATCH v4] avformat/flvenc: add add_keyframe_index option

Michael Niedermayer michael at niedermayer.cc
Tue Nov 8 13:07:51 EET 2016


On Tue, Nov 08, 2016 at 05:48:07PM +0800, Steven Liu wrote:
> 2016-11-08 16:51 GMT+08:00 Steven Liu <lingjiujianke at gmail.com>:
> 
> >
> >
> > 2016-11-08 16:47 GMT+08:00 Michael Niedermayer <michael at niedermayer.cc>:
> >
> >> On Tue, Nov 08, 2016 at 03:17:26PM +0800, Steven Liu wrote:
> >> [...]
> >> > > diff --git a/tests/ref/fate/flv-add_keyframe_index
> >> > > b/tests/ref/fate/flv-add_keyframe_index
> >> > > new file mode 100644
> >> > > index 0000000..8e12244
> >> > > --- /dev/null
> >> > > +++ b/tests/ref/fate/flv-add_keyframe_index
> >> > > @@ -0,0 +1,12 @@
> >> > > +;FFMETADATA1
> >> > > +hasVideo=true
> >> > > +hasKeyframes=true
> >> > > +hasAudio=false
> >> > > +hasMetadata=true
> >> > > +canSeekToEnd=true
> >> > > +datasize=55566
> >> > > +videosize=55207
> >> > > +audiosize=0
> >> > > +lasttimestamp=5
> >> > > +lastkeyframetimestamp=5
> >> > > +lastkeyframelocation=52623
> >> > > --
> >> > > 1.7.1
> >> > >
> >> > >
> >> > >
> >> > > _______________________________________________
> >> > > ffmpeg-devel mailing list
> >> > > ffmpeg-devel at ffmpeg.org
> >> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >> > >
> >> >
> >> > Hi Michael,
> >> >
> >> >       Can you share the qemu+ARM test compile example into the wiki, i
> >> have
> >> > not found it, so only test with:
> >>
> >> the qemu arm is very similar to qemu mips
> >> you can see one qemu arm fate client with all configure parameters here:
> >> http://fatebeta.ffmpeg.org/report/armel5tej-qemu-debian-gcc4
> >> .4/20161108072019
> >>
> >>
> >> >      macbook osx, pc Linux ubuntu, qemu + mips, wine+mingw, no
> >> > qemu+arm environment.
> >>
> >> qemu mips fails similarly
> >>
> >
> >
> > lq at ubuntu:~/ffmpeg/mips$ make fate-flv-add_keyframe_index
> > GEN tests/data/add_keyframe_index.flv
> > ffmpeg version N-82288-gacd87df Copyright (c) 2000-2016 the FFmpeg
> > developers
> >   built with gcc 4.4.5 (Debian 4.4.5-8)
> >   configuration: --target-exec='qemu-mips -cpu 74Kf -L
> > /usr/mips-linux-gnu/' --samples=... --enable-gpl --cross-prefix=/usr/mips-linux-gnu/bin/
> > --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux
> > --enable-cross-compile --disable-mipsfpu --disable-iconv
> >   libavutil      55. 35.100 / 55. 35.100
> >   libavcodec     57. 66.101 / 57. 66.101
> >   libavformat    57. 57.100 / 57. 57.100
> >   libavdevice    57.  2.100 / 57.  2.100
> >   libavfilter     6. 66.100 /  6. 66.100
> >   libswscale      4.  3.100 /  4.  3.100
> >   libswresample   2.  4.100 /  2.  4.100
> >   libpostproc    54.  2.100 / 54.  2.100
> > Input #0, lavfi, from 'color=c=red:size=352x288':
> >   Duration: N/A, start: 0.000000, bitrate: N/A
> >     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 352x288
> > [SAR 1:1 DAR 11:9], 25 tbr, 25 tbn, 25 tbc
> > [flv @ 0x1d38d30] Setting the AVFormatContext to bitexact mode, because
> > the AVCodecContext is in that mode. This behavior will change in the
> > future. To keep the current behavior, set AVFormatContext.flags |=
> > AVFMT_FLAG_BITEXACT.
> > Output #0, flv, to '/home/lq/ffmpeg/mips/tests/
> > data/add_keyframe_index.flv':
> >     Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p,
> > 352x288 [SAR 1:1 DAR 11:9], q=2-31, 100 kb/s, 25 fps, 1k tbn, 25 tbc
> >     Metadata:
> >       encoder         : Lavc flv
> >     Side data:
> >       cpb: bitrate max/min/avg: 0/0/100000 buffer size: 0 vbv_delay: -1
> > Stream mapping:
> >   Stream #0:0 -> #0:0 (rawvideo (native) -> flv1 (flv))
> > Press [q] to stop, [?] for help
> > frame=  125 fps=0.0 q=2.0 Lsize=      55kB time=00:00:04.96 bitrate=
> >  90.3kbits/s speed=5.42x
> > video:52kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> > muxing overhead: 5.215479%
> > TEST    flv-add_keyframe_index
> > lq at ubuntu:~/ffmpeg/mips$
> > lq at ubuntu:~/ffmpeg/mips$
> >
> >
> >
> >
> >> [...]
> >> --
> >> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >>
> >> The bravest are surely those who have the clearest vision
> >> of what is before them, glory and danger alike, and yet
> >> notwithstanding go out to meet it. -- Thucydides
> >>
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >>
> 
> qemu+arm ok:

the flv file is not regenerated sometimes it seems, i had to delete
it by hand during testing

either way scaler bitexact flags and idct/dct settings are missing

@@ -1,8 +1,8 @@
 tests/data/add_keyframe_index.flv: TAG = GEN
 tests/data/add_keyframe_index.flv: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
        $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
-                -f lavfi -i "testsrc=r=7:n=2:d=20" -metadata "encoder=Lavf" -pix_fmt yuv420p -c:v flv1 -g 7 -f flv -flags +bitexact \
-                -flvflags add_keyframe_index -y $(TARGET_PATH)/tests/data/add_keyframe_index.flv 2> /dev/null;
+                -f lavfi -i "sws_flags=+accurate_rnd+bitexact;testsrc=r=7:n=2:d=20" -sws_flags '+accurate_rnd+bitexact' -metadata "encoder=Lavf" -pix_fmt yuv420p -c:v flv1 -g 7 -f flv -flags +bitexact \
+                -flvflags add_keyframe_index -idct simple -dct int -y $(TARGET_PATH)/tests/data/add_keyframe_index.flv 2> /dev/null;

 FATE_AFILTER-$(call ALLYES, FLV_MUXER FLV_DEMUXER AVDEVICE TESTSRC_FILTER LAVFI_INDEV FLV_ENCODER) += fate-flv-add_keyframe_index
 fate-flv-add_keyframe_index: tests/data/add_keyframe_index.flv

above worked

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161108/692231bb/attachment.sig>


More information about the ffmpeg-devel mailing list