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

It is currently Wed Aug 12, 2020 5:12 am

Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.

Topic review - VLC: How to temporarily record an RTSP stream to a file on disk with vlc
Author Message
Post subject: VLC: How to temporarily record an RTSP stream to a file on disk with vlc  |  Post Posted: Tue Jan 06, 2015 6:22 pm
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:

cvlc "rtsp://" --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:
  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:
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.
Jump to:  
News 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 ]