[FFmpeg-trac] #10177(undetermined:new): FFMPEG Demuxer-Muxer unable to operate with all input information: -r and -copy_unknown not working

FFmpeg trac at avcodec.org
Tue Feb 7 19:48:17 EET 2023


#10177: FFMPEG Demuxer-Muxer unable to operate with all input information: -r and
-copy_unknown not working
-------------------------------------+-------------------------------------
             Reporter:  Javier       |                     Type:  defect
  Delgado del Cerro                  |
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  5.0.2
  undetermined                       |
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I am using FFMPEG as a demuxer-muxer to receive a MPEG source with audio
 and video streams, separate the streams and introduce the least possible
 delay. I have all the information about the input, including the
 container, codecs, audio and video rate, and audio channels.


 I've been researching the different options that FFMPEG provides, and I've
 found the following ones which could help me:
 - `-codec:a` and `-codec:v` to provide the information about the input's
 audio and video codecs.
 - `-f` to provide the information about the used container.
 - `-r:v` to provide the information about the video framerate. (I've also
 tried with `-framerate`, but it seems that is only supported by a few
 demuxers, and mpeg is not one of them).
 - `-probesize` to avoid spending time probing the input, as I can provide
 the inpromation.
 - `-copy_unknown` to simply copy the streams instead of failing if it
 can't be recognized.


 With all this, I'm using the following command:
 `./ffmpeg -hide_banner -loglevel debug -codec:v h264 -codec:a pcm_alaw
 -flags low_delay -probesize 32 -analyzeduration 0 -r:v 15 -f mpeg -i
 udp://127.0.0.1:41071?listen -y -map 0:a:0? -acodec copy -copy_unknown -ar
 8000 -payload_type 8 -f rtp udp://127.0.0.1:33605?pkt_size=1200 -map
 0:v:0? -vcodec copy -copy_unknown -payload_type 96 -f rtp
 udp://127.0.0.1:48527?pkt_size=1200`

 Which outputs:
 {{{
 Splitting the commandline.
 Reading option '-hide_banner' ... matched as option 'hide_banner' (do not
 show program banner) with argument '1'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument 'debug'.
 Reading option '-codec:v' ... matched as option 'codec' (codec name) with
 argument 'h264'.
 Reading option '-codec:a' ... matched as option 'codec' (codec name) with
 argument 'pcm_alaw'.
 Reading option '-flags' ... matched as AVOption 'flags' with argument
 'low_delay'.
 Reading option '-probesize' ... matched as AVOption 'probesize' with
 argument '32'.
 Reading option '-analyzeduration' ... matched as AVOption
 'analyzeduration' with argument '0'.
 Reading option '-r:v' ... matched as option 'r' (set frame rate (Hz value,
 fraction or abbreviation)) with argument '15'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'mpeg'.
 Reading option '-i' ... matched as input url with argument
 'udp://127.0.0.1:41071?listen'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option '-map' ... matched as option 'map' (set input stream
 mapping) with argument '0:a:0?'.
 Reading option '-acodec' ... matched as option 'acodec' (force audio codec
 ('copy' to copy stream)) with argument 'copy'.
 Reading option '-copy_unknown' ... matched as option 'copy_unknown' (Copy
 unknown stream types) with argument '1'.
 Reading option '-ar' ... matched as option 'ar' (set audio sampling rate
 (in Hz)) with argument '8000'.
 Reading option '-payload_type' ... matched as AVOption 'payload_type' with
 argument '8'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'rtp'.
 Reading option 'udp://127.0.0.1:33605?pkt_size=1200' ... matched as output
 url.
 Reading option '-map' ... matched as option 'map' (set input stream
 mapping) with argument '0:v:0?'.
 Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
 ('copy' to copy stream)) with argument 'copy'.
 Reading option '-copy_unknown' ... matched as option 'copy_unknown' (Copy
 unknown stream types) with argument '1'.
 Reading option '-payload_type' ... matched as AVOption 'payload_type' with
 argument '96'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'rtp'.
 Reading option 'udp://127.0.0.1:48527?pkt_size=1200' ... matched as output
 url.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option hide_banner (do not show program banner) with argument 1.
 Applying option loglevel (set logging level) with argument debug.
 Applying option y (overwrite output files) with argument 1.
 Applying option copy_unknown (Copy unknown stream types) with argument 1.
     Last message repeated 1 times
 Successfully parsed a group of options.
 Parsing a group of options: input url udp://127.0.0.1:41071?listen.
 Applying option codec:v (codec name) with argument h264.
 Applying option codec:a (codec name) with argument pcm_alaw.
 Applying option r:v (set frame rate (Hz value, fraction or abbreviation))
 with argument 15.
 Applying option f (force format) with argument mpeg.
 Successfully parsed a group of options.
 Opening an input file: udp://127.0.0.1:41071?listen.
 [mpeg @ 0x55a769cc3d40] Opening 'udp://127.0.0.1:41071?listen' for reading
 [udp @ 0x55a769cc4b00] No default whitelist set
 [udp @ 0x55a769cc4b00] end receive buffer size reported is 425984
 [mpeg @ 0x55a769cc3d40] Before avformat_find_stream_info() pos: 6 bytes
 read:40 seeks:0 nb_streams:0
 [mpeg @ 0x55a769cc3d40] probing stream 1 pp:2500
 [mpeg @ 0x55a769cc3d40] probed stream 1
 [mpeg @ 0x55a769cc3d40] parser not found for codec pcm_alaw, packets or
 times may be invalid.
 [mpeg @ 0x55a769cc3d40] Probe buffer size limit of 32 bytes reached
 [mpeg @ 0x55a769cc3d40] Stream #0: not enough frames to estimate rate;
 consider increasing probesize
 [mpeg @ 0x55a769cc3d40] Could not find codec parameters for stream 0
 (Video: h264, 1 reference frame, none): unspecified size
 Consider increasing the value for the 'analyzeduration' (0) and
 'probesize' (32) options
 [mpeg @ 0x55a769cc3d40] After avformat_find_stream_info() pos: 87804 bytes
 read:88476 seeks:0 frames:1
 Input #0, mpeg, from 'udp://127.0.0.1:41071?listen':
   Duration: N/A, start: 50436.772978, bitrate: 64 kb/s
   Stream #0:0[0x1e0], 0, 1/90000: Video: h264, 1 reference frame, none,
 90k tbr, 90k tbn
   Stream #0:1[0x1c0], 1, 1/90000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64
 kb/s
 Successfully opened the file.
 Parsing a group of options: output url
 udp://127.0.0.1:33605?pkt_size=1200.
 Applying option map (set input stream mapping) with argument 0:a:0?.
 Applying option acodec (force audio codec ('copy' to copy stream)) with
 argument copy.
 Applying option ar (set audio sampling rate (in Hz)) with argument 8000.
 Applying option f (force format) with argument rtp.
 Successfully parsed a group of options.
 Opening an output file: udp://127.0.0.1:33605?pkt_size=1200.
 [udp @ 0x55a769cf6500] No default whitelist set
 Successfully opened the file.
 Parsing a group of options: output url
 udp://127.0.0.1:48527?pkt_size=1200.
 Applying option map (set input stream mapping) with argument 0:v:0?.
 Applying option vcodec (force video codec ('copy' to copy stream)) with
 argument copy.
 Applying option f (force format) with argument rtp.
 Successfully parsed a group of options.
 Opening an output file: udp://127.0.0.1:48527?pkt_size=1200.
 [udp @ 0x55a769d08fc0] No default whitelist set
 Successfully opened the file.
 Output #0, rtp, to 'udp://127.0.0.1:33605?pkt_size=1200':
   Metadata:
     encoder         : Lavf59.16.100
   Stream #0:0, 0, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
 [rtp @ 0x55a769d06f40] dimensions not set
 Could not write header for output file #1 (incorrect codec parameters ?):
 Invalid argument
 Error initializing output stream 1:0 --
 Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #1:0 (copy)
     Last message repeated 1 times
 [AVIOContext @ 0x55a769d06d40] Statistics: 0 bytes written, 0 seeks, 0
 writeouts
 [AVIOContext @ 0x55a769d19800] Statistics: 0 bytes written, 0 seeks, 0
 writeouts
 [AVIOContext @ 0x55a769cd4fc0] Statistics: 88476 bytes read, 0 seeks
 }}}

 Expected behavior:
 FFMPEG should be able to operate with all input information and avoid
 using a large probesize, resulting in the least possible latency. FFMPEG
 should not crush, as the `-copy_unknown` option is specified (I've also
 tried specifying it on the input, but the result is the same)

 Actual behavior:
 FFMPEG is unable to operate without specifying a large probesize, leading
 to increased latency and in some cases, failure. The `-copy_unknown` and
 `-re:v 15` options are ignored.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10177>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list