FFMPEG Code Snippets

This article covers many snippets of information for the FFMPEG format.

Written By engineerisaac

Posted: Wed, Apr 15, 2020 at 2:32 PM - Showing 420 Views

FFMPEG Render Video Stream from RTSP for 600 seconds

ffmpeg -i rtsp://admin:qwer1234@ -an -segment_time 600 -vcodec copy /home/admin/web/lyra.bl3.co/public_html/media/HDcamera/cam1.mp4

ffmpeg -y -i rtsp://admin:admin@ -vframes 1 /var/www/html/media/HDcamera/cam1.jpg

* FFMPEG ** Record 30 Second Video From RTSP
ffmpeg -i rtsp://admin:qwer1234@ -y -an -t 00:00:30 -vcodec copy /home/admin/web/lyra.bl3.co/public_html/media/HDcamera/cam1.mp4

Convert Video Format
ffmpeg -i video.mp4 video.avi

Run Live Stream to HLS from RTSP

ffmpeg -v info
-i rtsp://admin:qwer1234@
-c:v copy -c:a copy -bufsize 1835k -pix_fmt yuv420p
-flags -global_header
-hls_time 10 -hls_list_size 6 -hls_wrap 10
-start_number 1 /home/admin/web/lyra.bl3.co/public_html/media/HDcamera/file_name.m3u8

ffmpeg -i rtsp://admin:admin@ -c copy -flags +global_header -f segment -segment_time 60 -segment_format_options movflags=+faststart -reset_timestamps 1 /var/www/html/media/stream/output.mp4

#scripts #ffmpeg