Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sat Nov 18, 2017 4:26 pm


Discussions regarding x-server, kde, gnome and other window managers and drivers.

Author Message
mandrei99
Post  Post subject: VLC: How to temporarily record an RTSP stream to a file on disk with vlc  |  Posted: Tue Jan 06, 2015 6:22 pm

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

VLC: How to temporarily record an RTSP stream to a file on disk with vlc

VLC: How to temporarily record an RTSP stream to a file on disk with vlc


Both ffmpeg and vlc can be used to record RTSP/RTP streams to local disks. This is how to record a part of an RTSP stream using vlc:

Code:
cvlc "rtsp://192.168.1.70:554/user=admin&password=&channel=2&stream=0.sdp?real_stream--rtp-caching=100" --sout "#transcode{}:duplicate{dst=std{access=file,mux=ts,dst={filename.mp4}}}" --run-time 60 --stop-time=60 vlc://quit


The "sout" part is self explanatory: it duplicates the content of the stream with destination file on disk. Let's analyse the other options from manual:
Code:
  vlc://quit                     Special item to quit VLC
...
--stop-time=<float>        Stop time
      The stream will stop at this position (in seconds).
  --run-time=<float>         Run time
      The stream will run this duration (in seconds).


According to videolan website, "Transcoding takes quite a while, so it's advisable to use an option like --stop-time=30 to only encode the first 30 seconds - this means you can check the file has transcoded correctly, and that the output is of a suitable quality."

While VLC will record the raw stream to file on the disk, it does not create meta data to the file. This is done with ffmpeg. I'm using specific options here to lower the size of the resulted file:
Code:
ffmpeg -i ~vlc/filename.mp4 -codec:v libx264 -crf 23 -preset medium -codec:a libfdk_aac -movflags faststart -vf scale=-1:720,format=yuv420p filename1.mp4


The resulted filename1.mp4 file can be viewed in vlc or ny other player.





Top
Display posts from previous:  Sort by  
E-mail friendPrint view
Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO