基于ffpmeg和sdl的rtsp视频播放器

    xiaoxiao2021-12-12  8

    基于ffpmeg和sdl的rtsp视频播放器

    参考:

    http://blog.csdn.net/leixiaohua1020/article/details/8652605

    http://blog.csdn.net/leixiaohua1020/article/details/38868499

    代码:

    https://github.com/openswc/ffmpeglinuxdemo

    1.准备: sdl和ffmpeg

    sdl:

    cd cd SDL2-2.0.5/ mkdir -p build ./configure --prefix="$PWD/build" make make install ffmpeg: ./configure --prefix="$HOME/ffmpeg-release-3.0/ffmpeg_build" --bindir=" $HOME/ffmpeg-release-3.0/ffmpeg_build/bin" --enable-shared --enable-static --enable-gpl --extra-cflags="-I $HOME/ffmpeg-release-3.0/ffmpeg_build/include" --extra-ldflags="-L $HOME/ffmpeg-release-3.0/ffmpeg_build/lib" make V=1 make install V=1 2.代码gcc build 

    sdl 1.2.14

    https://github.com/openswc/ffmpeglinuxdemo/blob/master/rtspplayersdl.cpp

    gcc rtspplayersdl.cpp -I./../ffmpeg_build/include/ -L./../ffmpeg_build/lib/ -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lpostproc -lavutil -pthread -lva -lm -lz -lSDL -lSDLmain -g -o rtspplayer

    or gcc rtspplayersdl.cpp $(pkg-config --cflags --libs libavformat libavcodec libswscale libavutil sdl) -g -o rtspplayer

    sdl 2.0.5

    https://github.com/openswc/ffmpeglinuxdemo/blob/master/rtspplayersdls2.cpp

     gcc rtspplayersdls2.cpp -I./../ffmpeg_build/include/ -I./../../SDL2-2.0.5/build/include/ -L./../ffmpeg_build/lib/ -L./../../SDL2-2.0.5/build/lib/ -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lpostproc -lavutil -pthread -lva -lm -lz -lSDL2 -lSDL2main -g -o rtspplayers2

    or gcc rtspplayersdls2.cpp $(pkg-config --cflags --libs libavformat libavcodec libswscale libavutil sdl2) -g -o rtspplayers2

    3.搭建一个rstp video服务器,或者用一个支持rstp服务器的摄像头模组开发板;

    转载请注明原文地址: https://ju.6miu.com/read-900058.html

    最新回复(0)