Package: actfw-gstreamer
actfw-gstreameractfw's components using GStreamer for implementation.
actfw is a framework for Actcast Application written in Python.Installationsudo apt-get updatesudo apt-get install -y python3-pip python3-pilsudo apt-get install libgstreamer1.0-dev libgirepository1.0-dev ibgstreamer-plugins-base1.0-dev libglib2.0-devpip3 install actfw-gstreamerDocumentAPI ReferencesUsageSeeactfw-corefor basic usage ofactfwframework.InitalizationAn application usingactfw-gstreamerhave to initialize GStreamer library before usingactfw-gstreamer's components.if__name__=='__main__':importgigi.require_version('Gst','1.0')fromgi.repositoryimportGstGst.init(None)main()videotestsrcYou can learn basic usage ofactfw-gstreamerby usingvideotestsrc.fromactfw_gstreamer.captureimportGstreamerCapturefromactfw_gstreamer.gstreamer.converterimportConverterPILfromactfw_gstreamer.gstreamer.streamimportGstStreamBuilderfromactfw_gstreamer.restart_handlerimportSimpleRestartHandlerdefvideotestsrc_capture()->GstreamerCapture:pipeline_generator=preconfigured_pipeline.videotestsrc()builder=GstStreamBuilder(pipeline_generator,ConverterPIL())restart_handler=SimpleRestartHandler(10,5)returnGstreamerCapture(builder,restart_handler)defmain():app=actfw_core.Application()capture=videotestsrc_capture()app.register_task(capture)consumer=YourConsumer()app.register_task(consumer)capture.connect(consumer)app.run()This generatesFrames usingvideotestsrc.GstreamerCaptureis aProducer.It generatesFrames consists of an output ofConverterBase.  In this case, converter class isConverterPILand output isPIL.Image.Image.GstStreamBuilderandPipelineGeneratordetermines how to build gstreamer pipelines.preconfigured_pipelineprovides preconfiguredPipelineGenerators.SimpleRestartHandleris a simple implementation ofRestartHandlerBase, which determines "restart strategy".For more details, seetests.rtspsrcYou can usertspsrcusingpreconfigured_pipeline.rtsp_h264().Note that, as of now (2021-04),Actcast applicationcannot use multicast UDP with dynamic address and unicast UDP.
(RTSP client communicates with RTSP server in RTP and determines adderss of mulitcast UDP.)
Therefore, you can use only the optionprotocols = "tcp".
See alsohttps://gstreamer.freedesktop.org/documentation/rtsp/rtspsrc.html#rtspsrc:protocols.You should also pay attention to decoders. Available decoders are below:decoder (package) \ deviceRaspberry Pi 3Raspberry Pi 4Jetson Nanoomxh264(fromgstreamer1.0-omxandgstreamer1.0-omx-rpi)ox?v4l2h264dec(fromgstreamer1.0-plugins-good)very slowo?If your application supports various devices, you should branch by hardware types and select appropriatedecoder_type.
For example, it is recommended to usedecoder_typeomxfor Raspberry Pi 3 andv4l2for Raspberry Pi 4.
Currently, this library does not provide auto determination.Development GuideInstallation of dev requirementspip3 install poetrypoetry installRunning testspoetry run nose2 -vReleasing package & API docCI will automatically do.
Follow the following branch/tag rules.Make changes for next version inmasterbranch (via pull-requests).Make a PR that updates version inpyproject.tomland merge it tomasterbranch.Create GitHub release frommasterbranch's HEAD.Draft a new release.Create new tag namedrelease-<New version>(e.g.release-1.4.0) fromChoose a tagpull down menu.Write title and description.Publish release.Then CI will build/upload package to PyPI & API doc to GitHub Pages.