[FFmpeg-devel] Fwd: [PATCH] Automatically inserted bitstream filter 'h264_mp4toannexb' into hlsenc

Steven Liu lingjiujianke at gmail.com
Wed Jul 13 14:22:52 EEST 2016


2016-07-13 18:28 GMT+08:00 Michael Niedermayer <michael at niedermayer.cc>:

> On Wed, Jun 29, 2016 at 01:07:13AM +0200, Hendrik Leppkes wrote:
> > On Wed, Jun 29, 2016 at 12:30 AM, Steven Liu <lingjiujianke at gmail.com>
> wrote:
> > >
> > >
> > > 2016-06-29 0:16 GMT+08:00 Hendrik Leppkes <h.leppkes at gmail.com>:
> > >>
> > >> On Tue, Jun 28, 2016 at 3:29 PM, Steven Liu <lingjiujianke at gmail.com>
> > >> wrote:
> > >> > before patched:
> > >> > [root at localhost ffmpeg]# ./ffmpeg_g -re -i /root/facebook.mp4 -c
> copy -f
> > >> > hls -v verbose -y aaaa.m3u8
> > >> > ffmpeg version N-80779-gb18d6c5 Copyright (c) 2000-2016 the FFmpeg
> > >> > developers
> > >>
> > >>
> > >> The way I see it, the auto bsf from the mpegts muxer should already
> > >> cover this without changes?
> > >
> > >
> > > add the hls_check_bitstream into hls format and call the hls->avf to
> call
> > > the mpegtsenc's check_bitstream,
> > > don't do this operation,  it won't call the mpegtsenc's
> check_bitstream,
> > > look at the message bellow:
> > >
> >
> > This is the wrong approach to fixing this however, it should be
> > understood first why its not doing this transparently right now.
> > hlsenc uses the mpegts muxer like one would use any other muxer, so
> > why does autobsf not get used?
> >
> > If we understand that, maybe it can be fixed in a more generic way,
> > and not end up in ugly hacks in hlsenc.
>
> The issue is that hlsenc does call ff_write_chained() which causes
> av_write_frame() instead of av_interleaved_write_frame() to be used,
> bypassing the current auto bsf code
>
> Using av_interleaved_write_frame() would, i assume introduce a delay
>
> The patch doesnt work either, for example this:
> ./ffmpeg -i matrixbench_mpeg2.mpg -i
> fate-suite/sub/MovText_capability_tester.mp4  -f hls     file.m3u8
>
> segfaults
>
>
Hi Michael,

       Can you upload the matrixbench_mpeg2.mpg and
fate-suite/sub/MovText_capability_tester.mp4? Let me test and fix it!

      It's ok here:




localhost:ffmpeg liuqi$ ./ffmpeg -i ~/Movies/objectC/xxx.mpg -i
~/Movies/objectC/facebook.mp4 -f hls testtest.m3u8
ffmpeg version N-80982-g151479e Copyright (c) 2000-2016 the FFmpeg
developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --enable-libass --enable-libfaac --enable-libmp3lame
--enable-libx264 --enable-libopencv --enable-gpl --enable-nonfree
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpeg, from '/Users/liuqi/Movies/objectC/xxx.mpg':
  Duration: 00:45:45.57, start: 0.529978, bitrate: 833 kb/s
    Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 720x528 [SAR 1:1
DAR 15:11], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from
'/Users/liuqi/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.34.103
  Duration: 00:45:45.64, start: 0.000000, bitrate: 1530 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
720x528 [SAR 1:1 DAR 15:11], 1141 kb/s, 25 fps, 25 tbr, 16k tbn, 50 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side),
fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Side data:
      audio service type: main
[libx264 @ 0x7f98090e6a00] using SAR=1/1
[libx264 @ 0x7f98090e6a00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7f98090e6a00] profile High, level 3.0
[hls @ 0x7f980900f400] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, hls, to 'testtest.m3u8':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 720x528 [SAR 1:1 DAR
15:11], q=-1--1, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.50.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC), 48000 Hz, 5.1(side), fltp, 341 kb/s
(default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.50.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg1video (native) -> h264 (libx264))
  Stream #1:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame=  678 fps= 97 q=-1.0 Lsize=N/A time=00:00:27.00 bitrate=N/A
speed=3.86x
video:2479kB audio:1043kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
[libx264 @ 0x7f98090e6a00] frame I:9     Avg QP:17.37  size: 22063
[libx264 @ 0x7f98090e6a00] frame P:561   Avg QP:22.20  size:  3959
[libx264 @ 0x7f98090e6a00] frame B:108   Avg QP:25.34  size:  1097
[libx264 @ 0x7f98090e6a00] consecutive B-frames: 75.1% 10.3%  2.2% 12.4%
[libx264 @ 0x7f98090e6a00] mb I  I16..4: 36.7% 61.5%  1.8%
[libx264 @ 0x7f98090e6a00] mb P  I16..4:  4.0%  6.9%  0.4%  P16..4: 19.6%
 3.8%  2.6%  0.0%  0.0%    skip:62.7%
[libx264 @ 0x7f98090e6a00] mb B  I16..4:  0.8%  2.0%  0.0%  B16..8: 19.3%
 1.4%  0.4%  direct: 1.2%  skip:74.8%  L0:74.5% L1:20.8% BI: 4.7%
[libx264 @ 0x7f98090e6a00] 8x8 transform intra:61.9% inter:92.7%
[libx264 @ 0x7f98090e6a00] coded y,uvDC,uvAC intra: 47.4% 72.2% 8.2% inter:
7.6% 6.0% 1.1%
[libx264 @ 0x7f98090e6a00] i16 v,h,dc,p: 32% 43% 25%  1%
[libx264 @ 0x7f98090e6a00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 21% 47%  3%
 1%  1%  1%  1%  6%
[libx264 @ 0x7f98090e6a00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 48% 28% 11%  2%
 2%  2%  2%  3%  2%
[libx264 @ 0x7f98090e6a00] i8c dc,h,v,p: 34% 36% 27%  3%
[libx264 @ 0x7f98090e6a00] Weighted P-Frames: Y:1.6% UV:1.6%
[libx264 @ 0x7f98090e6a00] ref P L0: 75.9%  7.7% 11.1%  5.3%  0.0%
[libx264 @ 0x7f98090e6a00] ref B L0: 75.1% 23.7%  1.2%
[libx264 @ 0x7f98090e6a00] ref B L1: 91.4%  8.6%
[libx264 @ 0x7f98090e6a00] kb/s:748.68
[aac @ 0x7f980900fa00] Qavg: 328.425


More information about the ffmpeg-devel mailing list