TomWhitwell / SlowMovie

MIT License
351 stars 69 forks source link

Output to HDMI ? #131

Open kazjim opened 2 years ago

kazjim commented 2 years ago

I have a use-case for this where the output would need to go to a standard HDMI attached monitor. Is this possible with the current version? thanks

robweber commented 2 years ago

Kind of, sort of....maybe?

Everything is pretty much focused around using an EPD to output the files, although that doesn't mean with a bit of hackery you couldn't get displaying via HDMI to work. In SlowMovie you could specify a test EPD using -e omni_epd.mock. This will grab a frame and then write it to an image file on the local filesystem. By default this will be called mock_output.png and exist in the working directory. You can overwrite this behavior though.

Once the file is generated you'd need some way of getting it on the screen. There may be an existing app to do this, or you could use some custom Python code. A quick Google search shows a bunch of different ways that could be done. I imagine you're like 90% of the way there if you can figure out that last piece.

missionfloyd commented 2 years ago

Try fbi or fim.

sudo fbi -T 1 -a --noverbose mock_output.png will display an image fullscreen. Then it should just take a simple shell script to reload the image at regular intervals.

while true
do
    sudo fbi -T 1 -a --noverbose mock_output.png
    sleep 120
    sudo pkill fbi
done

Or put it in slowmovie.py

# Display the image
logger.debug(f"Displaying frame {int(currentFrame)} of {videoFilename} ({(currentFrame/videoInfo['frame_count'])*100:.1f}%)")
subprocess.run(["sudo". "pkill", "fbi"])# kill previous fbi process, if any
epd.display(pil_im)
subprocess.run(["sudo", "fbi", "-T", "1", "-a", "--noverbose", "mock_output.png"])# display new frame

Then set whatever omni-epd options you want (see above, and here). You'll want to at least want to set an output resolution, and I would suggest writing the image to RAM instead of the SD card by setting file=/dev/shm/mock_output.png (remember to change the fbi command accordingly).