ubuntuffmpegwebserverrtsphsl

Unable to find a suitable output format for 'ffmpeg' - ffmpeg: Invalid argument


I am trying to work through a tutorial I found online that converts an RTSP URL to a HSL stream. Upon executing the command on ubuntu 20.04, I get the following error:

"[NULL @ 0x55985b9bab80] Unable to find a suitable output format for 'ffmpeg' ffmpeg: Invalid argument"

These were my commands:

ffmpeg -v info \
-i <RTSP URL> \
-c:v copy -c:a copy -bufsize 1835k -pix_fmt yuv420p \
-flags -global_header \
ffmpeg -hls_time 10 -hls_list_size 6 -hls_wrap 10 \
ffmpeg -start_number 1 Home/Documents/ffmpegsolution/video.m3u8

(The example said that I needed to provide my path to output, so I listed the directories that I wanted the file to go to - ffmpegsolution being the folder)

The tutorial I'm using is found on: https://www.thewebblinders.in/programming/article/rtsp-streaming-on-a-web-browser-6069

It essentially shows that you can convert an rtsp url to a HSL file and stream it using html templates, however I can't get passed the conversion stage.

Any help would be appreciated. My thinking is that maybe one of my formats like "m3u8" isn't recognised; however I'm not sure.

Thank you for your time,


Solution

  • It turns out that the directory I needed to be in was through desktop and not in the Root Directory. I also needed to manually add the video file using "touch video.mu38" in the required directory. UDP still times out, but this doesn't generate a notable issue.

    ffmpeg -v info -i <rtsp url> -c:v libx264 -preset ultrafast  \
      -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10  \
      -hls_list_size 6 -hls_wrap 10 -start_number 1 /path/to/output/video.mu38