RobotWebTools / web_video_server

HTTP Streaming of ROS Image Topics in Multiple Formats
http://ros.org/wiki/web_video_server
Other
270 stars 188 forks source link

Error on compiling - use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' #66

Closed klintan closed 6 years ago

klintan commented 6 years ago
web_video_server/src/libav_streamer.cpp:185:30: 
error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
 codec_context_->flags |= CODEC_FLAG_GLOBAL_HEADER;
                             ^

Fixed it by adding

/*https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg*/
#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER

at the top of libav_streamer.cpp, perhaps it should reside in some header file instead, but couldn't really figure out an appropriate place.

PR for this change is here https://github.com/RobotWebTools/web_video_server/pull/65