[BUG] CCExtractor incompatible with ffmpeg 5.0 #686

Closed
opened 2026-01-29 16:51:03 +00:00 by claunia · 22 comments
Owner

Originally created by @canihavesomecoffee on GitHub (Mar 1, 2022).

CCExtractor version: 0.94 / master

Necessary information

  • Is this a regression (i.e. did it work before)? YES
  • What platform did you use? Linux
  • What were the used arguments? N/A

Additional information

When building the AUR package for CCExtractor, building fails when the installed ffmpeg version on the system is 5.0.

==> Starting build()...
Running pre-build script...
Obtaining Git commit
Storing variables in file
Commit: b7beb3d202a9bcb77a426ef324282ca7114bcdf4
Date: 2022-03-01
Stored all in compile_info_real.h
Done.
Trying to compile...
Checking for cargo...
rustc >= MSRV(1.54.0)
Building rust files...
Updating crates.io index
Downloading crates ...
Downloaded aho-corasick v0.7.18
...
Compiling ccx_rust v0.1.0 (/tmp/bauh@me/arch/build_1646139098/ccextractor/src/ccextractor/src/rust)
Finished dev [unoptimized + debuginfo] target(s) in 51.58s
Building ccextractor
Compiled with errors
../src/lib_ccx/hardsubx.c: In function 'hardsubx_process_data':
../src/lib_ccx/hardsubx.c:16:9: warning: implicit declaration of function 'av_register_all' [-Wimplicit-function-declaration]
16 |         av_register_all();
|         ^~~~~~~~~~~~~~~
../src/lib_ccx/hardsubx.c:35:48: error: 'AVStream' has no member named 'codec'
35 |                 if (ctx->format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|                                                ^~
../src/lib_ccx/hardsubx.c:46:72: error: 'AVStream' has no member named 'codec'
46 |         ctx->codec_ctx = ctx->format_ctx->streams[ctx->video_stream_id]->codec;
|                                                                        ^~
../src/lib_ccx/hardsubx.c:47:20: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
47 |         ctx->codec = avcodec_find_decoder(ctx->codec_ctx->codec_id);
|                    ^
../src/lib_ccx/hardsubx.c: In function '_init_hardsubx':
../src/lib_ccx/hardsubx.c:224:22: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
224 |         char *lang = options->ocrlang;
|                      ^~~~~~~
../src/lib_ccx/hardsubx_decoder.c: In function 'hardsubx_process_frames_tickertext':
../src/lib_ccx/hardsubx_decoder.c:385:25: warning: implicit declaration of function 'avcodec_decode_video2'; did you mean 'avcodec_decode_subtitle2'? [-Wimplicit-function-declaration]
385 |                         avcodec_decode_video2(ctx->codec_ctx, ctx->frame, &got_frame, &ctx->packet);
|                         ^~~~~~~~~~~~~~~~~~~~~
|                         avcodec_decode_subtitle2
==> ERROR: A failure occurred in build().
$ ffmpeg -version
ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100

FFmpeg released 5.0 January 17th, 2022 and seems to have quite some breaking changes.

Originally created by @canihavesomecoffee on GitHub (Mar 1, 2022). CCExtractor version: 0.94 / master # Necessary information - Is this a regression (i.e. did it work before)? YES - What platform did you use? Linux - What were the used arguments? N/A # Additional information When building the [AUR package](https://aur.archlinux.org/packages/ccextractor) for CCExtractor, building fails when the installed ffmpeg version on the system is 5.0. ``` ==> Starting build()... Running pre-build script... Obtaining Git commit Storing variables in file Commit: b7beb3d202a9bcb77a426ef324282ca7114bcdf4 Date: 2022-03-01 Stored all in compile_info_real.h Done. Trying to compile... Checking for cargo... rustc >= MSRV(1.54.0) Building rust files... Updating crates.io index Downloading crates ... Downloaded aho-corasick v0.7.18 ... Compiling ccx_rust v0.1.0 (/tmp/bauh@me/arch/build_1646139098/ccextractor/src/ccextractor/src/rust) Finished dev [unoptimized + debuginfo] target(s) in 51.58s Building ccextractor Compiled with errors ../src/lib_ccx/hardsubx.c: In function 'hardsubx_process_data': ../src/lib_ccx/hardsubx.c:16:9: warning: implicit declaration of function 'av_register_all' [-Wimplicit-function-declaration] 16 | av_register_all(); | ^~~~~~~~~~~~~~~ ../src/lib_ccx/hardsubx.c:35:48: error: 'AVStream' has no member named 'codec' 35 | if (ctx->format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) | ^~ ../src/lib_ccx/hardsubx.c:46:72: error: 'AVStream' has no member named 'codec' 46 | ctx->codec_ctx = ctx->format_ctx->streams[ctx->video_stream_id]->codec; | ^~ ../src/lib_ccx/hardsubx.c:47:20: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 47 | ctx->codec = avcodec_find_decoder(ctx->codec_ctx->codec_id); | ^ ../src/lib_ccx/hardsubx.c: In function '_init_hardsubx': ../src/lib_ccx/hardsubx.c:224:22: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 224 | char *lang = options->ocrlang; | ^~~~~~~ ../src/lib_ccx/hardsubx_decoder.c: In function 'hardsubx_process_frames_tickertext': ../src/lib_ccx/hardsubx_decoder.c:385:25: warning: implicit declaration of function 'avcodec_decode_video2'; did you mean 'avcodec_decode_subtitle2'? [-Wimplicit-function-declaration] 385 | avcodec_decode_video2(ctx->codec_ctx, ctx->frame, &got_frame, &ctx->packet); | ^~~~~~~~~~~~~~~~~~~~~ | avcodec_decode_subtitle2 ==> ERROR: A failure occurred in build(). ``` ``` $ ffmpeg -version ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3 libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 ``` FFmpeg released 5.0 January 17th, 2022 and seems to have quite some breaking changes.
claunia added the bug label 2026-01-29 16:51:03 +00:00
Author
Owner

@cfsmp3 commented on GitHub (Mar 1, 2022):

This should probably be a short GSoC project.
Indeed FFmpeg changed their API a lot (to the better, I must say), so this is not going to be something we can fix in one evening.

@cfsmp3 commented on GitHub (Mar 1, 2022): This should probably be a short GSoC project. Indeed FFmpeg changed their API a lot (to the better, I must say), so this is not going to be something we can fix in one evening.
Author
Owner

@PriamX commented on GitHub (Mar 3, 2022):

Just ran into that issue. Came here.

The av_register_all() function has been listed as deprecated since ffmpeg 4.0 in the official changelog, avcodec_decode_video2() seems to as well, later on.

@PriamX commented on GitHub (Mar 3, 2022): Just ran into that issue. Came here. The `av_register_all()` function has been listed as deprecated since ffmpeg 4.0 in the official [changelog](https://github.com/FFmpeg/FFmpeg/blob/70d25268c21cbee5f08304da95be1f647c630c15/doc/APIchanges#L86), `avcodec_decode_video2()` seems to as well, later on.
Author
Owner

@rhertzog commented on GitHub (Jul 5, 2022):

Hi, is there any plan to address this? Most distributions are busy to organize the switch to ffmpeg 5 and if ccextractor doesn't keep up, the package will end up removed. :-(

Thank you for your work on maintaining ccextractor!

@rhertzog commented on GitHub (Jul 5, 2022): Hi, is there any plan to address this? Most distributions are busy to organize the switch to ffmpeg 5 and if ccextractor doesn't keep up, the package will end up removed. :-( Thank you for your work on maintaining ccextractor!
Author
Owner

@cfsmp3 commented on GitHub (Jul 5, 2022):

I think it's happening or will happen as part of the hardsubx rewrite effort by @PunitLodha and @shashwat1002.

I've seen references to FFmpeg 5 there.

@cfsmp3 commented on GitHub (Jul 5, 2022): I think it's happening or will happen as part of the hardsubx rewrite effort by @PunitLodha and @shashwat1002. I've seen references to FFmpeg 5 there.
Author
Owner

@PunitLodha commented on GitHub (Jul 7, 2022):

Yes, this will be a part of the HardsubX rewrite. While we are working on it, a short term solution would be to compile CCExtractor without HardsubX support.

@PunitLodha commented on GitHub (Jul 7, 2022): Yes, this will be a part of the HardsubX rewrite. While we are working on it, a short term solution would be to compile CCExtractor without HardsubX support.
Author
Owner

@rhertzog commented on GitHub (Jul 7, 2022):

Yes, this will be a part of the HardsubX rewrite. While we are working on it, a short term solution would be to compile CCExtractor without HardsubX support.

Thanks @PunitLodha for the tip! Any idea / rough guess of when the HardsubX rewrite will be ready?

@rhertzog commented on GitHub (Jul 7, 2022): > Yes, this will be a part of the HardsubX rewrite. While we are working on it, a short term solution would be to compile CCExtractor without HardsubX support. Thanks @PunitLodha for the tip! Any idea / rough guess of when the HardsubX rewrite will be ready?
Author
Owner

@PunitLodha commented on GitHub (Jul 7, 2022):

It should be ready before October

@PunitLodha commented on GitHub (Jul 7, 2022): It should be ready before October
Author
Owner

@utkarsh2102 commented on GitHub (Oct 4, 2022):

Hi @PunitLodha,

It should be ready before October

No rush or anything. Just a friendly ping asking about the ETA. :)

@utkarsh2102 commented on GitHub (Oct 4, 2022): Hi @PunitLodha, > It should be ready before October No rush or anything. Just a friendly ping asking about the ETA. :)
Author
Owner

