[FFmpeg-user] Streaming a static image fails
Syehoon Kim
gregfeynman at gmail.com
Tue May 21 09:29:13 EEST 2024
2024년 5월 21일 (화) 오전 1:26, Deon Stoltz <deon at tech-source.co.za>님이 작성:
>
> I need to stream a static image with information on a network to Tv's.
>
> ffmpeg does convert the image to a transport stream but VLC refuse to
> play it as well the TV's. ffplay does play it but complains about
> invalid frame dimensions. I therefore added the frame size but it has no
> effect. Note that the error is still reported in ffplay.
>
> I upgraded to the latest version of ffmpeg (compiled in a subdir
> because Mint version is old and the .deb file did not want to install).
> Any idea what could be the reason?
>
> Cmd used:
>
> ./ffmpeg -y -stream_loop -1 -r 25/1 -i text2.png -f mpegts -s 800x600
> udp://239.1.250.12:1234
> ffmpeg version N-115265-g7e59f02c14 Copyright (c) 2000-2024 the FFmpeg
> developers
> built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
> configuration:
> libavutil 59. 17.100 / 59. 17.100
> libavcodec 61. 5.104 / 61. 5.104
> libavformat 61. 3.103 / 61. 3.103
> libavdevice 61. 2.100 / 61. 2.100
> libavfilter 10. 2.101 / 10. 2.101
> libswscale 8. 2.100 / 8. 2.100
> libswresample 5. 2.100 / 5. 2.100
> Input #0, png_pipe, from 'text2.png':
> Duration: N/A, bitrate: N/A
> Stream #0:0: Video: png, pal8(pc, gbr/unknown/unknown), 800x600 [SAR
> 3780:3780 DAR 4:3], 25 fps, 25 tbr, 25 tbn
> Stream mapping:
> Stream #0:0 -> #0:0 (png (native) -> mpeg2video (native))
> Press [q] to stop, [?] for help
> Output #0, mpegts, to 'udp://239.1.250.12:1234':
> Metadata:
> encoder : Lavf61.3.103
> Stream #0:0: Video: mpeg2video (Main), yuv420p(progressive), 800x600
> [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 90k tbn
> Metadata:
> encoder : Lavc61.5.104 mpeg2video
> Side data:
> cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
N/A
> [out#0/mpegts @ 0x557c16e53ac0] video:48400KiB audio:0KiB subtitle:0KiB
> other streams:0KiB global headers:0KiB muxing overhead: 15.095825%
> frame=20140 fps=1059 q=31.0 Lsize= 55707KiB time=00:13:25.56 bitrate=
> 566.5kbits/s speed=42.4x
> Exiting normally, received signal 2.
>
> Receiving side:
>
> ffplay udp://239.1.250.12:1234
> ffplay version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2003-2021 the FFmpeg
> developers
> built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
> configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1
> --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
> --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
> --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
> --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
> --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite
> --enable-libfontconfig --enable-libfreetype --enable-libfribidi
> --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
> --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
> --enable-libopus --enable-libpulse --enable-librabbitmq
> --enable-librubberband --enable-libshine --enable-libsnappy
> --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh
> --enable-libtheora --enable-libtwolame --enable-libvidstab
> --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265
> --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq
> --enable-libzvbi --enable-lv2 --enable-omx --enable-openal
> --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx
> --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm
> --enable-libiec61883 --enable-chromaprint --enable-frei0r
> --enable-libx264 --enable-shared
> libavutil 56. 70.100 / 56. 70.100
> libavcodec 58.134.100 / 58.134.100
> libavformat 58. 76.100 / 58. 76.100
> libavdevice 58. 13.100 / 58. 13.100
> libavfilter 7.110.100 / 7.110.100
> libswscale 5. 9.100 / 5. 9.100
> libswresample 3. 9.100 / 3. 9.100
> libpostproc 55. 9.100 / 55. 9.100
> [mpeg2video @ 0x7f77d8029e40] Invalid frame dimensions 0x0. f=0/0
> [mpeg2video @ 0x7f77d8029e40] Invalid frame dimensions 0x0. f=0/0
> Last message repeated 3 times
> Input #0, mpegts, from 'udp://239.1.250.12:1234': sq= 0B f=0/0
> Duration: N/A, start: 6196.600000, bitrate: N/A
> Program 1
> Metadata:
> service_name : Service01
> service_provider: FFmpeg
> Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
> yuv420p(tv, progressive), 800x600 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k
> tbn, 50 tbc
> Side data:
> cpb: bitrate max/min/avg: 0/0/0 buffer size: 49152 vbv_delay: N/A
>
> Any help appreciated.
>
After a few search, I found the solution.
First, according to
https://superuser.com/questions/1361198/vlc-3-can-not-play-certain-udp-streams,
you should make udp packets with size 1316, by setting the address udp://
239.1.250.12:1234?pkt_size=1316
Second, vlc should play udp://@239.1.250.12:1234. Without the @, vlc won't
succeed to play the stream.
Hope these help you.
Kim Syehoon
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user
mailing list