This devlog is about the biggest change to my project yet…. making my project from just a CLI to a Desktop application.
Why did I make a UI?
Before this the only way to make the project was to open video.json and type everything in by hand which honestly sucked because I needed to remember escape sequences like \n to make sure the code looked good on the video. It worked but it was a time consuming task to create a video and easy to mess up. So I ended up building a UI where you just type into boxes instead.
How it works
I used tktinker (Python’s built in GUI library) to make the window. There’s a box for code, narration, and output. Plus there are buttons like “Next Scene” to add more scenes to your video and “Previous Scene” if you want to edit a previous scene you made.
When you hit Export it grabs the text from the boxes and saves the data to a file called video.json which is then used to create the video.
scene = {"code": code, "narration": narration, "output": output}
scenes.append(scene)
with open("video.json", "w") as f:
json.dump(scenes, f)
subprocess.run([sys.executable, "make_video.py", save_path])
The nice part is the UI links really nicely with my video making code since the data from the UI is given to the video.json file which is then used to make the video.
Features I added
- Multiple scenes : You can add as many scenes as you want and they get stitched into one video
- Go back and edit: The Previous Scene button lets you bring an old scene’s data back without losing any of your other scenes.
- Choose where to save: When you click the Export button, a save dialog appears and lets you pick where in your computer you want to place the video, so the video can either go straight into Downloads or wherever you like.
Development struggles
The trickiest part in my development has to be going back and forth between scenes. I had to track which scene I was currently on so that when I went back and forth it would save my changes to the correct scene instead of making a duplicate scene
Next time
Next time for this project I will make the UI look nicer and try to host the project online so people can try out my project without needing to download anything.
Attached below is a picture of my current UI and here’s a full demo video of my application.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.