Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1004594: qtwebengine-opensource-src: FTBFS with ffmpeg 5.0

95 views
Skip to first unread message

Sebastian Ramacher

unread,
Jan 30, 2022, 3:40:03 PM1/30/22
to
Source: qtwebengine-opensource-src
Version: 5.15.8+dfsg-1
Severity: important
Tags: ftbfs sid bookworm
X-Debbugs-Cc: sram...@debian.org

qtwebengine-opensource-src FTBFS with ffmpeg 5.0 (available in
experimental):
| FAILED: obj/third_party/webrtc/modules/video_coding/webrtc_h264/h264_decoder_impl.o
| /usr/lib/ccache/g++ -MMD -MF obj/third_party/webrtc/modules/video_coding/webrtc_h264/h264_decoder_impl.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/webrtc_overrides -I../../3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../3rdparty/chromium/third_party/abseil-cpp -I../../3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen -Igen -Igen -Igen -I../../3rdparty/chromium/third_party/libyuv/include -Igen -Igen -Igen -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -I/usr/include/x86_64-linux-gnu -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc -o obj/third_party/webrtc/modules/video_coding/webrtc_h264/h264_decoder_impl.o
| ../../3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc: In member function ‘virtual int32_t webrtc::H264DecoderImpl::InitDecode(const webrtc::VideoCodec*, int32_t)’:
| ../../3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc:206:40: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
| 206 | AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
| | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
| | |
| | const AVCodec*

Cheers
--
Sebastian Ramacher
signature.asc

Dmitry Shachnev

unread,
Feb 4, 2022, 3:10:03 PM2/4/22
to
Control: tags -1 - pending

Hi Sebastian!

On Sun, Jan 30, 2022 at 09:34:10PM +0100, Sebastian Ramacher wrote:
> qtwebengine-opensource-src FTBFS with ffmpeg 5.0 (available in
> experimental):

I backported some upstream commits which make it better, but not completely.

My current problem is that I don't see any replacement for this code in
Chromium's media/filters/ffmpeg_demuxer.cc:

if (stream->first_dts != kNoFFmpegTimestamp &&
stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
const base::TimeDelta first_pts =
ConvertFromTimeBase(stream->time_base, stream->first_dts);
if (first_pts < start_time)
start_time = first_pts;
}

Here stream is AVStream*. In FFmpeg 5, that class does not have first_dts
member. FFmpeg's own code uses ffstream() to cast such a pointer to FFStream*,
but both FFStream struct and ffstream() function are private API.

Upstream Chromium uses a bundled copy of FFMpeg and they patched it to add
av_stream_get_first_dts() function which exposes that member [1].

So my questions are:

- Do you know how to write equivalent code using only public API?

- If no, maybe you can add av_stream_get_first_dts() function so that Chromium
can use it? I can file a bug upstream asking to make it official for the next
release.

- Alternatively, maybe you can install libavutil's internal.h header, so I can
take FFStream and ffstream() definitions from there?

I hate both second and third solutions, but nothing better came to my mind.

[1]: https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/refs/heads/master/libavformat/utils.c#95

--
Dmitry Shachnev
signature.asc

Sebastian Ramacher

unread,
Feb 15, 2022, 6:20:04 PM2/15/22
to
Hi Dmitry

On 2022-02-04 23:00:41 +0300, Dmitry Shachnev wrote:
> Control: tags -1 - pending
>
> Hi Sebastian!
>
> On Sun, Jan 30, 2022 at 09:34:10PM +0100, Sebastian Ramacher wrote:
> > qtwebengine-opensource-src FTBFS with ffmpeg 5.0 (available in
> > experimental):
>
> I backported some upstream commits which make it better, but not completely.
>
> My current problem is that I don't see any replacement for this code in
> Chromium's media/filters/ffmpeg_demuxer.cc:
>
> if (stream->first_dts != kNoFFmpegTimestamp &&
> stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
> stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
> stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
> const base::TimeDelta first_pts =
> ConvertFromTimeBase(stream->time_base, stream->first_dts);
> if (first_pts < start_time)
> start_time = first_pts;
> }
>
> Here stream is AVStream*. In FFmpeg 5, that class does not have first_dts
> member. FFmpeg's own code uses ffstream() to cast such a pointer to FFStream*,
> but both FFStream struct and ffstream() function are private API.
>
> Upstream Chromium uses a bundled copy of FFMpeg and they patched it to add
> av_stream_get_first_dts() function which exposes that member [1].
>
> So my questions are:
>
> - Do you know how to write equivalent code using only public API?

This came up on ffmpeg-devel [1]. Their suggestion is to keep track of
that value in chromium similar to [2]. That is: as long as the first DTS
was not store, take PTS from the first packet that has it and compute it
from PTS.

Cheers

[1] https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html
[2] https://github.com/FFmpeg/FFmpeg/commit/ab4f299e23

>
> - If no, maybe you can add av_stream_get_first_dts() function so that Chromium
> can use it? I can file a bug upstream asking to make it official for the next
> release.
>
> - Alternatively, maybe you can install libavutil's internal.h header, so I can
> take FFStream and ffstream() definitions from there?
>
> I hate both second and third solutions, but nothing better came to my mind.
>
> [1]: https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/refs/heads/master/libavformat/utils.c#95
>
> --
> Dmitry Shachnev



--
Sebastian Ramacher
signature.asc
0 new messages