File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,6 @@ bunny_1080p_60fps.mp4
44bunny_1s_gop.mp4
55bunny_1s_gop.mp4.ts
66bunny_1s_gop.mp4.webm
7+ .vscode
8+ .clangd
9+ compile_commands.json
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.17 )
2+ project (libav_tutorial)
3+
4+ # set out direcroty
5+ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
6+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
7+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
8+
9+ # set ffmeg root directory
10+ if (NOT FFMPEG_DEV_ROOT)
11+ message (FATAL_ERROR "set FFMPEG_DEV_ROOT to use ffmpeg libraries" )
12+ endif ()
13+
14+ # set ffmpeg develop environment
15+ include_directories (${FFMPEG_DEV_ROOT} /include )
16+ link_directories (${FFMPEG_DEV_ROOT} /lib )
17+ link_libraries (
18+ avcodec
19+ avformat
20+ avfilter
21+ avdevice
22+ swresample
23+ swscale
24+ avutil
25+ )
26+
27+ # copy dlls
28+ file (GLOB ffmpeg_shared_libries ${FFMPEG_DEV_ROOT} /bin/*dll )
29+ file (COPY ${ffmpeg_shared_libries} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
30+
31+ # copy test file
32+ file (COPY ${CMAKE_CURRENT_SOURCE_DIR} /small_bunny_1080p_60fps.mp4 DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
33+
34+
35+ # add library
36+ set (debug_src ${CMAKE_CURRENT_SOURCE_DIR} /video_debugging.c)
37+ add_library (video_debug ${debug_src} )
38+ link_libraries (video_debug )
39+
40+ # add project/executables
41+ file (GLOB srcs *.c )
42+ list (REMOVE_ITEM srcs ${debug_src} )
43+ foreach (src ${srcs} )
44+ get_filename_component (TARGET ${src} NAME )
45+ add_executable (${TARGET} ${src} )
46+ message (STATUS "${TARGET} added" )
47+ endforeach ()
48+
49+
You can’t perform that action at this time.
0 commit comments