@PunitLodha commented on GitHub (Oct 4, 2022):

@utkarsh2102
Progress has been made on this. But the GSoC project was extended recently. So this will take a bit more time.
Do you build from the master branch, or will you have to wait for a new release?

@PunitLodha commented on GitHub (Oct 4, 2022): @utkarsh2102 Progress has been made on this. But the GSoC project was extended recently. So this will take a bit more time. Do you build from the master branch, or will you have to wait for a new release?
Author
Owner

@Booloki commented on GitHub (Oct 6, 2022):

Hello @PunitLodha,

Do you build from the master branch, or will you have to wait for a new release?

Concerning Arch Linux, the AUR package is build from release versions.

@Booloki commented on GitHub (Oct 6, 2022): Hello @PunitLodha, > Do you build from the master branch, or will you have to wait for a new release? Concerning Arch Linux, the [AUR package](https://aur.archlinux.org/packages/ccextractor) is build from release versions.
Author
Owner

@utkarsh2102 commented on GitHub (Oct 6, 2022):

Hi @PunitLodha,

Do you build from the master branch, or will you have to wait for a new release?

Concerning Debian, the Debian package is built (and which is what we generally want to stick to) from a new release.

@utkarsh2102 commented on GitHub (Oct 6, 2022): Hi @PunitLodha, > Do you build from the master branch, or will you have to wait for a new release? Concerning Debian, the [Debian package](https://tracker.debian.org/pkg/ccextractor) is built (and which is what we generally want to stick to) from a new release.
Author
Owner

@gibmat commented on GitHub (Jan 3, 2023):

Any progress on ffmpeg5 compatibility? Debian's bookworm freezes are starting soon, and if ccextractor isn't in testing by early February it won't be part of bookworm.

@gibmat commented on GitHub (Jan 3, 2023): Any progress on ffmpeg5 compatibility? Debian's bookworm [freezes](https://release.debian.org/bookworm/freeze_policy.html) are starting soon, and if ccextractor isn't in testing by early February it won't be part of bookworm.
Author
Owner

@PriamX commented on GitHub (Feb 4, 2023):

Any update on the hardsub/ffmpeg5 front?

@PriamX commented on GitHub (Feb 4, 2023): Any update on the hardsub/ffmpeg5 front?
Author
Owner

@cfsmp3 commented on GitHub (Feb 4, 2023):

@PriamX @gibmat We have it as a qualification task for GSoC 2023, let's see what happens.

@cfsmp3 commented on GitHub (Feb 4, 2023): @PriamX @gibmat We have it as a qualification task for GSoC 2023, let's see what happens.
Author
Owner

@prateekmedia commented on GitHub (Feb 14, 2023):

Looking at this issue now. Will update soon.

@prateekmedia commented on GitHub (Feb 14, 2023): Looking at this issue now. Will update soon.
Author
Owner

@prateekmedia commented on GitHub (Feb 15, 2023):

Created a PR with a fix for this: #1479

@prateekmedia commented on GitHub (Feb 15, 2023): Created a PR with a fix for this: #1479
Author
Owner

@Geremia commented on GitHub (Oct 11, 2024):

@prateekmedia Is FFMPEG 7.0 compatible? I get the implicit function declaration issue when trying to build against it.

@Geremia commented on GitHub (Oct 11, 2024): @prateekmedia Is FFMPEG 7.0 compatible? I get the implicit function declaration issue when trying to build against it.
Author
Owner

@prateekmedia commented on GitHub (Oct 11, 2024):

@prateekmedia Is FFMPEG 7.0 compatible? I get the implicit function declaration issue when trying to build against it.

I think we are only supporting till ffmpeg 6.

@prateekmedia commented on GitHub (Oct 11, 2024): > @prateekmedia Is FFMPEG 7.0 compatible? I get the implicit function declaration issue when trying to build against it. I think we are only supporting till ffmpeg 6.
Author
Owner

@rboy1 commented on GitHub (Aug 12, 2025):

When trying to build ccextractor with ENABLE_FFMPEG it gives this error:

/ccextractor-build/CCExtractor/src/lib_ccx/ffmpeg_intgr.c:152:34: error: 'struct ffmpeg_ctx' has no member named 'codec_ctx'; did you mean 'dec_ctx'?
152 | avcodec_send_packet(ctx->codec_ctx, &ctx->packet);
| ^~~~~~~~~
| dec_ctx
/ccextractor-build/CCExtractor/src/lib_ccx/ffmpeg_intgr.c:152:49: error: 'struct ffmpeg_ctx' has no member named 'packet'
152 | avcodec_send_packet(ctx->codec_ctx, &ctx->packet);
| ^~

@prateekmedia it appears that these files weren't updated to ffmpeg 5. Was it intentional? Also would disabling ENABLE_FFMPEG limit any features in ccextractor? I want to use OCR and HardSubX.

@rboy1 commented on GitHub (Aug 12, 2025): When trying to build ccextractor with `ENABLE_FFMPEG` it gives this error: > /ccextractor-build/CCExtractor/src/lib_ccx/ffmpeg_intgr.c:152:34: error: 'struct ffmpeg_ctx' has no member named 'codec_ctx'; did you mean 'dec_ctx'? 152 | avcodec_send_packet(ctx->codec_ctx, &ctx->packet); | ^~~~~~~~~ | dec_ctx /ccextractor-build/CCExtractor/src/lib_ccx/ffmpeg_intgr.c:152:49: error: 'struct ffmpeg_ctx' has no member named 'packet' 152 | avcodec_send_packet(ctx->codec_ctx, &ctx->packet); | ^~ @prateekmedia it appears that these files weren't updated to ffmpeg 5. Was it intentional? Also would disabling `ENABLE_FFMPEG` limit any features in ccextractor? I want to use OCR and HardSubX.
Author
Owner

@cfsmp3 commented on GitHub (Dec 14, 2025):

We are past ffmpeg 5

@cfsmp3 commented on GitHub (Dec 14, 2025): We are past ffmpeg 5
Author
Owner

@rboy1 commented on GitHub (Dec 14, 2025):

We are past ffmpeg 5

I believe these changes also apply to ffmpeg 6 and 7 (starting with 5)

@rboy1 commented on GitHub (Dec 14, 2025): > We are past ffmpeg 5 I believe these changes also apply to ffmpeg 6 and 7 (starting with 5)
Author
Owner

@cfsmp3 commented on GitHub (Dec 14, 2025):

We are past ffmpeg 5

I believe these changes also apply to ffmpeg 6 and 7 (starting with 5)

Is anything not working at the moment? We do build with ffmpeg

@cfsmp3 commented on GitHub (Dec 14, 2025): > > We are past ffmpeg 5 > > I believe these changes also apply to ffmpeg 6 and 7 (starting with 5) Is anything not working at the moment? We do build with ffmpeg
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#686