Skip to content

Commit d8337c3

Browse files
committed
revbump(main/python-torchvision): revbump for ffmpeg-8.0
- Backport upstream PR (pytorch/vision#9245)
1 parent 200c257 commit d8337c3

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From b574ff86f23b6b2391e93042230f355daa5e8d0f Mon Sep 17 00:00:00 2001
2+
From: Dominik Mierzejewski <dominik@greysector.net>
3+
Date: Fri, 17 Oct 2025 10:51:13 +0200
4+
Subject: [PATCH] Add compatibility with FFmpeg 8.0
5+
6+
key_frame was deprecated in 2023 (FFmpeg 6.1):
7+
8+
2023-05-04 - 0fc9c1f6828 - lavu 58.7.100 - frame.h
9+
Deprecate AVFrame.interlaced_frame, AVFrame.top_field_first, and
10+
AVFrame.key_frame.
11+
Add AV_FRAME_FLAG_INTERLACED, AV_FRAME_FLAG_TOP_FIELD_FIRST, and
12+
AV_FRAME_FLAG_KEY flags as replacement.
13+
---
14+
torchvision/csrc/io/decoder/video_stream.cpp | 4 ++++
15+
1 file changed, 4 insertions(+)
16+
17+
diff --git a/torchvision/csrc/io/decoder/video_stream.cpp b/torchvision/csrc/io/decoder/video_stream.cpp
18+
index fa08c65cac1..8f232ae0283 100644
19+
--- a/torchvision/csrc/io/decoder/video_stream.cpp
20+
+++ b/torchvision/csrc/io/decoder/video_stream.cpp
21+
@@ -122,7 +122,11 @@ int VideoStream::copyFrameBytes(ByteStorage* out, bool flush) {
22+
void VideoStream::setHeader(DecoderHeader* header, bool flush) {
23+
Stream::setHeader(header, flush);
24+
if (!flush) { // no frames for video flush
25+
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58,7,100)
26+
+ header->keyFrame = (frame_)->flags & AV_FRAME_FLAG_KEY;
27+
+#else
28+
header->keyFrame = frame_->key_frame;
29+
+#endif
30+
header->fps = av_q2d(av_guess_frame_rate(
31+
inputCtx_, inputCtx_->streams[format_.stream], nullptr));
32+
}

packages/python-torchvision/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Datasets, Transforms and Models specific to Computer Vis
33
TERMUX_PKG_LICENSE="BSD 3-Clause"
44
TERMUX_PKG_MAINTAINER="@termux"
55
TERMUX_PKG_VERSION="0.24.1"
6+
TERMUX_PKG_REVISION=1
67
TERMUX_PKG_SRCURL="https://github.com/pytorch/vision/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz"
78
TERMUX_PKG_SHA256=071da2078600bfec4886efab77358c9329abfedcf1488b05879b556cb9b84ba7
89
TERMUX_PKG_DEPENDS="libc++, ffmpeg, python, python-numpy, python-pillow, python-pip, python-torch, libjpeg-turbo, libpng, libwebp, zlib"

0 commit comments

Comments
 (0)