How to convert a UDP stream to HLS using ffmpeg

1

My question is the following: I use the ffmpeg codec for various purposes, and I had this problem of converting a udp stream to HLS, tried several forms already, and read several tutorials, nothing that was objective, the idea would convert a multicast udp stream and transcode it to HLS, if anyone can help thank you.

    
asked by anonymous 15.08.2017 / 19:15

1 answer

2

Assuming that the input video codec is H.264 or H.265 and the audio codec is AAC the command would be:

ffmpeg -i udp://localhost:1234 -c copy -f hls index.m3u8

If the codecs are not those mentioned above, you can do the transcoding like this:

ffmpeg -i udp://localhost:1234 -c:v x264 -c:a aac -f hls index.m3u8
    
22.01.2018 / 12:09