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

Steven Liu lingjiujianke at gmail.com
Wed Jun 29 00:30:17 CEST 2016


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:

ffmpeg version N-80694-g074fdf4 Copyright (c) 2000-2016 the FFmpeg
developers

  built with Apple LLVM version 7.3.0 (clang-703.0.31)

  configuration: --enable-libass --enable-opengl --enable-libx264
--enable-libmp3lame --enable-gpl --enable-libfaac --enable-nonfree
--prefix=/usr/local --enable-libopencv --enable-libtesseract

  libavutil      55. 26.100 / 55. 26.100

  libavcodec     57. 47.100 / 57. 47.100

  libavformat    57. 40.101 / 57. 40.101

  libavdevice    57.  0.101 / 57.  0.101

  libavfilter     6. 46.102 /  6. 46.102

  libswscale      4.  1.100 /  4.  1.100

  libswresample   2.  1.100 /  2.  1.100

  libpostproc    54.  0.100 / 54.  0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Users/StevenLiu/Movies/objectC/facebook.mp4':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    encoder         : Lavf55.22.102

    description     : This File is Created by Easy RealMedia Tools@!

  Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s

    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 /
0x31637661), yuv420p, 640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
(default)

    Metadata:

      handler_name    : VideoHandler

    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 87 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

[hls @ 0x105012800] Using AVStream.codec to pass codec parameters to muxers
is deprecated, use AVStream.codecpar instead.

    Last message repeated 1 times

[mpegts @ 0x10500fa00] muxrate VBR, pcr every 5 pkts, sdt every 2147483647,
pat/pmt every 2147483647 pkts

Output #0, hls, to 'aaaa.m3u8':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    description     : This File is Created by Easy RealMedia Tools@!

    encoder         : Lavf57.40.101

    Stream #0:0(und): Video: h264, 1 reference frame (avc1 / 0x31637661),
yuv420p, 640x480 (0x0), q=2-31, 797 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
(default)

    Metadata:

      handler_name    : VideoHandler

    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, 87 kb/s (default)

    Metadata:

      handler_name    : SoundHandler

Stream mapping:

  Stream #0:0 -> #0:0 (copy)

  Stream #0:1 -> #0:1 (copy)

Press [q] to stop, [?] for help

Process 38828 stopped

* thread #1: tid = 0x114ff0, 0x0000000100204170
ffmpeg_g`mpegts_check_bitstream(s=0x000000010500fa00,
pkt=0x00007fff5fbfada0) at mpegtsenc.c:1786, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1

    frame #0: 0x0000000100204170
ffmpeg_g`mpegts_check_bitstream(s=0x000000010500fa00,
pkt=0x00007fff5fbfada0) at mpegtsenc.c:1786

   1783 static int mpegts_check_bitstream(struct AVFormatContext *s, const
AVPacket *pkt)

   1784 {

   1785     int ret = 1;

-> 1786     AVStream *st = s->streams[pkt->stream_index];

   1787

   1788     if (st->codecpar->codec_id == AV_CODEC_ID_H264) {

   1789         if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&

(lldb) bt

* thread #1: tid = 0x114ff0, 0x0000000100204170
ffmpeg_g`mpegts_check_bitstream(s=0x000000010500fa00,
pkt=0x00007fff5fbfada0) at mpegtsenc.c:1786, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1

  * frame #0: 0x0000000100204170
ffmpeg_g`mpegts_check_bitstream(s=0x000000010500fa00,
pkt=0x00007fff5fbfada0) at mpegtsenc.c:1786

    frame #1: 0x00000001001ad9c0
ffmpeg_g`hls_check_bitstream(s=0x0000000105012800, pkt=0x00007fff5fbfada0)
+ 48 at hlsenc.c:911

    frame #2: 0x000000010020a751
ffmpeg_g`av_interleaved_write_frame(s=0x0000000105012800,
pkt=0x00007fff5fbfada0) + 529 at mux.c:1096

    frame #3: 0x00000001000204de ffmpeg_g`write_frame(s=<unavailable>,
pkt=0x00007fff5fbfada0, ost=0x0000000104b14aa0) + 1694 at ffmpeg.c:762

    frame #4: 0x000000010001d76a ffmpeg_g`process_input_packet [inlined]
do_streamcopy(ist=<unavailable>, ost=<unavailable>, pkt=<unavailable>) +
7370 at ffmpeg.c:1908

    frame #5: 0x000000010001d518
ffmpeg_g`process_input_packet(ist=0x0000000104b13fc0,
pkt=0x00007fff5fbfb4f0, no_eof=<unavailable>) + 6776 at ffmpeg.c:2434

    frame #6: 0x000000010001996f ffmpeg_g`transcode [inlined] process_input
+ 1354 at ffmpeg.c:4020

    frame #7: 0x0000000100019425 ffmpeg_g`transcode [inlined]
transcode_step + 1850 at ffmpeg.c:4108

    frame #8: 0x0000000100018ceb ffmpeg_g`transcode + 17563 at ffmpeg.c:4162

    frame #9: 0x0000000100014208 ffmpeg_g`main(argc=<unavailable>,
argv=<unavailable>) + 328 at ffmpeg.c:4355

    frame #10: 0x00007fff9a0b45ad libdyld.dylib`start + 1

(lldb) quit


More information about the ffmpeg-devel mailing list