[FFmpeg-trac] #6301(avformat:new): Bitstream filter 'h264_mp4toannexb' isn't auto-inserted for hls muxer

FFmpeg trac at avcodec.org
Thu Apr 13 11:27:13 EEST 2017

#6301: Bitstream filter 'h264_mp4toannexb' isn't auto-inserted for hls muxer
             Reporter:  Alexander    |                    Owner:
                 Type:  enhancement  |                   Status:  new
             Priority:  wish         |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |

Comment (by Alexander):

 Ok, I was wrong and there are really
 Auto-inserting h264_mp4toannexb bitstream filter
 messages in logs. But still AVFMT_FLAG_AUTO_BSF flag doesn't work for me
 and I must create bitstream filter by hands :(

 I use ffmpeg library API, converting mp4 files to HLS playlist without
 decoding/encoding frames, only demux/mux. My workflow:
 1. Create AVFormatContext with avformat_alloc_output_context2 and 'hls' as
 2. Create streams in it with avformat_new_stream(format_context, codec);
 3. Open streams with:
 AVCodecContext *codec_context = avcodec_alloc_context3(codec);
 // setup codec_context here
 avcodec_parameters_from_context(stream->codecpar, codec_context);
 avcodec_open2(codec_context, codec, NULL);
 4. Set flag
 format_context->flags |= AVFMT_FLAG_AUTO_BSF
 5. Begin write with avformat_write_header(format_context, NULL);
 6. Begin standard loop with av_read_frame and av_interleaved_write_frame.
 Currently, on the last step I apply 'h264_mp4toannexb' manually. I'd like
 to use auto-insert instead. but it doesn't work for me.

Ticket URL: <https://trac.ffmpeg.org/ticket/6301#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list