Package: python-av
Version: 10.0.0-1+b1

Python-av currently does not compile against ffmpeg 6.0.


Upstream has released a patch that adds support for ffmpeg 6.0:
https://github.com/PyAV-Org/PyAV/pull/1110 <https://github.com/PyAV-Org/PyAV/pull/1110>
or from freebsd:
https://github.com/freebsd/freebsd-ports/commit/390ed23a4df4b6075f7ae83a6b85f589a5d4b770 <https://github.com/freebsd/freebsd-ports/commit/390ed23a4df4b6075f7ae83a6b85f589a5d4b770>

The patch is attached below. When applied, compilation completes normally.

I am using Ubuntu Mantic 23.10 (testing).
diff -Nru PyAV-10.0.0.orig/av/codec/codec.pyx PyAV-10.0.0/av/codec/codec.pyx
--- PyAV-10.0.0.orig/av/codec/codec.pyx 2022-10-17 22:02:46
+++ PyAV-10.0.0/av/codec/codec.pyx      2023-08-03 17:45:30
@@ -52,7 +52,6 @@
         """Codec uses get_buffer() for allocating buffers and supports custom 
allocators.
         If not set, it might not use get_buffer() at all or use operations that
         assume the buffer was allocated by avcodec_default_get_buffer."""),
-    ('TRUNCATED', lib.AV_CODEC_CAP_TRUNCATED),
     ('HWACCEL', 1 << 4),
     ('DELAY', lib.AV_CODEC_CAP_DELAY,
         """Encoder or decoder requires flushing with NULL input at the end in 
order to
@@ -102,8 +101,10 @@
         """Codec supports slice-based (or partition-based) multithreading."""),
     ('PARAM_CHANGE', lib.AV_CODEC_CAP_PARAM_CHANGE,
         """Codec supports changed parameters at any point."""),
-    ('AUTO_THREADS', lib.AV_CODEC_CAP_AUTO_THREADS,
-        """Codec supports avctx->thread_count == 0 (auto)."""),
+    ('AUTO_THREADS', lib.AV_CODEC_CAP_OTHER_THREADS,
+        """Codec supports multithreading through a method other than slice- or
+        frame-level multithreading. Typically this marks wrappers around
+        multithreading-capable external libraries."""),
     ('VARIABLE_FRAME_SIZE', lib.AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
         """Audio encoder supports receiving a different number of samples in 
each call."""),
     ('AVOID_PROBING', lib.AV_CODEC_CAP_AVOID_PROBING,
@@ -114,10 +115,6 @@
         the stream.
         A decoder marked with this flag should only be used as last resort
         choice for probing."""),
