Opened 2 years ago

Closed 19 months ago

#9547 closed defect (needs_more_info)

Not auto-detecting dts codec when encoding to m3u8

Reported by: AlexPress0 Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by AlexPress0)

Summary of the bug:
How to reproduce:

% ffmpeg -ss 0.000 \
    -i h264file.mkv \
    -threads 0 \
    -vcodec copy \
    -vsync 2 \
    -vbsf h264_mp4toannexb=repeatheader \
    -acodec libmp3lame \
    -ab 256k \
    -ac 2 \
    -f ssegment \
    -segment_format mpegts \
    -segment_list_type m3u8 \
    -hls_seek_time 0 \
    -segment_time 8 \
    -segment_time_delta 0.000 \
    -segment_start_number 00000 \
    -avoid_negative_ts 0 \
    -break_non_keyframes 1 \
    -map 0:0 \
    -map 0:2 \
    /tmp/slice-%05d.ts

ffmpeg version: 4.4.1-full_build-www.gyan.dev
built on windows

When trying to convert an H.264 file to an HLS m3u8, I get the following error:

Automatic encoder selection failed for output stream #0:1. Default encoder for format stream_segment,ssegment (codec none) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:1

The #0:1 stream is a DTS audio stream, the #0:2 is a subtitle (subrip) stream:

  Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Audio English
      BPS             : 1508999
      BPS-eng         : 1508999
      DURATION        : 02:00:51.211000000
      DURATION-eng    : 02:00:51.211000000
      NUMBER_OF_FRAMES: 679801
      NUMBER_OF_FRAMES-eng: 679801
      NUMBER_OF_BYTES : 1367759612
      NUMBER_OF_BYTES-eng: 1367759612
      _STATISTICS_WRITING_APP: mkvmerge v7.2.0 ('On Every Street') 64bit built on Sep 13 2014 15:52:10
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.2.0 ('On Every Street') 64bit built on Sep 13 2014 15:52:10
      _STATISTICS_WRITING_DATE_UTC: 2014-11-15 20:54:11
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-11-15 20:54:11
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

I was expecting ffmpeg to auto-detect the DTS codec and transcode it to MP3, is this error an expected behavior ?

Change History (3)

comment:1 by AlexPress0, 2 years ago

Description: modified (diff)

comment:2 by AlexPress0, 2 years ago

After a few tests, I noticed that, when mapping the audio stream (adding -map 0:1) it stopped to give an error on the stream #0:1 and then gave the same error for the stream #0:2, which is a subrip subtitles stream.

Specifying the subtitles codec (-scodec srt) makes the encoding work for the video and the audio, but the console always gives that warning:

[mpegts @ 000001d381f0a1c0] Stream 2, codec subrip, is muxed as a private data stream and may not be recognized upon reading.

Tried to read the files with VLC, there was no subtitles displayed

comment:3 by Carl Eugen Hoyos, 19 months ago

Component: ffmpegundetermined
Keywords: DTS m3u8 autodetect removed
Resolution: needs_more_info
Status: newclosed
Version: 4.4.1unspecified

Please reopen this ticket if the issue is reproducible with current FFmpeg git head and if you can provide the command line you tested together with the complete, uncut console output.

Note: See TracTickets for help on using tickets.