Package: yorick-av
Version: 0.0.4-1
Severity: normal
Tags: patch

Dear self,

FFmpeg complains (warnings) about unset VBV buffer size and buffer overflows
when produgin MPEG 1 (.mpg) or MPEG2 (.vob) files. The resulting files may then
play sluggishly (or not at all, i.e. frozen on first frame) at least in VLC.

This patch sets an appropriate buffer size.

Regards, self.

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (900, 'stable-updates'), (900, 'stable'), (500, 'stable-debug'), 
(1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages yorick-av depends on:
ii  libavcodec57   7:3.2.10-1~deb9u1
ii  libavformat57  7:3.2.10-1~deb9u1
ii  libavutil55    7:3.2.10-1~deb9u1
ii  libc6          2.24-11+deb9u1
ii  libswscale4    7:3.2.10-1~deb9u1
ii  yorick         2.2.04+dfsg1-6+b1

yorick-av recommends no packages.

yorick-av suggests no packages.

-- no debconf information
Description: Set VBV buffer size for MPEG1/2 files
 FFmpeg emits warnings when producing MPEG1/2 files and the VBV buffer
 size has not been set. The output files may then play sluggishly in
 VLC. This backported patch sets a VBV buffer size sufficient to hold
 one frame.
Author: Thibaut Paumard <>
Origin: backport
Bug-Debian: coming soon
Forwarded: not-needed
Applied-Upstream: 0.0.5
Last-Update: 2018-03-06 
This patch header follows DEP-3:
--- a/yav.c
+++ b/yav.c
@@ -259,6 +259,17 @@
 void yav_opencodec(yav_ctxt *obj, unsigned int width, unsigned int height) {
+  if (obj->enc->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
+      obj->enc->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+    AVCPBProperties *props;
+    props = (AVCPBProperties*) av_stream_new_side_data
+      (obj->video_st, AV_PKT_DATA_CPB_PROPERTIES, sizeof(*props));
+    props->buffer_size = width*height*4;
+    props->max_bitrate = 0;
+    props->min_bitrate = 0;
+    props->avg_bitrate = 0;
+    props->vbv_delay = UINT64_MAX;
+  }
   av_dump_format(obj->oc, 0, obj->oc->filename, 1);
   if (obj->video_st) {
debian-science-maintainers mailing list

Reply via email to