Warm tip: This article is reproduced from serverfault.com, please click

No Output when transcoding RTP to HLS with ffmpeg

发布于 2020-12-26 18:17:09

I am running ubuntu 18.04(bionic) and i have generated a live RTP stream from kurento-media-server and i am converting it to HLS with this command of ffmpeg:

ffmpeg -protocol_whitelist file,udp,rtp -i rtp://127.0.0.1:55000 -vcodec libx264 -acodec libfdk_aac -f hls /live-stream/kurento-rtmp/hls/playlist.m3u8

However. it shows this output and doesn't do anything and stays there. Any ideas why this is happening are really appreciated.

ffmpeg version 4.3.1-0york0~18.04 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --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-librsvg --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-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared


  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100

I believe that at this stage ffmpeg is trying to determine the duration of input stream but since it is live it will never finish. If so, how would i flag ffmpeg that it is a live stream and not a local video.

Questioner
Adnan Ahmed
Viewed
0
Adnan Ahmed 2020-12-27 02:50:52

I solved the issue by using -re flag which slows down ffmpeg to not read the whole stream at once and get frame by frame however, i should have passed sdp file instead of rtp uri because it gives this error:

[rtp @ 0x55bee6277180] Unable to receive RTP payload type 96 without an SDP file describing it