ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

Alejandro Escudero
Hi,

I am trying to get a RTSP stream from an IP Camera and save that stream as several  MP4 segments, but i need that each file segment name gets the real time stamp of the video stream. (If I use the -strftime 1, it gets the time of the local machine but i need the real rtsp time). How can I get the Real Time Stamp?

I am suing this command:


ffmpeg -rtsp_transport tcp -i "rtsp://admin:[hidden email]:554/cam/realmonitor?channel=1&subtype=0" –f segment -segment_time 5 -c copy  OUT%d.mp4



Thanks!


Alejandro

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>  Libre de virus. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

Michael Shaffer
I've been using Python to archive my RTSP IP camera footage. This is the
Python code I use to name the file the current date and time. Basically I
have the program terminate and start a new ffmpeg instance every 20
minutes. It would be nice though if ffmpeg could segment and timestamp the
files itself. Not sure how you would do that exactly.

timestr = time.strftime("%Y%m%d-%H%M%S")

myUrl='ffmpeg1rec -rtsp_transport tcp -y -rtbufsize 200M -i \"rtsp://
admin:password@192.168.1.23:554/Streaming/Channels/101/\" -f lavfi -f dshow
-i audio="virtual-audio-capturer" -c:a libmp3lame -ab 192k -ar 48000
-map_channel 1.0.0 -bufsize 5096k -c:v copy -f flv recordings/cam1-' +
timestr + '.mp4'

subprocess.Popen(myUrl, shell=True)

On Tue, Sep 3, 2019 at 5:01 PM Alejandro Escudero <
[hidden email]> wrote:

> Hi,
>
> I am trying to get a RTSP stream from an IP Camera and save that stream as
> several  MP4 segments, but i need that each file segment name gets the real
> time stamp of the video stream. (If I use the -strftime 1, it gets the time
> of the local machine but i need the real rtsp time). How can I get the Real
> Time Stamp?
>
> I am suing this command:
>
>
> ffmpeg -rtsp_transport tcp -i "rtsp://
> admin:[hidden email]:554/cam/realmonitor?channel=1&subtype=0" –f
> segment -segment_time 5 -c copy  OUT%d.mp4
>
>
>
> Thanks!
>
>
> Alejandro
>
> [
> https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif
> ]<
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> Libre de virus. www.avast.com<
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

Michael Shaffer
Nevermind I just read your question again and I guess it sounds like you
want the time stamp from the camera itself. Not sure how you would do that.

On Fri, Sep 6, 2019 at 11:29 PM Michael Shaffer <[hidden email]>
wrote:

> I've been using Python to archive my RTSP IP camera footage. This is the
> Python code I use to name the file the current date and time. Basically I
> have the program terminate and start a new ffmpeg instance every 20
> minutes. It would be nice though if ffmpeg could segment and timestamp the
> files itself. Not sure how you would do that exactly.
>
> timestr = time.strftime("%Y%m%d-%H%M%S")
>
> myUrl='ffmpeg1rec -rtsp_transport tcp -y -rtbufsize 200M -i \"rtsp://
> admin:password@192.168.1.23:554/Streaming/Channels/101/\
> <http://admin:password@192.168.1.23:554/Streaming/Channels/101/%5C>" -f
> lavfi -f dshow -i audio="virtual-audio-capturer" -c:a libmp3lame -ab 192k
> -ar 48000 -map_channel 1.0.0 -bufsize 5096k -c:v copy -f flv
> recordings/cam1-' + timestr + '.mp4'
>
> subprocess.Popen(myUrl, shell=True)
>
> On Tue, Sep 3, 2019 at 5:01 PM Alejandro Escudero <
> [hidden email]> wrote:
>
>> Hi,
>>
>> I am trying to get a RTSP stream from an IP Camera and save that stream
>> as several  MP4 segments, but i need that each file segment name gets the
>> real time stamp of the video stream. (If I use the -strftime 1, it gets the
>> time of the local machine but i need the real rtsp time). How can I get the
>> Real Time Stamp?
>>
>> I am suing this command:
>>
>>
>> ffmpeg -rtsp_transport tcp -i "rtsp://
>> admin:[hidden email]:554/cam/realmonitor?channel=1&subtype=0" –f
>> segment -segment_time 5 -c copy  OUT%d.mp4
>>
>>
>>
>> Thanks!
>>
>>
>> Alejandro
>>
>> [
>> https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif
>> ]<
>> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>> Libre de virus. www.avast.com<
>> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
>> >
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

