splitmuxsink timestamp name for python

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

splitmuxsink timestamp name for python

Marius I
Hello Guys,


I have a script in python which is recording video segments and i use
splimuxsink for segmentation.

I have searched all over internet but i cannot find a way in python to
rename each segment and put timestamp instead of numerical values %d
Example of actual code:
splitmuxsink location=%02d.mp4

I read about format location full but there is no implementation in python.

Please help me with a solution for this...




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink timestamp name for python

ShilVin

Use format-location-full signal call back to return your file name as per
your wish.

I am not sure how to use this in python.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink timestamp name for python

Marius I
In reply to this post by Marius I
The solution in python for  splitmuxsink timestamp rename videofile:

###python3

'''
###
!!!

#def format_location_callback (splitmux, fragment_id):  
#    date = str(round(time.time() * 1000))  # take the timestamp
#    name = str(date)
#    return int(name)

 
#pipeline = Gst.parse_launch ("nvcamerasrc sensor-id=0 !
video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,
format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 !
video/x-raw(memory:NVMM), format=(string)I420 ! omxh264enc
insert-sps-pps=true iframeinterval=30 ! video/x-h264,
stream-format=(string)byte-stream ! h264parse ! splitmuxsink name=splitmux
location=%d.mp4 max-size-time=5000000000")

#src = pipeline.get_by_name ('splitmux')
#src.connect("format-location", format_location_callback)

#time.sleep(1)
#pipeline.set_state(Gst.State.PLAYING)

#bus = pipeline.get_bus()

#msg = bus.pop_filtered(Gst.MessageType.EOS | Gst.MessageType.ERROR)

#time.sleep(20)
#pipeline.send_event(Gst.Event.new_eos())
#time.sleep(1) # allow for the eos to be propagated
#pipeline.set_state(Gst.State.NULL)

'''



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel