EZreal-zhangxing / rk_ffmpeg

在rockchip3588上实现用ffmpeg进行推拉流,其中推拉流使用硬件加速编解码
43 stars 8 forks source link

你好,我在make时遇到如下问题: #1

Closed 7288Fzq closed 1 year ago

7288Fzq commented 1 year ago

所有依赖均已安装。 blueberry@poodle:~/Downloads/rk_ffmpeg-main/build$ make Scanning dependencies of target push_camera_rtmp [ 14%] Building CXX object CMakeFiles/push_camera_rtmp.dir/capture_screen.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:12: warning: ‘width’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:25: warning: ‘height’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:15:29: warning: ‘inputFmt’ initialized and declared ‘extern’ 15 | extern const AVInputFormat inputFmt = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:16:25: warning: ‘inputFmtCtx’ initialized and declared ‘extern’ 16 | extern AVFormatContext inputFmtCtx = 0; | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:17:27: warning: ‘inputCodecPar’ initialized and declared ‘extern’ 17 | extern AVCodecParameters inputCodecPar = 0; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:18:23: warning: ‘inputCodec’ initialized and declared ‘extern’ 18 | extern const AVCodec inputCodec = 0; | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:19:24: warning: ‘inputCodeCtx’ initialized and declared ‘extern’ 19 | extern AVCodecContext inputCodeCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:21:20: warning: ‘swsCtx’ initialized and declared ‘extern’ 21 | extern SwsContext swsCtx = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:22:18: warning: ‘reviceFrame’ initialized and declared ‘extern’ 22 | extern AVFrame reviceFrame = 0;//从x11grab中拿到的帧 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:23:17: warning: ‘frame’ initialized and declared ‘extern’ 23 | extern AVFrame frame = 0; //转换成YUV420P | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:24:18: warning: ‘packet’ initialized and declared ‘extern’ 24 | extern AVPacket packet = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:25:12: warning: ‘inputVideoStream’ initialized and declared ‘extern’ 25 | extern int inputVideoStream = -1; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:30:25: warning: ‘outputFmtCtx’ initialized and declared ‘extern’ 30 | extern AVFormatContext outputFmtCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:31:23: warning: ‘outputCodec’ initialized and declared ‘extern’ 31 | extern const AVCodec outputCodec = 0; // 解码器 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:32:24: warning: ‘outputCodecCtx’ initialized and declared ‘extern’ 32 | extern AVCodecContext outputCodecCtx = 0; // 解码器上下文 | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:33:19: warning: ‘stream’ initialized and declared ‘extern’ 33 | extern AVStream * stream = 0; // 输出流 | ^~ [ 28%] Building CXX object CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/push_stream_with_ffmpeg.cpp:9:9: fatal error: SDL2/SDL.h: No such file or directory 9 | #include<SDL2/SDL.h> | ^~~~ compilation terminated. make[2]: [CMakeFiles/push_camera_rtmp.dir/build.make:95: CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:99: CMakeFiles/push_camera_rtmp.dir/all] Error 2 make: *** [Makefile:103: all] Error 2

EZreal-zhangxing commented 1 year ago

所有依赖均已安装。 blueberry@poodle:~/Downloads/rk_ffmpeg-main/build$ make Scanning dependencies of target push_camera_rtmp [ 14%] Building CXX object CMakeFiles/push_camera_rtmp.dir/capture_screen.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:12: warning: ‘width’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:25: warning: ‘height’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:15:29: warning: ‘inputFmt’ initialized and declared ‘extern’ 15 | extern const AVInputFormat inputFmt = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:16:25: warning: ‘inputFmtCtx’ initialized and declared ‘extern’ 16 | extern AVFormatContext inputFmtCtx = 0; | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:17:27: warning: ‘inputCodecPar’ initialized and declared ‘extern’ 17 | extern AVCodecParameters inputCodecPar = 0; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:18:23: warning: ‘inputCodec’ initialized and declared ‘extern’ 18 | extern const AVCodec inputCodec = 0; | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:19:24: warning: ‘inputCodeCtx’ initialized and declared ‘extern’ 19 | extern AVCodecContext inputCodeCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:21:20: warning: ‘swsCtx’ initialized and declared ‘extern’ 21 | extern SwsContext _swsCtx = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:22:18: warning: ‘reviceFrame’ initialized and declared ‘extern’ 22 | extern AVFrame reviceFrame = 0;//从x11grab中拿到的帧 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capturescreen.cpp:23:17: warning: ‘frame’ initialized and declared ‘extern’ 23 | extern AVFrame frame = 0; //转换成YUV420P | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:24:18: warning: ‘packet’ initialized and declared ‘extern’ 24 | extern AVPacket packet = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:25:12: warning: ‘inputVideoStream’ initialized and declared ‘extern’ 25 | extern int inputVideoStream = -1; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:30:25: warning: ‘outputFmtCtx’ initialized and declared ‘extern’ 30 | extern AVFormatContext outputFmtCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:31:23: warning: ‘outputCodec’ initialized and declared ‘extern’ 31 | extern const AVCodec outputCodec = 0; // 解码器 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:32:24: warning: ‘outputCodecCtx’ initialized and declared ‘extern’ 32 | extern AVCodecContext outputCodecCtx = 0; // 解码器上下文 | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:33:19: warning: ‘stream’ initialized and declared ‘extern’ 33 | extern AVStream * stream = 0; // 输出流 | ^~ [ 28%] Building CXX object CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/push_stream_with_ffmpeg.cpp:9:9: fatal error: SDL2/SDL.h: No such file or directory 9 | #include<SDL2/SDL.h> | ^~~~ compilation terminated. make[2]: [CMakeFiles/push_camera_rtmp.dir/build.make:95: CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:99: CMakeFiles/push_camera_rtmp.dir/all] Error 2 make: *** [Makefile:103: all] Error 2

看起来是因为找不到SDL的头文件,我使用SDL用来展示解码后的视频。 后面我会更新到readme里

7288Fzq commented 1 year ago

所有依赖均已安装。 blueberry@poodle:~/Downloads/rk_ffmpeg-main/build$ make Scanning dependencies of target push_camera_rtmp [ 14%] Building CXX object CMakeFiles/push_camera_rtmp.dir/capture_screen.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:12: warning: ‘width’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:8:25: warning: ‘height’ initialized and declared ‘extern’ 8 | extern int width = 1440,height = 900; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:15:29: warning: ‘inputFmt’ initialized and declared ‘extern’ 15 | extern const AVInputFormat inputFmt = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:16:25: warning: ‘inputFmtCtx’ initialized and declared ‘extern’ 16 | extern AVFormatContext inputFmtCtx = 0; | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:17:27: warning: ‘inputCodecPar’ initialized and declared ‘extern’ 17 | extern AVCodecParameters inputCodecPar = 0; | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:18:23: warning: ‘inputCodec’ initialized and declared ‘extern’ 18 | extern const AVCodec inputCodec = 0; | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:19:24: warning: ‘inputCodeCtx’ initialized and declared ‘extern’ 19 | extern AVCodecContext inputCodeCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:21:20: warning: ‘swsCtx’ initialized and declared ‘extern’ 21 | extern SwsContext _swsCtx = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:22:18: warning: ‘reviceFrame’ initialized and declared ‘extern’ 22 | extern AVFrame reviceFrame = 0;//从x11grab中拿到的帧 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capturescreen.cpp:23:17: warning: ‘frame’ initialized and declared ‘extern’ 23 | extern AVFrame frame = 0; //转换成YUV420P | ^~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:24:18: warning: ‘packet’ initialized and declared ‘extern’ 24 | extern AVPacket packet = 0; | ^~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:25:12: warning: ‘inputVideoStream’ initialized and declared ‘extern’ 25 | extern int inputVideoStream = -1; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:30:25: warning: ‘outputFmtCtx’ initialized and declared ‘extern’ 30 | extern AVFormatContext outputFmtCtx = 0; | ^~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:31:23: warning: ‘outputCodec’ initialized and declared ‘extern’ 31 | extern const AVCodec outputCodec = 0; // 解码器 | ^~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:32:24: warning: ‘outputCodecCtx’ initialized and declared ‘extern’ 32 | extern AVCodecContext outputCodecCtx = 0; // 解码器上下文 | ^~~~~~ /home/blueberry/Downloads/rk_ffmpeg-main/capture_screen.cpp:33:19: warning: ‘stream’ initialized and declared ‘extern’ 33 | extern AVStream * stream = 0; // 输出流 | ^~ [ 28%] Building CXX object CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o /home/blueberry/Downloads/rk_ffmpeg-main/push_stream_with_ffmpeg.cpp:9:9: fatal error: SDL2/SDL.h: No such file or directory 9 | #include<SDL2/SDL.h> | ^~~~ compilation terminated. make[2]: [CMakeFiles/push_camera_rtmp.dir/build.make:95: CMakeFiles/push_camera_rtmp.dir/push_stream_with_ffmpeg.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:99: CMakeFiles/push_camera_rtmp.dir/all] Error 2 make: *** [Makefile:103: all] Error 2

看起来是因为找不到SDL的头文件,我使用SDL用来展示解码后的视频。 后面我会更新到readme里

好的 感谢您的回复!