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

Build issues #48

Open blackPantherOS opened 1 year ago

blackPantherOS commented 1 year ago

ffmpeg 5.1.2

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);
      |     ~~~~~~~~~~~~~~^~~~~~
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: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;
      |        ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:778:8: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  778 |     c->channels    = channels;
      |        ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:778:8: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  778 |     c->channels    = channels;
      |        ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:779:12: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  779 |     if (c->channels < 2)
      |            ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:780:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  780 |         c->channel_layout = AV_CH_LAYOUT_MONO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
videoencoder.cpp:782:12: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  782 |         c->channel_layout = AV_CH_LAYOUT_STEREO;
      |            ^~~~~~~~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1069:14: note: declared here
 1069 |     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);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~
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:857:71: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  857 |     int bufferSize = av_samples_get_buffer_size(NULL, pAudioCodecCtx->channels, pAudioCodecCtx->frame_size,
      |                                                                       ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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,
      |                                                                       ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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,
      |                                                                       ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:863:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  863 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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,
      |                                                                 ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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,
      |                                                                 ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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,
      |                                                                 ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     int channels;
      |         ^~~~~~~~
videoencoder.cpp:875:29: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  875 |             pAudioCodecCtx->channels, pAudioCodecCtx->sample_fmt);
      |                             ^~~~~~~~
In file included from videoencoder.h:37,
                 from videoencoder.cpp:22:
/usr/include/libavcodec/avcodec.h:1015:9: note: declared here
 1015 |     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;
      |                ^~~~~~~~
make: *** [Makefile:2106: videoencoder.o] Error 1