[FFmpeg-trac] #11134(undetermined:new): [out#0/* @ 0x*] Error opening output zmq:tcp://127.0.0.1:5555: Invalid argument
FFmpeg
trac at avcodec.org
Fri Aug 9 20:03:56 EEST 2024
#11134: [out#0/* @ 0x*] Error opening output zmq:tcp://127.0.0.1:5555: Invalid
argument
-------------------------------------+-------------------------------------
Reporter: | Owner: (none)
iconoclasthero |
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: git-master | Resolution:
Keywords: zmq | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by iconoclasthero:
Old description:
> zmq streaming not working. ffmpeg compiled with --enable-libzmq.
> the fifo it's trying to pull from works to output an encoded file.
> no observed discrepancy between the documentation and the general use of
> the commands below.
>
> Summary of the bug:
> How to reproduce:
> {{{
> $ ffmpeg -y -nostdin -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts
> zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x59859674ad80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x5985967552c0] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/mpegts @ 0x59859674af00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -y -nostdin -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f nut
> -c:a libopus -b:a 128k zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x5c7cab802e00] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x5c7cab807680] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/nut @ 0x5c7cab802fc0] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a libopus
> zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x5cc5bf825d80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x5cc5bf829680] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/mpegts @ 0x5cc5bf825f00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f webm -c:a libopus
> output.webm
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x59dc60f39d80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> Stream mapping:
> Stream #0:0 -> #0:0 (pcm_s16le (native) -> opus (libopus))
> Press [q] to stop, [?] for help
> [libopus @ 0x59dc60e6a140] No bit rate set. Defaulting to 96000 bps.
> Output #0, webm, to 'output.webm':
> Metadata:
> encoder : Lavf61.5.101
> Stream #0:0: Audio: opus, 48000 Hz, stereo, s16, 96 kb/s
> Metadata:
> encoder : Lavc61.11.100 libopus
> [out#0/webm @ 0x59dc60f39f00] video:0KiB audio:535KiB subtitle:0KiB other
> streams:0KiB global headers:0KiB muxing overhead: 2.809126%
> size= 550KiB time=00:00:41.72 bitrate= 108.0kbits/s speed=1.11x
> Exiting normally, received signal 2.
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f webm -c:a libopus
> zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x5bcd76aeed80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x5bcd76af2640] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/webm @ 0x5bcd76aeef00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f nut -c:a libopus
> zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x5dc04e7a2d80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x5dc04e7a7580] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/nut @ 0x5dc04e7a2f00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a libopus
> zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x58b7489edd80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x58b7489f1680] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/mpegts @ 0x58b7489edf00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
>
> $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a
> libmp3lame zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> [aist#0:0/pcm_s16le @ 0x644f50028d80] Guessed Channel Layout: stereo
> Input #0, s16le, from '/tmp/mpd.fifo':
> Duration: N/A, bitrate: 1536 kb/s
> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> [zmq @ 0x644f5002c680] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/mpegts @ 0x644f50028f00] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
> }}}
>
> mpd fifo output:
> {{{
> audio_output {
> type "fifo"
> name "mpd.fifo"
> path "/tmp/mpd.fifo"
> format "48000:16:2"
> }
> }}}
>
> and if I'm not using the zmq streaming protocol:
>
> {{{ $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -c:a libopus
> output.opus }}}
>
> produces `output.opus` which vlc can play.
>
> https://www.ffmpeg.org/ffmpeg-protocols.html#zmq
>
> 3.45 zmq
> ZeroMQ asynchronous messaging using the libzmq library.
>
> This library supports unicast streaming to multiple clients without
> relying on an external server.
>
> The required syntax for streaming or connecting to a stream is:
>
> zmq:tcp://ip-address:port
> Example: Create a localhost stream on port 5555:
>
> ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
> Multiple clients may connect to the stream using:
>
> ffplay zmq:tcp://127.0.0.1:5555
> Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub
> pattern. The server side binds to a port and publishes data. Clients
> connect to the server (via IP address/port) and subscribe to the
> stream. The order in which the server and client start generally does
> not matter.
>
> ffmpeg must be compiled with the –enable-libzmq option to support this
> protocol.
>
> Options can be set on the ffmpeg/ffplay command line. The following
> options are supported:
>
> pkt_size
> Forces the maximum packet size for sending/receiving data. The default
> value is 131,072 bytes. On the server side, this sets the maximum size of
> sent packets via ZeroMQ. On the clients, it sets an internal buffer size
> for receiving packets. Note that pkt_size on the clients should be equal
> to or greater than pkt_size on the server. Otherwise the received message
> may be truncated causing decoding errors.
>
> It doesn't seem to be specifically related to the fifo as the input:
> {{{
> $ ffmpeg -i /library/music/Grateful\ Dead/Grateful\ Dead\ --\ American\
> Beauty\ \(1970\)/Grateful\ Dead\ --\ 01-01\ -\ Box\ of\ Rain.flac -f
> mpegts -c:a libmp3lame zmq:tcp://127.0.0.1:5555
> ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
> configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
> --extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
> libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
> libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
> libpulse --enable-libzmq
> libavutil 59. 31.100 / 59. 31.100
> libavcodec 61. 11.100 / 61. 11.100
> libavformat 61. 5.101 / 61. 5.101
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.102 / 10. 2.102
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> libpostproc 58. 2.100 / 58. 2.100
> Input #0, flac, from '/library/music/Grateful Dead/Grateful Dead --
> American Beauty (1970)/Grateful Dead -- 01-01 - Box of Rain.flac':
> Metadata:
> HDTRACKS : www.hdtracks.com
> Genre : Rock
> DATE : 2013
> TITLE : Box of Rain
> RELEASECOUNTRY : DE
> TOTALDISCS : 1
> LABEL : Warner Bros. Records
> TOTALTRACKS : 10
> MUSICBRAINZ_ALBUMARTISTID: 6faa7ca7-0d99-4a5e-bfa6-1fd5037520c6
> disc : 1
> TRACKTOTAL : 10
> MUSICBRAINZ_RELEASETRACKID: fa73ff0a-dcb0-45f1-90f9-8983fac62f03
> ASIN : B000002KBH
> ALBUMARTISTSORT : Grateful Dead
> ORIGINALDATE : 1970-11-01
> SCRIPT : Latn
> MUSICBRAINZ_ALBUMID: f2319009-d9b8-4afe-aa18-f56285e74700
> RELEASESTATUS : official
> album_artist : Grateful Dead
> ACOUSTID_ID : be3a0ec2-bf35-4ba7-9c10-4322341aa748
> CATALOGNUMBER : 7599-27190-2
> ALBUM : American Beauty
> MUSICBRAINZ_ARTISTID: 6faa7ca7-0d99-4a5e-bfa6-1fd5037520c6
> MEDIA : CD
> RELEASETYPE : album
> ORIGINALYEAR : 1970
> PERFORMER : Pig Pen (Ron McKernan) (harmonica);Phil Lesh
> (bass);Mickey Hart (percussion);Jerry Garcia (guitar);Bob Weir
> (guitar);Phil Lesh (guitar);Jerry Garcia (vocals);Pig Pen (Ron McKernan)
> (vocals);Bob Weir (vocals);Phil Lesh (vocals);Jerry Garcia (pedal steel
> gu
> ISRC : USWB10100674
> MUSICBRAINZ_RELEASEGROUPID: 994c2c59-d32f-304e-8f53-bda17a254f52
> DISCTOTAL : 1
> ARTIST : Grateful Dead
> BARCODE : 07599271902
> MUSICBRAINZ_TRACKID: d715a3eb-1d69-4ac0-bbc6-a59485db4459
> ARTISTSORT : Grateful Dead
> ARTISTS : Grateful Dead
> track : 01
> replaygain_track_gain: -4.76000000 dB
> replaygain_track_peak: 1.00425768
> replaygain_reference_loudness: 89 dB
> replaygain_album_gain: -4.18000000 dB
> replaygain_album_peak: 1.00425768
> Duration: 00:05:18.92, start: 0.000000, bitrate: 5972 kb/s
> Stream #0:0: Audio: flac, 192000 Hz, stereo, s32 (24 bit)
> Side data:
> replaygain: track gain - -4.760000, track peak - 0.000023, album
> gain - -4.180000, album peak - 0.000023,
> Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc,
> bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn
> (attached pic)
> Metadata:
> comment : Cover (front)
> [zmq @ 0x5927538f5040] URL tcp://127.0.0.1:5555 lacks prefix
> [out#0/mpegts @ 0x59275388eac0] Error opening output
> zmq:tcp://127.0.0.1:5555: Invalid argument
> Error opening output file zmq:tcp://127.0.0.1:5555.
> Error opening output files: Invalid argument
> }}}
New description:
zmq streaming not working. ffmpeg compiled with --enable-libzmq.
the fifo it's trying to pull from works to output an encoded file.
no observed discrepancy between the documentation and the general use of
the commands below.
Summary of the bug:
How to reproduce:
{{{
$ ffmpeg -y -nostdin -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts
zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x59859674ad80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x5985967552c0] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/mpegts @ 0x59859674af00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -y -nostdin -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f nut -c:a
libopus -b:a 128k zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x5c7cab802e00] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x5c7cab807680] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/nut @ 0x5c7cab802fc0] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a libopus
zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x5cc5bf825d80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x5cc5bf829680] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/mpegts @ 0x5cc5bf825f00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f webm -c:a libopus
output.webm
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x59dc60f39d80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0x59dc60e6a140] No bit rate set. Defaulting to 96000 bps.
Output #0, webm, to 'output.webm':
Metadata:
encoder : Lavf61.5.101
Stream #0:0: Audio: opus, 48000 Hz, stereo, s16, 96 kb/s
Metadata:
encoder : Lavc61.11.100 libopus
[out#0/webm @ 0x59dc60f39f00] video:0KiB audio:535KiB subtitle:0KiB other
streams:0KiB global headers:0KiB muxing overhead: 2.809126%
size= 550KiB time=00:00:41.72 bitrate= 108.0kbits/s speed=1.11x
Exiting normally, received signal 2.
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f webm -c:a libopus
zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x5bcd76aeed80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x5bcd76af2640] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/webm @ 0x5bcd76aeef00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f nut -c:a libopus
zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x5dc04e7a2d80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x5dc04e7a7580] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/nut @ 0x5dc04e7a2f00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a libopus
zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x58b7489edd80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x58b7489f1680] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/mpegts @ 0x58b7489edf00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
$ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -f mpegts -c:a
libmp3lame zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
[aist#0:0/pcm_s16le @ 0x644f50028d80] Guessed Channel Layout: stereo
Input #0, s16le, from '/tmp/mpd.fifo':
Duration: N/A, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[zmq @ 0x644f5002c680] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/mpegts @ 0x644f50028f00] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
}}}
mpd fifo output:
{{{
audio_output {
type "fifo"
name "mpd.fifo"
path "/tmp/mpd.fifo"
format "48000:16:2"
}
}}}
and if I'm not using the zmq streaming protocol:
{{{ $ ffmpeg -f s16le -ar 48000 -ac 2 -i /tmp/mpd.fifo -c:a libopus
output.opus }}}
produces `output.opus` which vlc can play.
https://www.ffmpeg.org/ffmpeg-protocols.html#zmq
3.45 zmq
ZeroMQ asynchronous messaging using the libzmq library.
This library supports unicast streaming to multiple clients without
relying on an external server.
The required syntax for streaming or connecting to a stream is:
zmq:tcp://ip-address:port
Example: Create a localhost stream on port 5555:
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
Multiple clients may connect to the stream using:
ffplay zmq:tcp://127.0.0.1:5555
Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub
pattern. The server side binds to a port and publishes data. Clients
connect to the server (via IP address/port) and subscribe to the
stream. The order in which the server and client start generally does
not matter.
ffmpeg must be compiled with the –enable-libzmq option to support this
protocol.
Options can be set on the ffmpeg/ffplay command line. The following
options are supported:
pkt_size
Forces the maximum packet size for sending/receiving data. The default
value is 131,072 bytes. On the server side, this sets the maximum size of
sent packets via ZeroMQ. On the clients, it sets an internal buffer size
for receiving packets. Note that pkt_size on the clients should be equal
to or greater than pkt_size on the server. Otherwise the received message
may be truncated causing decoding errors.
It doesn't seem to be specifically related to the fifo as the input:
{{{
$ ffmpeg -i /library/music/Grateful\ Dead/Grateful\ Dead\ --\ American\
Beauty\ \(1970\)/Grateful\ Dead\ --\ 01-01\ -\ Box\ of\ Rain.flac -f
mpegts -c:a libmp3lame zmq:tcp://127.0.0.1:5555
ffmpeg version N-116515-gd527d23872 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 14 (Ubuntu 14.1.0-5ubuntu1)
configuration: --bindir=/usr/local/bin --prefix=/cache/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/cache/ffmpeg_build/include
--extra-ldflags=-L/cache/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--ld=g++ --enable-gpl --enable-gnutls --enable-libaom --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-
libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-
libpulse --enable-libzmq
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
Input #0, flac, from '/library/music/Grateful Dead/Grateful Dead --
American Beauty (1970)/Grateful Dead -- 01-01 - Box of Rain.flac':
Metadata:
⋮
Duration: 00:05:18.92, start: 0.000000, bitrate: 5972 kb/s
Stream #0:0: Audio: flac, 192000 Hz, stereo, s32 (24 bit)
Side data:
replaygain: track gain - -4.760000, track peak - 0.000023, album
gain - -4.180000, album peak - 0.000023,
Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc,
bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn
(attached pic)
Metadata:
comment : Cover (front)
[zmq @ 0x5927538f5040] URL tcp://127.0.0.1:5555 lacks prefix
[out#0/mpegts @ 0x59275388eac0] Error opening output
zmq:tcp://127.0.0.1:5555: Invalid argument
Error opening output file zmq:tcp://127.0.0.1:5555.
Error opening output files: Invalid argument
}}}
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11134#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list