After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792900 - Update to ffmpeg 4.0 API
Update to ffmpeg 4.0 API
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
https://gitlab.collabora.com/nicolas/...
: 768279 768283 789193 795787 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-01-25 14:04 UTC by Sebastian Dröge (slomo)
Modified: 2018-07-12 23:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't include deprecated avfiltergraph.h header (708 bytes, patch)
2018-07-12 22:53 UTC, Mathieu Duponchelle
committed Details | Review
Use AV_ namespace for INPUT_BUFFER_PADDING_SIZE (7.31 KB, patch)
2018-07-12 22:53 UTC, Mathieu Duponchelle
committed Details | Review
Use AV_ namespace for all CODEC_ macro (14.01 KB, patch)
2018-07-12 22:53 UTC, Mathieu Duponchelle
committed Details | Review
avviddec: Stop using deperated EDGE API (1.59 KB, patch)
2018-07-12 22:53 UTC, Mathieu Duponchelle
committed Details | Review
Refactor avcfg / avvidenc (70.85 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
avaudenc: remove obsolete setting of rc_strategy (818 bytes, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
Remove all uses of AVPicture (5.31 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
avmux: port to AVCodecParameters (4.30 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
avdemux: port to AVCodecParameters (3.65 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
av_codec_next (deprecated) -> av_codec_iterate (10.42 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
avauddec: remove obsolete version check (1.40 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
av_iformat_next (deprecated) -> av_demuxer_iterate (3.39 KB, patch)
2018-07-12 22:54 UTC, Mathieu Duponchelle
committed Details | Review
av_oformat_next (deprecated) -> av_muxer_iterate (1.54 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
auddec: stop using deprecated getters (2.77 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
gstav: stop calling deprecated registration methods (968 bytes, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avvidec: port to new decoding API (12.20 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avviddec: fix signed/unsigned comparisons (3.03 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avaudenc: install options generically (19.78 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avaudenc: further cleanup (2.23 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avauddec: port to new decoding API (10.22 KB, patch)
2018-07-12 22:55 UTC, Mathieu Duponchelle
committed Details | Review
avauddec: fix remaining warnings (895 bytes, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
avmux: fix remaining warnings (1.45 KB, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
avaudenc: port to send_frame / receive_packet (6.27 KB, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
avviddec: fix invalid alignment calculations. (1.34 KB, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
avvidenc: port to send_frame / receive_packet (10.24 KB, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
meson: stop ignoring deprecation warnings! (976 bytes, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
libav: Update to n4.0.1 release (614 bytes, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
configure: update libav configure args (1.39 KB, patch)
2018-07-12 22:56 UTC, Mathieu Duponchelle
committed Details | Review
Remove obsolete scale and resample sources (23.83 KB, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review
Update ffmpeg version requirements (1.64 KB, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review
auddec: fix luck-based sinkpad access (881 bytes, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review
meson: add FFmpeg meson as a fallback (2.18 KB, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review
avcfg: add skip support to overrides system (1.09 KB, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review
avcfg: ignore some generic properties (1.68 KB, patch)
2018-07-12 22:57 UTC, Mathieu Duponchelle
committed Details | Review

Description Sebastian Dröge (slomo) 2018-01-25 14:04:19 UTC
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888326

There are various API changes that make the build fail currently.
Comment 1 Tim-Philipp Müller 2018-01-25 14:20:04 UTC
Is this the same as bug #789193 for 3.4 or are there additional changes from 3.4 -> 3.5 ?
Comment 2 Sebastian Dröge (slomo) 2018-01-25 14:48:38 UTC
More changes, yes
Comment 3 Nicolas Dufresne (ndufresne) 2018-04-27 23:17:07 UTC
I did a quick and dirty port today, against 4.0, which seems to have similar ABI, it's not fully correct, and codec private config aren't implemented, but works, which is good news. At least this time dropping the deprecated top/left padding works.

https://gitlab.collabora.com/nicolas/gst-ffmpeg/commit/b529e05a6ad5a8226d2fcbdcc2cde1be09e5ecba

It's still manageable to support 3.4 and 3.5+ ABI, would benefit distros, as it's a bit heterogeneous.
Comment 4 Edward Hervey 2018-04-30 13:58:21 UTC
Updating the title accordingly.
Comment 5 Nicolas Dufresne (ndufresne) 2018-04-30 14:38:27 UTC
(In reply to Edward Hervey from comment #4)
> Updating the title accordingly.

That's ok, I didn't change it since 3.5 has the same ABI (looks like a dev release for integration).
Comment 6 Nicolas Dufresne (ndufresne) 2018-04-30 19:33:44 UTC
Interesting, I was to start adding 3.4 support to my patch, and found that it's already compatible. I'll start cleaning up, and re-adding the config when they where move to codec private config.
Comment 7 Sebastian Dröge (slomo) 2018-05-04 07:01:23 UTC
*** Bug 795787 has been marked as a duplicate of this bug. ***
Comment 8 Sebastian Dröge (slomo) 2018-05-04 12:59:59 UTC
*** Bug 768279 has been marked as a duplicate of this bug. ***
Comment 9 Sebastian Dröge (slomo) 2018-05-04 13:00:05 UTC
*** Bug 768283 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Dröge (slomo) 2018-05-04 13:00:12 UTC
*** Bug 789193 has been marked as a duplicate of this bug. ***
Comment 11 Mathieu Duponchelle 2018-06-15 14:40:38 UTC
(In reply to Nicolas Dufresne (ndufresne) from comment #6)
> Interesting, I was to start adding 3.4 support to my patch, and found that
> it's already compatible. I'll start cleaning up, and re-adding the config
> when they where move to codec private config.

Hey, what's the status on that ? :) I've been using your WIP patch for a while now, would be nice if a final version could go in :)
Comment 12 Nicolas Dufresne (ndufresne) 2018-06-15 15:54:43 UTC
I could not allocate any time to that yet.  It's rewriting the config system that takes time, we have been ignoring the deprecation for way too long.
Comment 13 Mathieu Duponchelle 2018-07-03 22:26:38 UTC
I pushed a branch finalizing the port at https://github.com/MathieuDuponchelle/gst-libav/ , it doesn't use any deprecated API anymore.

The changes are significant, and not backward-compatible, I've run gst-validate-launcher, no regressions :)
Comment 14 Sebastian Dröge (slomo) 2018-07-04 05:08:53 UTC
(In reply to Mathieu Duponchelle from comment #13)
> 
> The changes are significant, and not backward-compatible

I wouldn't worry about the backwards compatibility, but we would have to wait until 1.16 in that case. Can't be included in 1.14.
Comment 15 Nicolas Dufresne (ndufresne) 2018-07-04 13:53:36 UTC
Nice work, I've went over the code and it looks quite good. I'm currently testing, here's couple of things I have found.

The number of "generic" and possible none working properties is huge, we should try and reduce that.

Profiles/level is done in caps, should not be exposed in properties. It's also weird to find profile on mjpeg encoder that says aac_main, aac_low, etc. Maybe a bug ?

color-* + colorimetry should not be exposed as properties. Same for field-order. 

I wasn't sure how well the generic option interface was, clearly it's not yet as good as it should be, unless we have a bug in this branch, as so many unrelated properties get added in elements.
Comment 16 Mathieu Duponchelle 2018-07-12 22:53:34 UTC
Created attachment 373013 [details] [review]
Don't include deprecated avfiltergraph.h header
Comment 17 Mathieu Duponchelle 2018-07-12 22:53:42 UTC
Created attachment 373014 [details] [review]
Use AV_ namespace for INPUT_BUFFER_PADDING_SIZE
Comment 18 Mathieu Duponchelle 2018-07-12 22:53:50 UTC
Created attachment 373015 [details] [review]
Use AV_ namespace for all CODEC_ macro

The remaining use of CODEC_ are codec flags that has been moved into the
new codec private properties or have been deperated. Will be fixed in
later patches.
Comment 19 Mathieu Duponchelle 2018-07-12 22:53:58 UTC
Created attachment 373016 [details] [review]
avviddec: Stop using deperated EDGE API
Comment 20 Mathieu Duponchelle 2018-07-12 22:54:06 UTC
Created attachment 373017 [details] [review]
Refactor avcfg / avvidenc

We were previously installing hardcoded properties for all
video encoders, refactor to instead use FFmpeg's AVOption API.

avvidenc still exposes a few properties related to the pass
mechanism: while the AVOption API allows specifying both passes
as flags at the same time, this is not practical in GStreamer's
context, where passes need to be run separately using a stats file.
Comment 21 Mathieu Duponchelle 2018-07-12 22:54:14 UTC
Created attachment 373018 [details] [review]
avaudenc: remove obsolete setting of rc_strategy
Comment 22 Mathieu Duponchelle 2018-07-12 22:54:20 UTC
Created attachment 373019 [details] [review]
Remove all uses of AVPicture
Comment 23 Mathieu Duponchelle 2018-07-12 22:54:26 UTC
Created attachment 373020 [details] [review]
avmux: port to AVCodecParameters
Comment 24 Mathieu Duponchelle 2018-07-12 22:54:33 UTC
Created attachment 373021 [details] [review]
avdemux: port to AVCodecParameters
Comment 25 Mathieu Duponchelle 2018-07-12 22:54:41 UTC
Created attachment 373022 [details] [review]
av_codec_next (deprecated) -> av_codec_iterate
Comment 26 Mathieu Duponchelle 2018-07-12 22:54:49 UTC
Created attachment 373023 [details] [review]
avauddec: remove obsolete version check
Comment 27 Mathieu Duponchelle 2018-07-12 22:54:57 UTC
Created attachment 373024 [details] [review]
av_iformat_next (deprecated) -> av_demuxer_iterate
Comment 28 Mathieu Duponchelle 2018-07-12 22:55:04 UTC
Created attachment 373025 [details] [review]
av_oformat_next (deprecated) -> av_muxer_iterate
Comment 29 Mathieu Duponchelle 2018-07-12 22:55:11 UTC
Created attachment 373026 [details] [review]
auddec: stop using deprecated getters
Comment 30 Mathieu Duponchelle 2018-07-12 22:55:18 UTC
Created attachment 373027 [details] [review]
gstav: stop calling deprecated registration methods
Comment 31 Mathieu Duponchelle 2018-07-12 22:55:24 UTC
Created attachment 373028 [details] [review]
avvidec: port to new decoding API
Comment 32 Mathieu Duponchelle 2018-07-12 22:55:30 UTC
Created attachment 373029 [details] [review]
avviddec: fix signed/unsigned comparisons
Comment 33 Mathieu Duponchelle 2018-07-12 22:55:37 UTC
Created attachment 373030 [details] [review]
avaudenc: install options generically
Comment 34 Mathieu Duponchelle 2018-07-12 22:55:44 UTC
Created attachment 373031 [details] [review]
avaudenc: further cleanup
Comment 35 Mathieu Duponchelle 2018-07-12 22:55:53 UTC
Created attachment 373032 [details] [review]
avauddec: port to new decoding API
Comment 36 Mathieu Duponchelle 2018-07-12 22:56:02 UTC
Created attachment 373033 [details] [review]
avauddec: fix remaining warnings
Comment 37 Mathieu Duponchelle 2018-07-12 22:56:09 UTC
Created attachment 373034 [details] [review]
avmux: fix remaining warnings
Comment 38 Mathieu Duponchelle 2018-07-12 22:56:17 UTC
Created attachment 373035 [details] [review]
avaudenc: port to send_frame / receive_packet
Comment 39 Mathieu Duponchelle 2018-07-12 22:56:24 UTC
Created attachment 373036 [details] [review]
avviddec: fix invalid alignment calculations.

avcodec_align_dimensions2 uses context->pix_fmt to make its
calculations, we thus need to make sure it is adequately set
when calling it.

Fixes:

gst-launch-1.0 videotestsrc ! video/x-raw, width=1920, height=1080 \
! avenc_mpeg4 ! avdec_mpeg4 ! xvimagesink

This showed invalid writes under valgrind, then segfault.
Comment 40 Mathieu Duponchelle 2018-07-12 22:56:33 UTC
Created attachment 373037 [details] [review]
avvidenc: port to send_frame / receive_packet
Comment 41 Mathieu Duponchelle 2018-07-12 22:56:42 UTC
Created attachment 373038 [details] [review]
meson: stop ignoring deprecation warnings!
Comment 42 Mathieu Duponchelle 2018-07-12 22:56:50 UTC
Created attachment 373039 [details] [review]
libav: Update to n4.0.1 release
Comment 43 Mathieu Duponchelle 2018-07-12 22:56:58 UTC
Created attachment 373040 [details] [review]
configure: update libav configure args
Comment 44 Mathieu Duponchelle 2018-07-12 22:57:07 UTC
Created attachment 373041 [details] [review]
Remove obsolete scale and resample sources
Comment 45 Mathieu Duponchelle 2018-07-12 22:57:14 UTC
Created attachment 373042 [details] [review]
Update ffmpeg version requirements
Comment 46 Mathieu Duponchelle 2018-07-12 22:57:21 UTC
Created attachment 373043 [details] [review]
auddec: fix luck-based sinkpad access
Comment 47 Mathieu Duponchelle 2018-07-12 22:57:29 UTC
Created attachment 373044 [details] [review]
meson: add FFmpeg meson as a fallback
Comment 48 Mathieu Duponchelle 2018-07-12 22:57:36 UTC
Created attachment 373045 [details] [review]
avcfg: add skip support to overrides system
Comment 49 Mathieu Duponchelle 2018-07-12 22:57:44 UTC
Created attachment 373046 [details] [review]
avcfg: ignore some generic properties

We expose profile, level and colorimetry / colorspaces through
caps.
Comment 50 Mathieu Duponchelle 2018-07-12 23:54:39 UTC
Attachment 373013 [details] pushed as 2485cc5 - Don't include deprecated avfiltergraph.h header
Attachment 373014 [details] pushed as 7b3e41e - Use AV_ namespace for INPUT_BUFFER_PADDING_SIZE
Attachment 373015 [details] pushed as aa724e2 - Use AV_ namespace for all CODEC_ macro
Attachment 373016 [details] pushed as d8dfa46 - avviddec: Stop using deperated EDGE API
Attachment 373017 [details] pushed as 1e4529c - Refactor avcfg / avvidenc
Attachment 373018 [details] pushed as 9cc57a7 - avaudenc: remove obsolete setting of rc_strategy
Attachment 373019 [details] pushed as 4f28ea2 - Remove all uses of AVPicture
Attachment 373020 [details] pushed as 4116117 - avmux: port to AVCodecParameters
Attachment 373021 [details] pushed as 37b58e0 - avdemux: port to AVCodecParameters
Attachment 373022 [details] pushed as e4bf614 - av_codec_next (deprecated) -> av_codec_iterate
Attachment 373023 [details] pushed as d059922 - avauddec: remove obsolete version check
Attachment 373024 [details] pushed as bc7160d - av_iformat_next (deprecated) -> av_demuxer_iterate
Attachment 373025 [details] pushed as 2ec542f - av_oformat_next (deprecated) -> av_muxer_iterate
Attachment 373026 [details] pushed as 1035d6c - auddec: stop using deprecated getters
Attachment 373027 [details] pushed as c214205 - gstav: stop calling deprecated registration methods
Attachment 373028 [details] pushed as d191fb2 - avvidec: port to new decoding API
Attachment 373029 [details] pushed as 965cd81 - avviddec: fix signed/unsigned comparisons
Attachment 373030 [details] pushed as 59b9e66 - avaudenc: install options generically
Attachment 373031 [details] pushed as 8f3bc07 - avaudenc: further cleanup
Attachment 373032 [details] pushed as 6243197 - avauddec: port to new decoding API
Attachment 373033 [details] pushed as 066acfa - avauddec: fix remaining warnings
Attachment 373034 [details] pushed as 3e8709d - avmux: fix remaining warnings
Attachment 373035 [details] pushed as 8562f10 - avaudenc: port to send_frame / receive_packet
Attachment 373036 [details] pushed as be9b696 - avviddec: fix invalid alignment calculations.
Attachment 373037 [details] pushed as 8f15438 - avvidenc: port to send_frame / receive_packet
Attachment 373038 [details] pushed as fb9b70c - meson: stop ignoring deprecation warnings!
Attachment 373039 [details] pushed as 3b65971 - libav: Update to n4.0.1 release
Attachment 373040 [details] pushed as aedcf43 - configure: update libav configure args
Attachment 373041 [details] pushed as 8b6516d - Remove obsolete scale and resample sources
Attachment 373042 [details] pushed as f42ce26 - Update ffmpeg version requirements
Attachment 373043 [details] pushed as e1d0d73 - auddec: fix luck-based sinkpad access
Attachment 373044 [details] pushed as b3dc5c2 - meson: add FFmpeg meson as a fallback
Attachment 373045 [details] pushed as 9c0dd8e - avcfg: add skip support to overrides system
Attachment 373046 [details] pushed as c34dd9b - avcfg: ignore some generic properties