[FFmpeg-user] Could not find codec parameters for stream for mp3 audio stream in HLS segment

Gabriel Balaich roderrooder at gmail.com
Mon Nov 22 02:42:18 EET 2021


I'm attempting to concatenate some but not all segments in a m3u8 HLS
segment list, but when I use stream copy I get this error:

Could not find codec parameters for stream 1 (Audio: mp3 (mp3float)
([3][0][0][0] / 0x0003), 0 channels, fltp): unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize'
(5000000) options
Changing


Changing the analyzeduration and probesize to max INT or anything between
has no effect, as the warning suggests. As I dug deeper I noticed that when
probing the initial segment in the new HLS segment list that I generate
(with some but not all segments) many of the audio parameters are not set:

PS C:\Users\gabri> ffprobe -i "Q:\FFmpeg\Segments\D_Camera5872.ts"
-show_streams -print_format json
ffprobe version 2021-06-27-git-49e3a8165c-full_build-www.gyan.dev Copyright
(c) 2007-2021 the FFmpeg developers
  built with gcc 10.3.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma
--enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi
--enable-librav1e --enable-libsvtav1 --enable-libx264 --enable-libx265
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
--enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi
--enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf
--enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec
--enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx
--enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio
--enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa
--enable-libbs2b --enable-libflite --enable-libmysofa
--enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  2.100 / 59.  2.100
  libavformat    59.  3.101 / 59.  3.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.103 /  8.  0.103
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
{
[mpegts @ 0000029b4c761dc0] decoding for stream 0 failed
[mpegts @ 0000029b4c761dc0] start time for stream 1 is not set in
estimate_timings_from_pts
[mpegts @ 0000029b4c761dc0] start time for stream 2 is not set in
estimate_timings_from_pts
[mpegts @ 0000029b4c761dc0] start time for stream 3 is not set in
estimate_timings_from_pts
[mpegts @ 0000029b4c761dc0] start time for stream 4 is not set in
estimate_timings_from_pts
[mpegts @ 0000029b4c761dc0] stream 1 : no TS found at start of file,
duration not set
[mpegts @ 0000029b4c761dc0] stream 2 : no TS found at start of file,
duration not set
[mpegts @ 0000029b4c761dc0] stream 3 : no TS found at start of file,
duration not set
[mpegts @ 0000029b4c761dc0] stream 4 : no TS found at start of file,
duration not set
[mpegts @ 0000029b4c761dc0] Could not find codec parameters for stream 1
(Audio: mp3 (mp3float) ([3][0][0][0] / 0x0003), 0 channels, fltp):
unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize'
(5000000) options
[mpegts @ 0000029b4c761dc0] Could not find codec parameters for stream 2
(Audio: mp3 (mp3float) ([3][0][0][0] / 0x0003), 0 channels, fltp):
unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize'
(5000000) options
[mpegts @ 0000029b4c761dc0] Could not find codec parameters for stream 3
(Audio: mp3 (mp3float) ([3][0][0][0] / 0x0003), 0 channels, fltp):
unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize'
(5000000) options
[mpegts @ 0000029b4c761dc0] Could not find codec parameters for stream 4
(Audio: mp3 (mp3float) ([3][0][0][0] / 0x0003), 0 channels, fltp):
unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize'
(5000000) options
Input #0, mpegts, from 'Q:\FFmpeg\Segments\D_Camera5872.ts':
  Duration: 00:00:06.00, start: 35233.434022, bitrate: 207448 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 90k tbn
  Stream #0:1[0x101]: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, fltp
  Stream #0:2[0x102]: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, fltp
  Stream #0:3[0x103]: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, fltp
  Stream #0:4[0x104]: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, fltp
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "Main",
            "codec_type": "video",
            "codec_tag_string": "[27][0][0][0]",
            "codec_tag": "0x001b",
            "width": 3840,
            "height": 2160,
            "coded_width": 3840,
            "coded_height": 2160,
            "closed_captions": 0,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 52,
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "id": "0x100",
            "r_frame_rate": "60/1",
            "avg_frame_rate": "60/1",
            "time_base": "1/90000",
            "start_pts": 3171009062,
            "start_time": "35233.434022",
            "duration_ts": 540000,
            "duration": "6.000000",
            "bits_per_raw_sample": "8",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            }
        },
        {
            "index": 1,
            "codec_name": "mp3",
            "codec_long_name": "MP3 (MPEG audio layer 3)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "0",
            "channels": 0,
            "bits_per_sample": 0,
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 3171009062,
            "start_time": "35233.434022",
            "duration_ts": 540000,
            "duration": "6.000000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            }
        },
        {
            "index": 2,
            "codec_name": "mp3",
            "codec_long_name": "MP3 (MPEG audio layer 3)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "0",
            "channels": 0,
            "bits_per_sample": 0,
            "id": "0x102",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 3171009062,
            "start_time": "35233.434022",
            "duration_ts": 540000,
            "duration": "6.000000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            }
        },
        {
            "index": 3,
            "codec_name": "mp3",
            "codec_long_name": "MP3 (MPEG audio layer 3)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "0",
            "channels": 0,
            "bits_per_sample": 0,
            "id": "0x103",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 3171009062,
            "start_time": "35233.434022",
            "duration_ts": 540000,
            "duration": "6.000000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            }
        },
        {
            "index": 4,
            "codec_name": "mp3",
            "codec_long_name": "MP3 (MPEG audio layer 3)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "0",
            "channels": 0,
            "bits_per_sample": 0,
            "id": "0x104",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 3171009062,
            "start_time": "35233.434022",
            "duration_ts": 540000,
            "duration": "6.000000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            }
        }
    ]
}

