user3599165
user3599165

Reputation: 1

Recording RTSP stream with fragmentation

I have problem with below fragmentation. I don't know how can I do this. Right now I use:

cvlc rtsp://address --sout "#transcode{}:duplicate{dst=std{access=file,mux=ts,dst={/mnt/record/test.h264}}}"

I want to fragment this stream every single hour. Like this: record001 record002 record003

One file should be 1h of stream.

How can I do this?

Regards.

Upvotes: 0

Views: 939

Answers (1)

andrew
andrew

Reputation: 9583

I don't know how to achieve it with vlc but I can show you with ffmpeg:

 ffmpeg -analyzeduration 0 -re -i rtsp://address -c:v copy -map 0 \ 
  -f segment -reset_timestamps 0 -segment_time 3600 \
  -movflags faststart stream%d.mp4 

sement_time 3600 (3600 secs = 1hour)

-reset_timestamps 0 and -movflags faststart shift the moov atom to start of each file for streaming playback in web browser if required

-analyzeduration 0 prevent attempting to find input duration

-re tell ffmpeg the input is live

Upvotes: 2

Related Questions