rogerdpack2
In reply to this post by Alejandro Escudero
On Tue, Sep 3, 2019 at 3:01 PM Alejandro Escudero
<[hidden email]> wrote:
>
> Hi,
>
> I am trying to get a RTSP stream from an IP Camera and save that stream as several  MP4 segments, but i need that each file segment name gets the real time stamp of the video stream. (If I use the -strftime 1, it gets the time of the local machine but i need the real rtsp time). How can I get the Real Time Stamp?
>
> I am suing this command:
>
>
> ffmpeg -rtsp_transport tcp -i "rtsp://admin:[hidden email]:554/cam/realmonitor?channel=1&subtype=0" –f segment -segment_time 5 -c copy  OUT%d.mp4


Maybe if not mp4 it will use the capture ts?
Maybe -copyts https://ffmpeg-user.ffmpeg.narkive.com/fzTrnfHX/getting-precise-start-time-from-wall-clock-for-capture
?
Maybe -use_source_wallclock_as_timestamps
https://lists.ffmpeg.org/pipermail/ffmpeg-user/2016-March/031250.html
Maybe https://stackoverflow.com/questions/51085133/does-pts-have-to-start-at-0
GL!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

Michael Glenn Williams
We have interest in being able to read timestamps in protocol headers also.

Do we have a doc that specifies which protocols in the video stream ffmpeg
supports with a timecode, and what format of the timecode is?

Does anyone have experience which layer  within the network stack has a
timestamp that is accessible, available and reliable?




On Fri, Apr 17, 2020 at 3:59 PM Roger Pack <[hidden email]> wrote:

> On Tue, Sep 3, 2019 at 3:01 PM Alejandro Escudero
> <[hidden email]> wrote:
> >
> > Hi,
> >
> > I am trying to get a RTSP stream from an IP Camera and save that stream
> as several  MP4 segments, but i need that each file segment name gets the
> real time stamp of the video stream. (If I use the -strftime 1, it gets the
> time of the local machine but i need the real rtsp time). How can I get the
> Real Time Stamp?
> >
> > I am suing this command:
> >
> >
> > ffmpeg -rtsp_transport tcp -i "rtsp://
> admin:[hidden email]:554/cam/realmonitor?channel=1&subtype=0" –f
> segment -segment_time 5 -c copy  OUT%d.mp4
>
>
> Maybe if not mp4 it will use the capture ts?
> Maybe -copyts
> https://ffmpeg-user.ffmpeg.narkive.com/fzTrnfHX/getting-precise-start-time-from-wall-clock-for-capture
> ?
> Maybe -use_source_wallclock_as_timestamps
> https://lists.ffmpeg.org/pipermail/ffmpeg-user/2016-March/031250.html
> Maybe
> https://stackoverflow.com/questions/51085133/does-pts-have-to-start-at-0
> GL!
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ADD REAL TIME STAMP TO RTSP STREAM SEGMENT

rogerdpack2
On Fri, Apr 17, 2020 at 5:38 PM Michael Glenn Williams
<[hidden email]> wrote:
>
> We have interest in being able to read timestamps in protocol headers also.
>
> Do we have a doc that specifies which protocols in the video stream ffmpeg
> supports with a timecode, and what format of the timecode is?

Probably depends on the protocol.  ffprobe comes to mind.
My hunch/guess is it's different from .mp4 versus .ts or what not (container).
Maybe can pull it out of the RTSP stream but you'd be parsing raw bytes?
GL!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".