「App:Library:LVGL:docs:3rd party libraries:FFmpeg support」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
31行目: 31行目:
  
 
== Example ==
 
== Example ==
 
 
=== Decode image ===
 
=== Decode image ===
[[ファイル:LVGL docs 3rdPartyLibs FFmpeg 01.png|サムネイル]]
+
[[file:LVGL docs 3rdPartyLibs FFmpeg 01.png|link=https://docs.lvgl.io/8.2/libs/ffmpeg.html#decode-image]]
 
 
 
 
https://docs.lvgl.io/8.2/libs/ffmpeg.html#decode-image
 
  
 
----
 
----
 
 
=== Decode video ===
 
=== Decode video ===
https://docs.lvgl.io/8.2/libs/ffmpeg.html#decode-video
+
[[file:LVGL docs 3rdPartyLibs FFmpeg 01.png|link=https://docs.lvgl.io/8.2/libs/ffmpeg.html#decode-video]]
  
 
----
 
----

2022年6月28日 (火) 12:48時点における版

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.

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

Add FFmpeg to your project

  • Add library: FFmpeg (for GCC: -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread)

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.

Example

Decode image

LVGL docs 3rdPartyLibs FFmpeg 01.png


Decode video

LVGL docs 3rdPartyLibs FFmpeg 01.png


API

Enums

enum lv_ffmpeg_player_cmd_t[1]
Values:
enumerator L[2]V_FFMPEG_PLAYER_CMD_START[3]
enumerator LV_FFMPEG_PLAYER[4]_CMD_STOP[5]
enumerator LV_FFMPEG_PLAYE[6]R_CMD_PAUSE[7]
enumerator LV_FFMPEG_PLAYER[8]_CMD_RESUME[9]
enumerator _LV_FFMPEG_PLAYER[10]_CMD_LAST[11]

Functions

void lv_ffmpeg[12]_init(void)[13]
Register FFMPEG image[14] decoder
int lv_ffmpeg_get_frame_num(const char *path)[15]
Get the number of frames contained in the[16] 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)[17]
Create ffmpeg_player object
Parameters
pa[18]rent -- 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)[19]
Set the path of the file to be played
Parameters
  • obj -[20]- 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)[21]
Set command control video player
Parameters
  • obj -- pointer t[22]o a ffmpeg_player object
  • cmd -- control commands
void lv_ffmpeg_player_set_auto_restart(lv_obj_t *obj, bool en)[23]
Set the video to automatically replay
Parameters
  • o[24]bj -- pointer to a ffmpeg_player object
  • en -- true: enable the auto restart

Variables

const lv_obj_class_t lv_ffmpeg_player_class[25]
struct lv_ffmpeg_player_t[26]
Pu[27]blic Members
lv_[28]img_t img[29]
lv[30]_timer_t *timer[31]
lv_img_[32]dsc_t imgdsc[33]
bool auto[34]_restart[35]
struct [36]ffmpeg_context_s *ffmpeg_ctx






戻る : Previous