marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.39k stars 344 forks source link

Saving video with python biding DeepStream #445

Open mam1680 opened 10 months ago

mam1680 commented 10 months ago

Hi I have a question: I want to save the video with deepstream_test1.py and I add this part to my code:

    sink = Gst.ElementFactory.make("filesink", "filesink")
    if not sink:
        sys.stderr.write(" Unable to create file sink \n")

    sink.set_property("location", "./out.mp4")
    sink.set_property("sync", 1)
    sink.set_property("async", 0)

but it keeps running after 4 frames and won't stop (like it is in an infinite loop) what's the problem?

marcoslucianops commented 10 months ago

To save mp4 video you need: nvvideoconvert (caps format=I420) -> nvv4l2h264enc -> h264parse -> qtmux -> filesink.