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
  • #340
Closed
Open
Issue created Jun 25, 2018 by Administrator@rootContributor

av.bytesource.Bytesource object has no attribute 'size' Error while adding extradata manually.

Created by: choinw

HI.

I'm trying to decode h.264 raw stream without PPS SPS.

For encoding parameters, some extradata is being delivered from another session.

But while trying to add extradata bytes manually, the script returns the error below.

line 392, in initialize_ffmpeg_video av_codec_ctx.extradata = extradata File "av/codec/context.pyx", line 103, in av.codec.context.CodecContext.extradata.set AttributeError: 'av.bytesource.ByteSource' object has no attribute 'size'

this code block in av/codec/context.pyx causes the issue.

image

I have changed the line that is allocating extradata_size to

self.ptr.extradata_size = len(data)

then, it works.

in bytesource.pyx, there is no attribute 'size' for bytesource object.

The original commit from issue #287 by @adavoudi includes the working code. (commit 51a73857 on 25 Feb)

   def __set__(self, data):
       buffer_size = len(data)
       cdef ByteSource source = bytesource(data)
       self.ptr.extradata =  <uint8_t *>malloc(buffer_size * sizeof(uint8_t))
       self.ptr.extradata_size = buffer_size
       memcpy(self.ptr.extradata, source.ptr, buffer_size)

but it has been changed in merged commit 4b01b63b on 23 Mar.

please check it out.

Thanks.

Assignee
Assign to
Time tracking