https://docs.lvgl.io/8.2/libs/ffmpeg.html
FFmpeg support
英文
|
自動翻訳
|
FFmpeg A complete, cross-platform solution to record, convert and stream audio and video.
|
|
- 戻る : Previous
Install FFmpeg
英文
|
自動翻訳
|
- Download FFmpeg from here
./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib
make
sudo make install
|
|
- 戻る : Previous
Add FFmpeg to your project
英文
|
自動翻訳
|
- Add library:
FFmpeg (for GCC: -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread )
|
|
- 戻る : Previous
Usage
英文
|
自動翻訳
|
Enable LV_USE_FFMPEG in lv_conf.h .
See the examples below.
Note that, the FFmpeg extension doesn't use LVGL's file system. You can simply pass the path to the image or video as usual on your operating system or platform.
|
|
- 戻る : Previous
Example
英文
|
自動翻訳
|
Decode image
|
|
Decode video
|
|
- 戻る : Previous
API
英文
|
自動翻訳
|
Enums
enum lv_ffmpeg_player_cmd_t
- Values:
- enumerator LV_FFMPEG_PLAYER_CMD_START
- enumerator LV_FFMPEG_PLAYER_CMD_STOP
- enumerator LV_FFMPEG_PLAYER_CMD_PAUSE
- enumerator LV_FFMPEG_PLAYER_CMD_RESUME
- enumerator _LV_FFMPEG_PLAYER_CMD_LAST
Functions
void lv_ffmpeg_init(void)
- Register FFMPEG image decoder
int lv_ffmpeg_get_frame_num(const char *path)
- Get the number of frames contained in the file
- Parameters
- path -- image or video file name
- Returns
- Number of frames, less than 0 means failed
lv_obj_t *lv_ffmpeg_player_create(lv_obj_t *parent)
- Create ffmpeg_player object
- Parameters
- parent -- pointer to an object, it will be the parent of the new player
- Returns
- pointer to the created ffmpeg_player
lv_res_t lv_ffmpeg_player_set_src(lv_obj_t *obj, const char *path)
- Set the path of the file to be played
- Parameters
-
- obj -- pointer to a ffmpeg_player object
- path -- video file path
- Returns
- LV_RES_OK: no error; LV_RES_INV: can't get the info.
void lv_ffmpeg_player_set_cmd(lv_obj_t *obj, lv_ffmpeg_player_cmd_t cmd)
- Set command control video player
- Parameters
-
- obj -- pointer to a ffmpeg_player object
- cmd -- control commands
void lv_ffmpeg_player_set_auto_restart(lv_obj_t *obj, bool en)
- Set the video to automatically replay
- Parameters
-
- obj -- pointer to a ffmpeg_player object
- en -- true: enable the auto restart
Variables
const lv_obj_class_t lv_ffmpeg_player_class
struct lv_ffmpeg_player_t
- Public Members
- lv_img_t img
- lv_timer_t *timer
- lv_img_dsc_t imgdsc
- bool auto_restart
- struct ffmpeg_context_s *ffmpeg_ctx
|
|
- 戻る : Previous