Recording RTSP stream with fragmentation.

*nix specific usage questions
gawcio90
New Cone
New Cone
Posts: 1
Joined: 03 May 2014 13:48

Recording RTSP stream with fragmentation.

Postby gawcio90 » 03 May 2014 13:54

Hi!

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

Code: Select all

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.

jaderoyston
New Cone
New Cone
Posts: 4
Joined: 07 Jul 2015 16:52

Re: Recording RTSP stream with fragmentation.

Postby jaderoyston » 08 Jul 2015 23:52

Hello,

I'm sorry I do not have the answer to your post but I am trying to do the exact same thing. Just wondering if you have found the solution and could post how to do it?

Thanks,
Jade

crackstone
Blank Cone
Blank Cone
Posts: 56
Joined: 01 Apr 2010 17:25
VLC version: 2.1.0-git
Operating System: Mac OS X
Location: Vienna, Austria

Re: Recording RTSP stream with fragmentation.

Postby crackstone » 09 Jul 2015 12:03

You could try to use the livehttp module to do this. Normally you use it to segment a stream for HTTP Live streaming compatibility. Such segments usually have a length of 10 seconds or so. In your case a segment would need to be 1 hour in seconds being 3600 seconds. This should be achieved with seglen.

Basic idea:

Code: Select all

access=livehttp{seglen=3600,no-delsegs,numsegs=XX,index=/path/index.m3u8,index-url=/path/fileSequence####.ts}
Here is a complete chain:

Code: Select all

cvlc rtsp://address --sout='#transcode{width=1280,height=720,fps=25,vcodec=h264,vb=4096,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=3600,no-delsegs,numsegs=10,index=/your/path/to/prog_index.m3u8,index-url=fileSequence######.ts},mux=ts{use-key-frames},dst=/your/path/to/fileSequence######.ts}'
I am not sure if this is possible. Haven't tried producing segments this long. Try it. I left my transcoding settings intact for you to copy or leave out if needed.

//crackstone

jaderoyston
New Cone
New Cone
Posts: 4
Joined: 07 Jul 2015 16:52

Re: Recording RTSP stream with fragmentation.

Postby jaderoyston » 10 Jul 2015 21:12

Thank you for the response Crackstone.

I am getting the error no such file or directory. I am obviously not making the correct path to the output folder. All I did to your complete chain was add my rtsp address and tried to make a correct path.

I have a folder inside my 'home' folder called 'cam1'. So I changed where you had 'index=/your/path/to/prog_index.m3u8, index-url=fileSequnce######.ts}" to "index=/home/cam1/prog_index.m3u8, index-url=fileSequnce######.ts}" as well as the other location in the chain where you had me change to that same path.

Obviously I am not doing this correctly do you know how this can be done?

Thank you,
Jade

crackstone
Blank Cone
Blank Cone
Posts: 56
Joined: 01 Apr 2010 17:25
VLC version: 2.1.0-git
Operating System: Mac OS X
Location: Vienna, Austria

Re: Recording RTSP stream with fragmentation.

Postby crackstone » 13 Jul 2015 12:36

From a quick viewpoint: Is this the complete path to your index file (/home/cam1/prog_index.m3u8)? Check if you can reach your path if you do a change directory to it via simple terminal e.g.: cd /home/cam1/

Otherwise provide your log statements via http://pastebin.com/

jaderoyston
New Cone
New Cone
Posts: 4
Joined: 07 Jul 2015 16:52

Re: Recording RTSP stream with fragmentation.

Postby jaderoyston » 15 Jul 2015 00:49

jade@ubuntuVB:~$ cvlc rtsp://24.196.72.222:1081/0 --sout='#transcode{width=1280,height=720,fps=25,vcodec=h264,vb=4096,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=3600,no-delsegs,numsegs=10,index=/home/cam1/prog_index.m3u8,index-url=fileSequence######.ts},mux=ts{use-key-frames},dst=/home/cam1/fileSequence######.ts}'
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1~trusty)
[0000000000a58228] dummy interface: using the dummy interface module...
[00007f7358003298] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[00007f7358003298] x264 encoder: profile Constrained Baseline, level 3.0

[00007f7358003298] x264 encoder: final ratefactor: 16.16

[00007f7350009918] stream_out_transcode stream out: input interval 83333 (base 2)
[00007f7350009918] stream_out_transcode stream out: output interval 40000 (base 1)
[00007f7358003298] x264 encoder: using SAR=1/1

[00007f7358003298] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[00007f7358003298] x264 encoder: profile Constrained Baseline, level 3.0

[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)
[00007f7350003238] access_output_livehttp access out error: cannot open `/home/cam1/fileSequence000001.ts' (No such file or directory)


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 6 guests