Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PyAV
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyAV
  • PyAV
  • Issues
  • #353
Closed
Open
Issue created Jul 30, 2018 by Administrator@rootContributor

packet.decode() sometimes returns None

Created by: orf

Hello, We have come across a video that appears to make packet.decode() return None instead of a list. When run with the simple code below it fails with a Nonetype object is not iterable error. As far as I can tell several packets at the end of the video return None. I can't post the video publicly, but I may be able to send it privately if you wish to reproduce. This happens on the latest master, as well as the latest release.

As far as I can tell no documentation or examples say that packet.decode() may return None? I'm guessing it's something to do with the 3rd and 4th streams with no data in the file.

Script:

container = av.open('test.mov')

for packet in container.demux():
    for frame in packet.decode():
        pass

FFMPeg video information:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2018-06-28T16:29:39.000000Z
    com.apple.quicktime.location.ISO6709: +38.7235-009.1497+067.471/
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 6
    com.apple.quicktime.software: 11.4
    com.apple.quicktime.creationdate: 2018-06-28T17:15:03+0100
  Duration: 00:00:06.74, start: 0.000000, bitrate: 3357 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 99 kb/s (default)
    Metadata:
      creation_time   : 2018-06-28T16:29:39.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 360x640 [SAR 1:1 DAR 9:16], 3223 kb/s, 29.99 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2018-06-28T16:29:39.000000Z
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 22 kb/s (default)
    Metadata:
      creation_time   : 2018-06-28T16:29:39.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2018-06-28T16:29:39.000000Z
      handler_name    : Core Media Data Handler
Assignee
Assign to
Time tracking