[FFmpeg-user] Should ffmpeg automatically detect live_flv?

Marian Klymov nekto1989 at gmail.com
Tue Nov 29 20:33:31 EET 2022


Hi,

While trying to build ffmpeg without parts that I don't use, I've
noticed that without flv demuxer ffmpeg can't automatically use
live_flv. Is this intended behavior? If I build ffmpeg with both flv
and live_flv, ffmpeg automatically uses flv.

I'm attaching log files.

0_without_flv.txt - no explicit type, only live_flv demuxer is
present - fails.
1_live_flv_explicit.txt - -f live_flv, only live_flv demuxer is
present - works.
2_with_flv.txt - no explicit type, both flv and live_flv are
present, ffmpeg chooses flv - works.

Best regards,
Marian Klymov
-------------- next part --------------
ffmpeg -v debug -i rtmp://127.0.0.1/live/test
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219
  configuration: --enable-version3 --enable-gpl --enable-nonfree --disable-static --enable-shared --disable-everything --disable-runtime-cpudetect --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-debug --enable-bsf=extract_extradata --enable-protocol=rtmp --enable-protocol=rtmps --enable-protocol=tls --enable-demuxer=live_flv --enable-muxer=flv --enable-decoder=h264 --enable-decoder=aac --enable-parser=h264 --enable-parser=aac --enable-openssl --disable-iconv --extra-cflags='-march=native'
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtmp://127.0.0.1/live/test'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://127.0.0.1/live/test.
Successfully parsed a group of options.
Opening an input file: rtmp://127.0.0.1/live/test.
[NULL @ 0x7f861e0db0c0] Opening 'rtmp://127.0.0.1/live/test' for reading
[rtmp @ 0x7f861e043ec0] No default whitelist set
[tcp @ 0x7f861e01af00] No default whitelist set
[tcp @ 0x7f861e01af00] Original list of addresses:
[tcp @ 0x7f861e01af00] Address 127.0.0.1 port 1935
[tcp @ 0x7f861e01af00] Interleaved list of addresses:
[tcp @ 0x7f861e01af00] Address 127.0.0.1 port 1935
[tcp @ 0x7f861e01af00] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7f861e01af00] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7f861e043ec0] Handshaking...
[rtmp @ 0x7f861e043ec0] Type answer 3
[rtmp @ 0x7f861e043ec0] Server version 13.14.10.13
[rtmp @ 0x7f861e043ec0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x7f861e043ec0] Window acknowledgement size = 5000000
[rtmp @ 0x7f861e043ec0] Max sent, unacked = 5000000
[rtmp @ 0x7f861e043ec0] New incoming chunk size = 4096
[rtmp @ 0x7f861e043ec0] Creating stream...
[rtmp @ 0x7f861e043ec0] Sending play command for 'test'
[AVIOContext @ 0x7f861dcf1a40] Statistics: 1081531 bytes read, 0 seeks
[rtmp @ 0x7f861e043ec0] Deleting stream...
rtmp://127.0.0.1/live/test: Invalid data found when processing input


