example(ffmpeg): replaced av_init_packet by av_packet_alloc to get rid of deprecation … (#3634)

This commit is contained in:
Uli Raich
2022-08-28 19:30:02 +02:00
committed by GitHub
parent a81dbd338c
commit fd331980bb
3 changed files with 53 additions and 17 deletions

View File

@@ -0,0 +1,21 @@
#!/opt/bin/lv_micropython-ffmpeg -i
import sys
import lvgl as lv
import display_driver
try:
#
# Open an image from a file
#
img = lv.img(lv.scr_act())
img.set_src("ffmpeg.png")
img.center()
except Exception as e:
print(e)
# TODO
# fallback for online examples
label = lv.label(lv.scr_act())
label.set_text("FFmpeg is not installed")
label.center()