And these are the settings I used to generate that segment, the output of
this command has no errors or warnings (JSON format):
"D_Camera": [
      "-y",
      "-stats_period",
      "2",
      "-guess_layout_max",
      "0",
      "-thread_queue_size",
      "9999",
      "-indexmem",
      "9999",
      "-f",
      "dshow",
      "-rtbufsize",
      "2147.48M",
      "-video_size",
      "3840x2160",
      "-pixel_format",
      "nv12",
      "-i",
      "video=\"Game Capture 4K60 Pro MK.2 (2)\":audio=\"MADI (191+192) (RME
HDSPe MADI FX)\"",
      "-guess_layout_max",
      "0",
      "-thread_queue_size",
      "9999",
      "-indexmem",
      "9999",
      "-f",
      "dshow",
      "-rtbufsize",
      "2147.48M",
      "-i",
      "audio=\"MADI (183+184) (RME HDSPe MADI FX)\"",
      "-guess_layout_max",
      "0",
      "-thread_queue_size",
      "9999",
      "-indexmem",
      "9999",
      "-f",
      "dshow",
      "-rtbufsize",
      "2147.48M",
      "-i",
      "audio=\"MADI (3+4) (RME HDSPe MADI FX)\"",
      "-guess_layout_max",
      "0",
      "-thread_queue_size",
      "9999",
      "-indexmem",
      "9999",
      "-f",
      "dshow",
      "-rtbufsize",
      "2147.48M",
      "-i",
      "audio=\"MADI (181+182) (RME HDSPe MADI FX)\"",
      "-map",
      "0",
      "-map",
      "1",
      "-map",
      "2",
      "-map",
      "3",
      "-c:v",
      "h264_nvenc",
      "-gpu",
      "1",
      "-preset",
      "p1",
      "-pix_fmt",
      "nv12",
      "-r",
      "60",
      "-rc-lookahead",
      "120",
      "-forced-idr",
      "1",
      "-force_key_frames",
      "\"expr:gte(t,n_forced*2)\"",
      "-b:v",
      "200M",
      "-minrate",
      "200M",
      "-maxrate",
      "200M",
      "-bufsize",
      "200M",
      "-c:a",
      "mp3",
      "-ac",
      "2",
      "-ar",
      "48000",
      "-b:a",
      "320k",
      "-vsync",
      "1",
      "-max_muxing_queue_size",
      "9999",
      "-f",
      "hls",
      "-hls_flags",
      "delete_segments",
      "-hls_time",
      "6",
      "-hls_list_size",
      "1500",
      "-hls_segment_filename",
      "\"\\\\192.168.3.4\\A Sexy
Q-Drive\\FFmpeg\\Segments\\D_Camera%01d.ts\"",
      "\"\\\\192.168.3.4\\A Sexy Q-Drive\\FFmpeg\\Segments\\D_Camera.m3u8\""
    ]

I think the issue is that sometimes these audio devices aren't playing any
audio for the duration of the segment, and thus even though I've given the
segment audio parameters they don't populate because there is no data.
Maybe this is wrong? If that is the case though... I wonder if what I need
is some sort of audio filter that just packs in dummy audio when there
isn't any audio in its place.

Whatever the solution I'm hoping this can be solved upon generation of the
segment files and not in post, any help is much appreciated.


More information about the ffmpeg-user mailing list