-    ('INTRA_ONLY', lib.AV_CODEC_CAP_INTRA_ONLY,
-        """Codec is intra only."""),
-    ('LOSSLESS', lib.AV_CODEC_CAP_LOSSLESS,
-        """Codec is lossless."""),
     ('HARDWARE', lib.AV_CODEC_CAP_HARDWARE,
         """Codec is backed by a hardware implementation. Typically used to
         identify a non-hwaccel hardware decoder. For information about 
hwaccels, use
@@ -308,7 +305,6 @@
 
     draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND')
     dr1 = capabilities.flag_property('DR1')
-    truncated = capabilities.flag_property('TRUNCATED')
     hwaccel = capabilities.flag_property('HWACCEL')
     delay = capabilities.flag_property('DELAY')
     small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
diff -Nru PyAV-10.0.0.orig/av/codec/context.pyx PyAV-10.0.0/av/codec/context.pyx
--- PyAV-10.0.0.orig/av/codec/context.pyx       2022-10-17 22:02:46
+++ PyAV-10.0.0/av/codec/context.pyx    2023-08-03 17:46:57
@@ -96,9 +96,6 @@
         """Only decode/encode grayscale."""),
     ('PSNR', lib.AV_CODEC_FLAG_PSNR,
         """error[?] variables will be set during encoding."""),
-    ('TRUNCATED', lib.AV_CODEC_FLAG_TRUNCATED,
-        """Input bitstream might be truncated at a random location
-        instead of only at frame boundaries."""),
     ('INTERLACED_DCT', lib.AV_CODEC_FLAG_INTERLACED_DCT,
         """Use interlaced DCT."""),
     ('LOW_DELAY', lib.AV_CODEC_FLAG_LOW_DELAY,
@@ -122,8 +119,6 @@
         """Skip bitstream encoding."""),
     ('LOCAL_HEADER', lib.AV_CODEC_FLAG2_LOCAL_HEADER,
         """Place global headers at every keyframe instead of in extradata."""),
-    ('DROP_FRAME_TIMECODE', lib.AV_CODEC_FLAG2_DROP_FRAME_TIMECODE,
-        """Timecode is in drop frame format. DEPRECATED!!!!"""),
     ('CHUNKS', lib.AV_CODEC_FLAG2_CHUNKS,
         """Input bitstream might be truncated at a packet boundaries
         instead of only at frame boundaries."""),
@@ -168,10 +163,6 @@
         self.ptr.thread_count = 0
         self.ptr.thread_type = 2
 
-        # Use "ass" format for subtitles (default as of FFmpeg 5.0), not the
-        # deprecated "ass_with_timings" formats.
-        self.ptr.sub_text_format = 0
-
     def _get_flags(self):
         return self.ptr.flags
 
@@ -195,7 +186,6 @@
     loop_filter = flags.flag_property('LOOP_FILTER')
     gray = flags.flag_property('GRAY')
     psnr = flags.flag_property('PSNR')
-    truncated = flags.flag_property('TRUNCATED')
     interlaced_dct = flags.flag_property('INTERLACED_DCT')
     low_delay = flags.flag_property('LOW_DELAY')
     global_header = flags.flag_property('GLOBAL_HEADER')
@@ -219,7 +209,6 @@
     fast = flags2.flag_property('FAST')
     no_output = flags2.flag_property('NO_OUTPUT')
     local_header = flags2.flag_property('LOCAL_HEADER')
-    drop_frame_timecode = flags2.flag_property('DROP_FRAME_TIMECODE')
     chunks = flags2.flag_property('CHUNKS')
     ignore_crop = flags2.flag_property('IGNORE_CROP')
     show_all = flags2.flag_property('SHOW_ALL')
diff -Nru PyAV-10.0.0.orig/av/container/core.pyx 
PyAV-10.0.0/av/container/core.pyx
--- PyAV-10.0.0.orig/av/container/core.pyx      2022-10-17 22:02:46
+++ PyAV-10.0.0/av/container/core.pyx   2023-08-03 17:51:34
@@ -157,8 +157,6 @@
         This flag is mainly intended for testing."""),
     ('SORT_DTS', lib.AVFMT_FLAG_SORT_DTS,
         "Try to interleave outputted packets by dts (using this flag can slow 
demuxing down)."),
-    ('PRIV_OPT', lib.AVFMT_FLAG_PRIV_OPT,
-        "Enable use of private options by delaying codec open (this could be 
made default once all code is converted)."),
     ('FAST_SEEK', lib.AVFMT_FLAG_FAST_SEEK,
         "Enable fast, but inaccurate seeks for some formats."),
     ('SHORTEST', lib.AVFMT_FLAG_SHORTEST,
@@ -329,7 +327,6 @@
     flush_packets = flags.flag_property('FLUSH_PACKETS')
     bit_exact = flags.flag_property('BITEXACT')
     sort_dts = flags.flag_property('SORT_DTS')
-    priv_opt = flags.flag_property('PRIV_OPT')
     fast_seek = flags.flag_property('FAST_SEEK')
     shortest = flags.flag_property('SHORTEST')
     auto_bsf = flags.flag_property('AUTO_BSF')
diff -Nru PyAV-10.0.0.orig/include/libavcodec/avcodec.pxd 
PyAV-10.0.0/include/libavcodec/avcodec.pxd
--- PyAV-10.0.0.orig/include/libavcodec/avcodec.pxd     2022-10-17 22:02:46
+++ PyAV-10.0.0/include/libavcodec/avcodec.pxd  2023-08-03 17:54:00
@@ -39,7 +39,6 @@
     cdef enum:
         AV_CODEC_CAP_DRAW_HORIZ_BAND
         AV_CODEC_CAP_DR1
-        AV_CODEC_CAP_TRUNCATED
         # AV_CODEC_CAP_HWACCEL
         AV_CODEC_CAP_DELAY
         AV_CODEC_CAP_SMALL_LAST_FRAME
@@ -51,11 +50,9 @@
         AV_CODEC_CAP_FRAME_THREADS
         AV_CODEC_CAP_SLICE_THREADS
         AV_CODEC_CAP_PARAM_CHANGE
-        AV_CODEC_CAP_AUTO_THREADS
+        AV_CODEC_CAP_OTHER_THREADS
         AV_CODEC_CAP_VARIABLE_FRAME_SIZE
         AV_CODEC_CAP_AVOID_PROBING
-        AV_CODEC_CAP_INTRA_ONLY
-        AV_CODEC_CAP_LOSSLESS
         AV_CODEC_CAP_HARDWARE
         AV_CODEC_CAP_HYBRID
         AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
@@ -76,7 +73,6 @@
         AV_CODEC_FLAG_LOOP_FILTER
         AV_CODEC_FLAG_GRAY
         AV_CODEC_FLAG_PSNR
-        AV_CODEC_FLAG_TRUNCATED
         AV_CODEC_FLAG_INTERLACED_DCT
         AV_CODEC_FLAG_LOW_DELAY
         AV_CODEC_FLAG_GLOBAL_HEADER
@@ -89,7 +85,6 @@
         AV_CODEC_FLAG2_FAST
         AV_CODEC_FLAG2_NO_OUTPUT
         AV_CODEC_FLAG2_LOCAL_HEADER
-        AV_CODEC_FLAG2_DROP_FRAME_TIMECODE
         AV_CODEC_FLAG2_CHUNKS
         AV_CODEC_FLAG2_IGNORE_CROP
         AV_CODEC_FLAG2_SHOW_ALL
@@ -223,9 +218,6 @@
         int channels
         int frame_size
         int channel_layout
-
-        # Subtitles.
-        int sub_text_format
 
         #: .. todo:: ``get_buffer`` is deprecated for get_buffer2 in newer 
versions of FFmpeg.
         int get_buffer(AVCodecContext *ctx, AVFrame *frame)
diff -Nru PyAV-10.0.0.orig/include/libavformat/avformat.pxd 
PyAV-10.0.0/include/libavformat/avformat.pxd
--- PyAV-10.0.0.orig/include/libavformat/avformat.pxd   2022-10-17 22:02:46
+++ PyAV-10.0.0/include/libavformat/avformat.pxd        2023-08-03 17:54:24
@@ -146,7 +146,6 @@
         AVFMT_FLAG_FLUSH_PACKETS
         AVFMT_FLAG_BITEXACT
         AVFMT_FLAG_SORT_DTS
-        AVFMT_FLAG_PRIV_OPT
         AVFMT_FLAG_FAST_SEEK
         AVFMT_FLAG_SHORTEST
         AVFMT_FLAG_AUTO_BSF

Reply via email to