econsysqtcam / qtcam

QtCAM is a free, Open Source Linux Webcamera Software with more than 10 image control settings, extension settings and Color space switching.
http://www.e-consystems.com/opensource-linux-webcam-software-application.asp
GNU General Public License v3.0
185 stars 95 forks source link

Failure to build on 4.1+ #38

Open SolarAquarion opened 4 years ago

SolarAquarion commented 4 years ago
videoencoder.cpp:302:5: warning: "/*" within comment [-Wcomment]
  302 |     /* buffer - input buffer to encode
      |      
videoencoder.cpp: In member function ‘bool VideoEncoder::createFile(QString, AVCodecID, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int, int, int)’:
videoencoder.cpp:104:26: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                          ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:104:26: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                          ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:104:26: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                          ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:104:55: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                                                       ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:104:55: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                                                       ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:104:55: warning: ‘AVFormatContext::filename’ is deprecated [-Wdeprecated-declarations]
  104 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                                                       ^~~~~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:1419:10: note: declared here
 1419 |     char filename[1024];
      |          ^~~~~~~~
videoencoder.cpp:127:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  127 |         pCodecCtx=pVideoStream->codec;
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:127:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  127 |         pCodecCtx=pVideoStream->codec;
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:127:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  127 |         pCodecCtx=pVideoStream->codec;
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:130:33: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope; did you mean ‘AV_CODEC_FLAG_GLOBAL_HEADER’?
  130 |             pCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                 AV_CODEC_FLAG_GLOBAL_HEADER
videoencoder.cpp:162:49: warning: narrowing conversion of ‘fpsNumerator’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  162 |             pCodecCtx->time_base = (AVRational){fpsNumerator, fpsDenominator};
      |                                                 ^~~~~~~~~~~~
videoencoder.cpp:162:63: warning: narrowing conversion of ‘fpsDenominator’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  162 |             pCodecCtx->time_base = (AVRational){fpsNumerator, fpsDenominator};
      |                                                               ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::closeFile()’:
videoencoder.cpp:268:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  268 |     avcodec_close(pVideoStream->codec);
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:268:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  268 |     avcodec_close(pVideoStream->codec);
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:268:33: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  268 |     avcodec_close(pVideoStream->codec);
      |                                 ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:273:25: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  273 |      av_free_packet(&pkt);
      |                         ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:273:25: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  273 |      av_free_packet(&pkt);
      |                         ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:283:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  283 |         av_freep(&pFormatCtx->streams[i]->codec);
      |                                           ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:283:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  283 |         av_freep(&pFormatCtx->streams[i]->codec);
      |                                           ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:283:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  283 |         av_freep(&pFormatCtx->streams[i]->codec);
      |                                           ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::encodePacket(uint8_t*, uint8_t)’:
videoencoder.cpp:348:27: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  348 |        av_free_packet(&pkt);
      |                           ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:348:27: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  348 |        av_free_packet(&pkt);
      |                           ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:359:75: warning: ‘int avcodec_encode_video2(AVCodecContext*, AVPacket*, const AVFrame*, int*)’ is deprecated [-Wdeprecated-declarations]
  359 |     int ret = avcodec_encode_video2(pCodecCtx, &pkt, ppicture, &got_packet);
      |                                                                           ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4271:5: note: declared here
 4271 | int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
      |     ^~~~~~~~~~~~~~~~~~~~~
videoencoder.cpp:359:75: warning: ‘int avcodec_encode_video2(AVCodecContext*, AVPacket*, const AVFrame*, int*)’ is deprecated [-Wdeprecated-declarations]
  359 |     int ret = avcodec_encode_video2(pCodecCtx, &pkt, ppicture, &got_packet);
      |                                                                           ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4271:5: note: declared here
 4271 | int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
      |     ^~~~~~~~~~~~~~~~~~~~~
videoencoder.cpp:364:28: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  364 |         av_free_packet(&pkt);
      |                            ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:364:28: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  364 |         av_free_packet(&pkt);
      |                            ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:390:21: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
  390 |         if(pts_prev == pkt.pts | pkt.pts < pts_prev){
      |            ~~~~~~~~~^~~~~~~~~~
videoencoder.cpp:395:23: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  395 |         if(pCodecCtx->coded_frame->key_frame)
      |                       ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp:395:23: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  395 |         if(pCodecCtx->coded_frame->key_frame)
      |                       ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp:395:23: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  395 |         if(pCodecCtx->coded_frame->key_frame)
      |                       ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::initCodec()’:
videoencoder.cpp:492:21: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
  492 |     av_register_all();
      |                     ^
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:2052:6: note: declared here
 2052 | void av_register_all(void);
      |      ^~~~~~~~~~~~~~~
videoencoder.cpp:492:21: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
  492 |     av_register_all();
      |                     ^
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:2052:6: note: declared here
 2052 | void av_register_all(void);
      |      ^~~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::initFrame()’:
videoencoder.cpp:549:90: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  549 |     int size = avpicture_get_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                                                                                          ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4319:5: note: declared here
 4319 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
videoencoder.cpp:549:90: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  549 |     int size = avpicture_get_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                                                                                          ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4319:5: note: declared here
 4319 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
videoencoder.cpp:559:110: warning: ‘int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  559 |     avpicture_fill((AVPicture *)ppicture, picture_buf,pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                                                                                                              ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4304:5: note: declared here
 4304 | int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
      |     ^~~~~~~~~~~~~~
videoencoder.cpp:559:110: warning: ‘int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  559 |     avpicture_fill((AVPicture *)ppicture, picture_buf,pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                                                                                                              ^
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:4304:5: note: declared here
 4304 | int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
      |     ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::encodeH264Packet(void*, int)’:
videoencoder.cpp:692:19: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  692 |     if(pCodecCtx->coded_frame->key_frame)
      |                   ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp:692:19: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  692 |     if(pCodecCtx->coded_frame->key_frame)
      |                   ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp:692:19: warning: ‘AVCodecContext::coded_frame’ is deprecated [-Wdeprecated-declarations]
  692 |     if(pCodecCtx->coded_frame->key_frame)
      |                   ^~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1908:35: note: declared here
 1908 |     attribute_deprecated AVFrame *coded_frame;
      |                                   ^~~~~~~~~~~
videoencoder.cpp:701:17: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
  701 |     if(pts_prev == pkt.pts | pkt.pts < pts_prev){
      |        ~~~~~~~~~^~~~~~~~~~
videoencoder.cpp:715:28: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  715 |         av_free_packet(&pkt);
      |                            ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:715:28: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  715 |         av_free_packet(&pkt);
      |                            ^
In file included from /usr/include/libavcodec/avcodec.h:46,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:538:6: note: declared here
  538 | void av_free_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘AVStream* VideoEncoder::add_audio_stream(AVFormatContext*, AVCodecID, int, int)’:
videoencoder.cpp:760:13: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  760 |     c = st->codec;
      |             ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:760:13: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  760 |     c = st->codec;
      |             ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:760:13: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  760 |     c = st->codec;
      |             ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
/usr/include/libavformat/avformat.h:880:21: note: declared here
  880 |     AVCodecContext *codec;
      |                     ^~~~~
videoencoder.cpp:783:21: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope; did you mean ‘AV_CODEC_FLAG_GLOBAL_HEADER’?
  783 |         c->flags |= CODEC_FLAG_GLOBAL_HEADER;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
      |                     AV_CODEC_FLAG_GLOBAL_HEADER
videoencoder.cpp: In member function ‘int VideoEncoder::open_audio(AVStream*)’:
videoencoder.cpp:792:26: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
  792 |     pAudioCodecCtx = st->codec;
      |                          ^~~~~
In file included from videoencoder.h:38,
                 from videoencoder.cpp:22:
SolarAquarion commented 1 year ago
videoencoder.cpp: In member function ‘bool VideoEncoder::createFile(QString, AVCodecID, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int, int, int)’:
videoencoder.cpp:88:36: error: invalid conversion from ‘const AVOutputFormat*’ to ‘AVOutputFormat*’ [-fpermissive]
   88 |     pOutputFormat = av_guess_format(NULL, fileName.toStdString().c_str(), NULL);
      |                     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    const AVOutputFormat*
videoencoder.cpp:90:40: error: invalid conversion from ‘const AVOutputFormat*’ to ‘AVOutputFormat*’ [-fpermissive]
   90 |         pOutputFormat = av_guess_format("mpeg", NULL, NULL);
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                                        |
      |                                        const AVOutputFormat*
videoencoder.cpp:106:26: error: ‘AVFormatContext’ {aka ‘struct AVFormatContext’} has no member named ‘filename’
  106 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                          ^~~~~~~~
videoencoder.cpp:106:55: error: ‘AVFormatContext’ {aka ‘struct AVFormatContext’} has no member named ‘filename’
  106 |     snprintf(pFormatCtx->filename, sizeof(pFormatCtx->filename), "%s", fileName.toStdString().c_str());
      |                                                       ^~~~~~~~
videoencoder.cpp:116:38: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  116 |         pCodec = avcodec_find_encoder(pOutputFormat->video_codec);
      |                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      const AVCodec*
videoencoder.cpp:129:33: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  129 |         pCodecCtx=pVideoStream->codec;
      |                                 ^~~~~
videoencoder.cpp:165:49: warning: narrowing conversion of ‘fpsNumerator’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  165 |             pCodecCtx->time_base = (AVRational){fpsNumerator, fpsDenominator};
      |                                                 ^~~~~~~~~~~~
videoencoder.cpp:165:63: warning: narrowing conversion of ‘fpsDenominator’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  165 |             pCodecCtx->time_base = (AVRational){fpsNumerator, fpsDenominator};
      |                                                               ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::closeFile()’:
videoencoder.cpp:271:33: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  271 |     avcodec_close(pVideoStream->codec);
      |                                 ^~~~~
videoencoder.cpp:276:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  276 |         av_free_packet(&pkt);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
videoencoder.cpp:286:43: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  286 |         av_freep(&pFormatCtx->streams[i]->codec);
      |                                           ^~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::encodePacket(uint8_t*, uint8_t)’:
videoencoder.cpp:351:8: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  351 |        av_free_packet(&pkt);
      |        ^~~~~~~~~~~~~~
      |        av_new_packet
videoencoder.cpp:357:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  357 |     av_init_packet(&pkt);
      |     ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/packet.h:512:6: note: declared here
  512 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:362:15: error: ‘avcodec_encode_video2’ was not declared in this scope; did you mean ‘avcodec_encode_subtitle’?
  362 |     int ret = avcodec_encode_video2(pCodecCtx, &pkt, ppicture, &got_packet);
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               avcodec_encode_subtitle
videoencoder.cpp:367:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  367 |         av_free_packet(&pkt);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
videoencoder.cpp:393:21: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
  393 |         if(pts_prev == pkt.pts | pkt.pts < pts_prev){
      |            ~~~~~~~~~^~~~~~~~~~
videoencoder.cpp:398:23: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘coded_frame’
  398 |         if(pCodecCtx->coded_frame->key_frame)
      |                       ^~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::initCodec()’:
videoencoder.cpp:495:5: error: ‘av_register_all’ was not declared in this scope
  495 |     av_register_all();
      |     ^~~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘bool VideoEncoder::initFrame()’:
videoencoder.cpp:552:16: error: ‘avpicture_get_size’ was not declared in this scope
  552 |     int size = avpicture_get_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                ^~~~~~~~~~~~~~~~~~
videoencoder.cpp:562:21: error: ‘AVPicture’ was not declared in this scope; did you mean ‘QPicture’?
  562 |     avpicture_fill((AVPicture *)ppicture, picture_buf,pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                     ^~~~~~~~~
      |                     QPicture
videoencoder.cpp:562:32: error: expected primary-expression before ‘)’ token
  562 |     avpicture_fill((AVPicture *)ppicture, picture_buf,pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |                                ^
videoencoder.cpp:562:5: error: ‘avpicture_fill’ was not declared in this scope
  562 |     avpicture_fill((AVPicture *)ppicture, picture_buf,pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
      |     ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::encodeH264Packet(void*, int)’:
videoencoder.cpp:691:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  691 |     av_init_packet(&pkt);
      |     ~~~~~~~~~~~~~~^~~~~~
/usr/include/libavcodec/packet.h:512:6: note: declared here
  512 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:695:19: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘coded_frame’
  695 |     if(pCodecCtx->coded_frame->key_frame)
      |                   ^~~~~~~~~~~
videoencoder.cpp:704:17: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
  704 |     if(pts_prev == pkt.pts | pkt.pts < pts_prev){
      |        ~~~~~~~~~^~~~~~~~~~
videoencoder.cpp:718:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  718 |         av_free_packet(&pkt);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
videoencoder.cpp: In member function ‘AVStream* VideoEncoder::add_audio_stream(AVFormatContext*, AVCodecID, int, int)’:
videoencoder.cpp:750:39: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  750 |     paudioCodec = avcodec_find_encoder(AV_CODEC_ID_MP2);
      |                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                       |
      |                                       const AVCodec*
videoencoder.cpp:763:13: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  763 |     c = st->codec;
      |             ^~~~~
videoencoder.cpp:778:8: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  778 |     c->channels    = channels;
      |        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:778:8: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  778 |     c->channels    = channels;
      |        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:778:8: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  778 |     c->channels    = channels;
      |        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::open_audio(AVStream*)’:
videoencoder.cpp:795:26: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  795 |     pAudioCodecCtx = st->codec;
      |                          ^~~~~
videoencoder.cpp: In member function ‘int VideoEncoder::encodeAudio(void*)’:
videoencoder.cpp:849:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  849 |     av_init_packet(&audioPkt);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/libavcodec/packet.h:512:6: note: declared here
  512 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
videoencoder.cpp:857:71: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  857 |     int bufferSize = av_samples_get_buffer_size(NULL, pAudioCodecCtx->channels, pAudioCodecCtx->frame_size,
      |                                                                       ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:857:71: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  857 |     int bufferSize = av_samples_get_buffer_size(NULL, pAudioCodecCtx->channels, pAudioCodecCtx->frame_size,
      |                                                                       ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:857:71: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  857 |     int bufferSize = av_samples_get_buffer_size(NULL, pAudioCodecCtx->channels, pAudioCodecCtx->frame_size,
      |                                                                       ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:868:65: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  868 |     ret = avcodec_fill_audio_frame(pAudioFrame, pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt,
      |                                                                 ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:868:65: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  868 |     ret = avcodec_fill_audio_frame(pAudioFrame, pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt,
      |                                                                 ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:868:65: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  868 |     ret = avcodec_fill_audio_frame(pAudioFrame, pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt,
      |                                                                 ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:880:11: error: ‘avcodec_encode_audio2’ was not declared in this scope; did you mean ‘avcodec_encode_subtitle’?
  880 |     ret = avcodec_encode_audio2(pAudioCodecCtx, &audioPkt, pAudioFrame, &got_packet);
      |           ^~~~~~~~~~~~~~~~~~~~~
      |           avcodec_encode_subtitle
videoencoder.cpp:883:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  883 |         av_free_packet(&audioPkt);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
videoencoder.cpp:899:28: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘coded_frame’
  899 |         if(pAudioCodecCtx->coded_frame->key_frame)
      |                            ^~~~~~~~~~~
videoencoder.cpp:909:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  909 |         av_free_packet(&audioPkt);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
videoencoder.cpp: At global scope:
videoencoder.cpp:32:16: warning: ‘audioPts’ defined but not used [-Wunused-variable]
   32 | static int64_t audioPts = 0;
      |                ^~~~~~~~