Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 834407

Summary: media-video/motion-4.3.2-r1 with ffmpeg-5.0: ffmpeg.c:343:67: error: assignment of member ‘video_codec’ in read-only object
Product: Gentoo Linux Reporter: Kobboi <gentoo>
Component: Current packagesAssignee: Johannes Willem (Hans) Fernhout <hfern>
Status: RESOLVED FIXED    
Severity: normal CC: lekto, media-video, proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/29330
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 831437    
Attachments: build.log.gz
emerge-info.txt

Description Kobboi 2022-02-28 21:04:47 UTC
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -Dsysconfdir=\"/etc/motion\" -DLOCALEDIR=\"/usr/share/locale\"  -D_THREAD_SAFE  -I/usr/include/p11-kit-1   -O2 -march=znver3 -pipe -g -ggdb3 -c -o mmalcam.o mmalcam.c
netcam_rtsp.c: In function ‘netcam_rtsp_pktarray_resize’:
netcam_rtsp.c:141:17: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
  141 |                 av_init_packet(&tmp[indx].packet);
      |                 ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from rotate.h:14,
                 from netcam_rtsp.c:28:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
netcam_rtsp.c: In function ‘netcam_rtsp_pktarray_add’:
netcam_rtsp.c:183:9: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
  183 |         av_init_packet(&rtsp_data->pktarray[indx_next].packet);
      |         ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from rotate.h:14,
                 from netcam_rtsp.c:28:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
netcam_rtsp.c: In function ‘netcam_rtsp_open_codec’:
netcam_rtsp.c:376:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  376 |         decoder = avcodec_find_decoder_by_name(rtsp_data->decoder_nm);
      |                 ^
netcam_rtsp.c:386:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  386 |         decoder = avcodec_find_decoder(st->codecpar->codec_id);
      |                 ^
netcam_rtsp.c: In function ‘netcam_rtsp_read_image’:
netcam_rtsp.c:599:5: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
  599 |     av_init_packet(&rtsp_data->packet_recv);
      |     ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from rotate.h:14,
                 from netcam_rtsp.c:28:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
netcam_rtsp.c:641:13: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
  641 |             av_init_packet(&rtsp_data->packet_recv);
      |             ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from rotate.h:14,
                 from netcam_rtsp.c:28:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_get_oformat’:
ffmpeg.c:343:67: error: assignment of member ‘video_codec’ in read-only object
  343 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_MPEG2VIDEO;
      |                                                             ^

ffmpeg.c:365:67: error: assignment of member ‘video_codec’ in read-only object
  365 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_MSMPEG4V2;
      |                                                             ^

ffmpeg.c:376:67: error: assignment of member ‘video_codec’ in read-only object
  376 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_FLV1;
      |                                                             ^

ffmpeg.c:382:67: error: assignment of member ‘video_codec’ in read-only object
  382 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_FFV1;
      |                                                             ^

ffmpeg.c:393:67: error: assignment of member ‘video_codec’ in read-only object
  393 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_H264;
      |                                                             ^

ffmpeg.c:399:67: error: assignment of member ‘video_codec’ in read-only object
  399 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_H264;
      |                                                             ^

ffmpeg.c:405:67: error: assignment of member ‘video_codec’ in read-only object
  405 |   if (ffmpeg->oc->oformat) ffmpeg->oc->oformat->video_codec = MY_CODEC_ID_HEVC;
      |                                                             ^

ffmpeg.c: In function ‘ffmpeg_set_codec_preferred’:
ffmpeg.c:722:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  722 |             ffmpeg->codec = avcodec_find_encoder_by_name(&ffmpeg->codec_name[codec_name_len+1]);
      |                           ^
ffmpeg.c:724:54: error: assignment of member ‘video_codec’ in read-only object
  724 |                     ffmpeg->oc->oformat->video_codec = ffmpeg->codec->id;
      |                                                      ^
ffmpeg.c:733:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  733 |         ffmpeg->codec = avcodec_find_encoder(ffmpeg->oc->oformat->video_codec);
      |                       ^
ffmpeg.c: In function ‘ffmpeg_flush_codec’:
ffmpeg.c:1089:13: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
 1089 |             av_init_packet(&ffmpeg->pkt);
      |             ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from ffmpeg.c:25:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_put_frame’:
ffmpeg.c:1132:5: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
 1132 |     av_init_packet(&ffmpeg->pkt);
      |     ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from ffmpeg.c:25:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_passthru_write’:
ffmpeg.c:1184:5: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
 1184 |     av_init_packet(&ffmpeg->pkt);
      |     ^~~~~~~~~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:45,
                 from netcam_rtsp.h:21,
                 from motion.h:66,
                 from ffmpeg.c:25:
/usr/include/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
ffmpeg.c: In function ‘ffmpeg_passthru_codec’:
ffmpeg.c:1323:42: error: assignment of member ‘video_codec’ in read-only object
 1323 |         ffmpeg->oc->oformat->video_codec = stream_in->codecpar->codec_id;
      |                                          ^
make[2]: *** [Makefile:477: ffmpeg.o] Error 1


Reproducible: Always
Comment 1 Kobboi 2022-02-28 21:04:58 UTC
Created attachment 766073 [details]
build.log.gz
Comment 2 Kobboi 2022-02-28 21:05:00 UTC
Created attachment 766074 [details]
emerge-info.txt
Comment 3 Kobboi 2022-02-28 21:05:59 UTC
Compile fine with:
* USE=ffmpeg and ffmpeg-4.4.1
* USE=-ffmpeg and ffmpeg-5.0
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-15 23:22:42 UTC
ping hfern - please bump.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-26 21:25:02 UTC
(In reply to Sam James from comment #4)
> ping hfern - please bump.

ping.
Comment 6 Johannes Willem (Hans) Fernhout 2023-01-24 18:57:44 UTC
Currently developing a PR for motion-4.5.1, which builds fine against ffmpeg-5.1.2-r1.
Comment 7 Larry the Git Cow gentoo-dev 2023-02-09 16:10:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b391fc2e4239913f527bdee802f5aeec5a63efad

commit b391fc2e4239913f527bdee802f5aeec5a63efad
Author:     Johannes Willem Fernhout <hfern@fernhout.info>
AuthorDate: 2023-01-29 09:26:27 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-02-09 16:07:08 +0000

    media-video/motion: add 4.5.1
    
    Closes: https://bugs.gentoo.org/727056
    Closes: https://bugs.gentoo.org/820383
    Closes: https://bugs.gentoo.org/834407
    Signed-off-by: Johannes Willem Fernhout <hfern@fernhout.info>
    Closes: https://github.com/gentoo/gentoo/pull/29330
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-video/motion/Manifest            |  1 +
 media-video/motion/motion-4.5.1.ebuild | 86 ++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+)