-------------- next part --------------
ffmpeg -v debug -i rtmp://127.0.0.1/live/test
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219
  configuration: --enable-version3 --enable-gpl --enable-nonfree --disable-static --enable-shared --disable-everything --disable-runtime-cpudetect --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-debug --enable-bsf=extract_extradata --enable-protocol=rtmp --enable-protocol=rtmps --enable-protocol=tls --enable-demuxer=flv --enable-demuxer=live_flv --enable-muxer=flv --enable-decoder=h264 --enable-decoder=aac --enable-parser=h264 --enable-parser=aac --enable-openssl --disable-iconv --extra-cflags='-march=native'
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtmp://127.0.0.1/live/test'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://127.0.0.1/live/test.
Successfully parsed a group of options.
Opening an input file: rtmp://127.0.0.1/live/test.
[NULL @ 0x7f42783430c0] Opening 'rtmp://127.0.0.1/live/test' for reading
[rtmp @ 0x7f42782abec0] No default whitelist set
[tcp @ 0x7f4278282f00] No default whitelist set
[tcp @ 0x7f4278282f00] Original list of addresses:
[tcp @ 0x7f4278282f00] Address 127.0.0.1 port 1935
[tcp @ 0x7f4278282f00] Interleaved list of addresses:
[tcp @ 0x7f4278282f00] Address 127.0.0.1 port 1935
[tcp @ 0x7f4278282f00] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7f4278282f00] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7f42782abec0] Handshaking...
[rtmp @ 0x7f42782abec0] Type answer 3
[rtmp @ 0x7f42782abec0] Server version 13.14.10.13
[rtmp @ 0x7f42782abec0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x7f42782abec0] Window acknowledgement size = 5000000
[rtmp @ 0x7f42782abec0] Max sent, unacked = 5000000
[rtmp @ 0x7f42782abec0] New incoming chunk size = 4096
[rtmp @ 0x7f42782abec0] Creating stream...
[rtmp @ 0x7f42782abec0] Sending play command for 'test'
[flv @ 0x7f42783430c0] Format flv probed with size=2048 and score=100
[flv @ 0x7f42783430c0] Before avformat_find_stream_info() pos: 13 bytes read:65536 seeks:0 nb_streams:0
[NULL @ 0x7f4277f8c8c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[NULL @ 0x7f4277f8c8c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[NULL @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7f4277f8c8c0] Format yuv420p chosen by get_format().
[h264 @ 0x7f4277f8c8c0] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f4277f8c8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7f4277f8c8c0] ct_type:0 pic_struct:3
    Last message repeated 34 times
[flv @ 0x7f42783430c0] All info found
[flv @ 0x7f42783430c0] After avformat_find_stream_info() pos: 1447465 bytes read:1447465 seeks:0 frames:116
Input #0, flv, from 'rtmp://127.0.0.1/live/test':
  Metadata:
    |RtmpSampleAccess: true
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 1920
    displayHeight   : 1080
    fps             : 25
    profile         :
    level           :
  Duration: 00:00:00.00, start: 83540.987000, bitrate: N/A
  Stream #0:0, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, top first, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 25 fps, 25 tbr, 1k tbn
  Stream #0:1, 75, 1/1000: Audio: aac (LC), 48000 Hz, stereo, fltp, 206 kb/s
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0x7f4277f59a40] Statistics: 1447465 bytes read, 0 seeks
[rtmp @ 0x7f42782abec0] Deleting stream...
-------------- next part --------------
ffmpeg -v debug -f live_flv -i rtmp://127.0.0.1/live/test
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219
  configuration: --enable-version3 --enable-gpl --enable-nonfree --disable-static --enable-shared --disable-everything --disable-runtime-cpudetect --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-debug --enable-bsf=extract_extradata --enable-protocol=rtmp --enable-protocol=rtmps --enable-protocol=tls --enable-demuxer=live_flv --enable-muxer=flv --enable-decoder=h264 --enable-decoder=aac --enable-parser=h264 --enable-parser=aac --enable-openssl --disable-iconv --extra-cflags='-march=native'
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'live_flv'.
Reading option '-i' ... matched as input url with argument 'rtmp://127.0.0.1/live/test'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://127.0.0.1/live/test.
Applying option f (force format) with argument live_flv.
Successfully parsed a group of options.
Opening an input file: rtmp://127.0.0.1/live/test.
[live_flv @ 0x7ff0f76f10c0] Opening 'rtmp://127.0.0.1/live/test' for reading
[rtmp @ 0x7ff0f7659ec0] No default whitelist set
[tcp @ 0x7ff0f7630f00] No default whitelist set
[tcp @ 0x7ff0f7630f00] Original list of addresses:
[tcp @ 0x7ff0f7630f00] Address 127.0.0.1 port 1935
[tcp @ 0x7ff0f7630f00] Interleaved list of addresses:
[tcp @ 0x7ff0f7630f00] Address 127.0.0.1 port 1935
[tcp @ 0x7ff0f7630f00] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7ff0f7630f00] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7ff0f7659ec0] Handshaking...
[rtmp @ 0x7ff0f7659ec0] Type answer 3
[rtmp @ 0x7ff0f7659ec0] Server version 13.14.10.13
[rtmp @ 0x7ff0f7659ec0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x7ff0f7659ec0] Window acknowledgement size = 5000000
[rtmp @ 0x7ff0f7659ec0] Max sent, unacked = 5000000
[rtmp @ 0x7ff0f7659ec0] New incoming chunk size = 4096
[rtmp @ 0x7ff0f7659ec0] Creating stream...
[rtmp @ 0x7ff0f7659ec0] Sending play command for 'test'
[live_flv @ 0x7ff0f76f10c0] Before avformat_find_stream_info() pos: 13 bytes read:524 seeks:0 nb_streams:0
[NULL @ 0x7ff0f7327880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[NULL @ 0x7ff0f7327880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[NULL @ 0x7ff0f7327880] ct_type:0 pic_struct:3
[h264 @ 0x7ff0f7327880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff0f7327880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff0f7327880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff0f7327880] Format yuv420p chosen by get_format().
[h264 @ 0x7ff0f7327880] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 1 times
[h264 @ 0x7ff0f7327880] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff0f7327880] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x7ff0f7327880] ct_type:0 pic_struct:3
    Last message repeated 34 times
[live_flv @ 0x7ff0f76f10c0] All info found
[live_flv @ 0x7ff0f76f10c0] After avformat_find_stream_info() pos: 1770994 bytes read:1770994 seeks:0 frames:116
Input #0, live_flv, from 'rtmp://127.0.0.1/live/test':
  Metadata:
    |RtmpSampleAccess: true
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 1920
    displayHeight   : 1080
    fps             : 25
    profile         :
    level           :
  Duration: 00:00:00.00, start: 84029.427000, bitrate: N/A
  Stream #0:0, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, top first, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 25 fps, 25 tbr, 1k tbn
  Stream #0:1, 75, 1/1000: Audio: aac (LC), 48000 Hz, stereo, fltp, 206 kb/s
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0x7ff0f7630b40] Statistics: 1770994 bytes read, 0 seeks
[rtmp @ 0x7ff0f7659ec0] Deleting stream...


More information about the ffmpeg-user mailing list