pudwerkin / pyffmpeg

Automatically exported from code.google.com/p/pyffmpeg
0 stars 0 forks source link

module declaration #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
if you run example code:
#!/usr/bin/python

import pyffmpeg
import sys

if len(sys.argv) < 2: sys.exit()
filename_i = sys.argv[1]

stream = pyffmpeg.VideoStream()
print stream
stream.open(filename_i)
image = stream.GetFrameNo(0)
then you have:

$ ./kadr.py ../Svadba.mp4 
<pyffmpeg.VideoStream instance at 0x1cc5878>
Traceback (most recent call last):
  File "./kadr.py", line 11, in <module>
    stream.open(filename_i)
  File "pyffmpeg.pyx", line 2469, in pyffmpeg.VideoStream.open (pyffmpeg.c:16954)
  File "pyffmpeg.pyx", line 1944, in pyffmpeg.FFMpegReader.open (pyffmpeg.c:11937)
  File "pyffmpeg.pyx", line 2049, in pyffmpeg.FFMpegReader.__finalize_open (pyffmpeg.c:12806)
  File "pyffmpeg.pyx", line 1424, in pyffmpeg.VideoTrack.init (pyffmpeg.c:7382)
AttributeError: 'NoneType' object has no attribute 'new'

so, you need to add to example code:
import PIL

then:
$ ./kadr.py ../Svadba.mp4 
<pyffmpeg.VideoStream instance at 0x10916c8>
result PTS:0
start time checked : pts = 80000 , declared was : 0
result PTS:80000
result PTS:80000

Original issue reported on code.google.com by Alexande...@gmail.com on 24 Sep 2011 at 10:58