Arnold Chan 0 Posted May 17, 2022 Hi, Seems VLC doesn't work on Tinker Board, do you guys know if there is any video player that can be controlled by Python and workable on Tinker Board (Edge R)? Thanks Arnold Share this post Link to post Share on other sites
tooz 54 Posted May 17, 2022 hello @Arnold Chan, for tinker edge r, there's built in"media player" available in the tinker os image for media streaming, however it's not python driven. if you're using other players, it may be laggy as tinker edge uses cpu to decode and read video. Share this post Link to post Share on other sites
Kajan001 0 Posted March 21, 2023 I think you can use gstreamer from python. I have just started exploring this myself so I am not sure yet. https://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.html https://sahilchachra.medium.com/all-you-want-to-get-started-with-gstreamer-in-python-2276d9ed548e Share this post Link to post Share on other sites
Kajan001 0 Posted March 28, 2023 (edited) Here is my version of python-gstreamer dvr. You need to install the python-gst bidnings though: pythong dvr -records 60s video - I have to fix the pipeline though because the clips are really big. 2+ gigs per minute Quote import gi import sys from time import sleep from datetime import datetime gi.require_version('Gst', '1.0') #this may have to be adapted depending on your gst version. from gi.repository import Gst, GObject Gst.init(sys.argv) #this is just to get the date and time into the output filename now = datetime.now() date_time = now.strftime("%m-%d-%Y_%H-%M-%S") # the same pipeling you would use in gst-launch, starting from v4l2.... Note the ' #encompassing the whole pipeline, except the +str(date-time)+ which is excluded. Use #the plus to make python add a string with the date. pipeline=Gst.parse_launch ('v4l2src ! video/x-raw,width=1280,height=720,framerate=12/1 ! queue ! mux. alsasrc ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! queue ! audioconvert ! audioresample ! voaacenc ! aacparse ! qtmux name=mux ! filesink location=rec_'+str(date_time)+'.mp4 sync=false') def main(): bus = pipeline.get_bus() pipeline.set_state(Gst.State.PLAYING) print('Recording Dashcam') sleep(60) print('Sending EOS') pipeline.send_event(Gst.Event.new_eos()) print('Waiting for EOS') bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE, Gst.MessageType.EOS) pipeline.set_state(Gst.State.NULL) main() dvr60s-dated.py Edited March 28, 2023 by Kajan001 Share this post Link to post Share on other sites