Commits

Zakhar Zibarov committed 3a31798

changed decoding loop and codec params

  • Participants
  • Parent commits fef7f25

Comments (0)

Files changed (3)

File ffvideo/ffvideo.c

-/* Generated by Cython 0.11.2 on Wed Apr  7 18:49:13 2010 */
+/* Generated by Cython 0.12.1 on Sat Sep 10 03:31:04 2011 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#endif
+#else
+
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
 #if PY_VERSION_HEX < 0x02040000
   #define METH_COEXIST 0
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
   #define PyType_Modified(t)
 
   typedef struct {
-       void *buf;
-       PyObject *obj;
-       Py_ssize_t len;
-       Py_ssize_t itemsize;
-       int readonly;
-       int ndim;
-       char *format;
-       Py_ssize_t *shape;
-       Py_ssize_t *strides;
-       Py_ssize_t *suboffsets;
-       void *internal;
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
   } Py_buffer;
 
   #define PyBUF_SIMPLE 0
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
+
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
-  #define PyString_Type                PyBytes_Type
-  #define PyString_CheckExact          PyBytes_CheckExact
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#else
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_CheckExact           PyString_CheckExact
+#endif
+
+#if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define PyBytes_Type                 PyString_Type
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 #endif
+
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
 #else
   #define _USE_MATH_DEFINES
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
 #include "libavformat/avformat.h"
 #include "libavformat/avio.h"
 #include "libswscale/swscale.h"
-#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
-
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
+
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #else
+    #define CYTHON_INLINE 
+  #endif
 #endif
 
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
 
 /* Type Conversion Predeclarations */
 #define __Pyx_PyBytes_AsString            PyBytes_AsString
 #endif
 
+#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
+
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
 #if !defined(T_PYSSIZET)
 #if PY_VERSION_HEX < 0x02050000
 #endif
 #endif
 
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
+        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : \
+        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
 #if !defined(T_SIZET)
 #if !defined(T_ULONGLONG)
 #define T_SIZET \
 #endif
 #endif
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
 static PyObject *__pyx_m;
 static PyObject *__pyx_b;
 static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
 static int __pyx_lineno;
 static int __pyx_clineno = 0;
 static const char * __pyx_cfilenm= __FILE__;
 static const char **__pyx_f;
 
 
-#ifdef CYTHON_REFNANNY
-typedef struct {
-  void (*INCREF)(void*, PyObject*, int);
-  void (*DECREF)(void*, PyObject*, int);
-  void (*GOTREF)(void*, PyObject*, int);
-  void (*GIVEREF)(void*, PyObject*, int);
-  void* (*NewContext)(const char*, int, const char*);
-  void (*FinishContext)(void**);
-} __Pyx_RefnannyAPIStruct;
-static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
-#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
-#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
-#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
-#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
-#else
-#define __Pyx_INCREF(r) Py_INCREF(r)
-#define __Pyx_DECREF(r) Py_DECREF(r)
-#define __Pyx_GOTREF(r)
-#define __Pyx_GIVEREF(r)
-#define __Pyx_XDECREF(r) Py_XDECREF(r)
-#define __Pyx_SetupRefcountContext(name)
-#define __Pyx_FinishRefcountContext()
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
-#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name, PyObject* kw_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
-
-static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static INLINE void __Pyx_RaiseTooManyValuesError(void);
-
-static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
-static int __Pyx_EndUnpack(PyObject *); /*proto*/
-
-static int __Pyx_Print(PyObject *, int); /*proto*/
-#if PY_MAJOR_VERSION >= 3
-static PyObject* __pyx_print = 0;
-static PyObject* __pyx_print_kwargs = 0;
-#endif
-
-static int __Pyx_PrintOne(PyObject *o); /*proto*/
-
-#ifndef __PYX_FORCE_INIT_THREADS
-#if PY_VERSION_HEX < 0x02040200
-#define __PYX_FORCE_INIT_THREADS 1
-#else
-#define __PYX_FORCE_INIT_THREADS 0
-#endif
-#endif
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-
-static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
-
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static void __Pyx_AddTraceback(const char *funcname); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+typedef signed PY_LONG_LONG __pyx_t_6ffmpeg_int64_t;
+
+typedef unsigned char __pyx_t_6ffmpeg_uint8_t;
 
 /* Type declarations */
 
-typedef signed PY_LONG_LONG __pyx_t_6ffmpeg_int64_t;
-
-typedef unsigned char __pyx_t_6ffmpeg_uint8_t;
-
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffmpeg.pxd":4
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffmpeg.pxd":4
  * ctypedef unsigned char uint8_t
  * 
  * cdef enum:             # <<<<<<<<<<<<<<
   __pyx_e_6ffmpeg_SEEK_END = 2
 };
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":53
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":53
  * }
  * 
  * cdef class VideoStream:             # <<<<<<<<<<<<<<
   int scale_mode;
 };
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":373
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":354
  * 
  * 
  * cdef class VideoFrame:             # <<<<<<<<<<<<<<
   double timestamp;
   PyObject *data;
 };
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+    PyObject *m = NULL, *p = NULL;
+    void *r = NULL;
+    m = PyImport_ImportModule((char *)modname);
+    if (!m) goto end;
+    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+    if (!p) goto end;
+    r = PyLong_AsVoidPtr(p);
+  end:
+    Py_XDECREF(p);
+    Py_XDECREF(m);
+    return (__Pyx_RefNannyAPIStruct *)r;
+  }
+  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
+#else
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
+#endif /* CYTHON_REFNANNY */
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
+
+static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
+static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
+    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
+}
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
+
+static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
+static int __Pyx_EndUnpack(PyObject *); /*proto*/
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static int __Pyx_Print(PyObject *, int); /*proto*/
+#if PY_MAJOR_VERSION >= 3
+static PyObject* __pyx_print = 0;
+static PyObject* __pyx_print_kwargs = 0;
+#endif
+
+static int __Pyx_PrintOne(PyObject *o); /*proto*/
+
+#ifndef __PYX_FORCE_INIT_THREADS
+  #if PY_VERSION_HEX < 0x02040200
+    #define __PYX_FORCE_INIT_THREADS 1
+  #else
+    #define __PYX_FORCE_INIT_THREADS 0
+  #endif
+#endif
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 /* Module declarations from ffmpeg */
 
 /* Module declarations from ffvideo */
 
 static PyTypeObject *__pyx_ptype_7ffvideo_VideoStream = 0;
 static PyTypeObject *__pyx_ptype_7ffvideo_VideoFrame = 0;
-static PyObject *__pyx_k_5 = 0;
-static PyObject *__pyx_k_7 = 0;
 #define __Pyx_MODULE_NAME "ffvideo"
 int __pyx_module_is_main_ffvideo = 0;
 
 /* Implementation of ffvideo */
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_3;
-static char __pyx_k___main__[] = "__main__";
-static PyObject *__pyx_kp___main__;
-static char __pyx_k___cinit__[] = "__cinit__";
-static PyObject *__pyx_kp___cinit__;
-static char __pyx_k___init__[] = "__init__";
-static PyObject *__pyx_kp___init__;
-static char __pyx_k___dealloc__[] = "__dealloc__";
-static PyObject *__pyx_kp___dealloc__;
-static char __pyx_k_dump[] = "dump";
-static PyObject *__pyx_kp_dump;
-static char __pyx_k___decode_next_frame[] = "__decode_next_frame";
-static PyObject *__pyx_kp___decode_next_frame;
-static char __pyx_k_dump_next_frame[] = "dump_next_frame";
-static PyObject *__pyx_kp_dump_next_frame;
-static char __pyx_k_current[] = "current";
-static PyObject *__pyx_kp_current;
-static char __pyx_k_get_frame_no[] = "get_frame_no";
-static PyObject *__pyx_kp_get_frame_no;
-static char __pyx_k_get_frame_at_sec[] = "get_frame_at_sec";
-static PyObject *__pyx_kp_get_frame_at_sec;
-static char __pyx_k_get_frame_at_pts[] = "get_frame_at_pts";
-static PyObject *__pyx_kp_get_frame_at_pts;
-static char __pyx_k___iter__[] = "__iter__";
-static PyObject *__pyx_kp___iter__;
-static char __pyx_k___next__[] = "__next__";
-static PyObject *__pyx_kp___next__;
-static char __pyx_k___getitem__[] = "__getitem__";
-static PyObject *__pyx_kp___getitem__;
-static char __pyx_k___repr__[] = "__repr__";
-static PyObject *__pyx_kp___repr__;
-static char __pyx_k_image[] = "image";
-static PyObject *__pyx_kp_image;
-static char __pyx_k_ndarray[] = "ndarray";
-static PyObject *__pyx_kp_ndarray;
-static char __pyx_k_mode[] = "mode";
-static PyObject *__pyx_kp_mode;
-static char __pyx_k_size[] = "size";
-static PyObject *__pyx_kp_size;
-static char __pyx_k_filename[] = "filename";
-static PyObject *__pyx_kp_filename;
-static char __pyx_k_frame_size[] = "frame_size";
-static PyObject *__pyx_kp_frame_size;
-static char __pyx_k_frame_mode[] = "frame_mode";
-static PyObject *__pyx_kp_frame_mode;
-static char __pyx_k_scale_mode[] = "scale_mode";
-static PyObject *__pyx_kp_scale_mode;
-static char __pyx_k_frameno[] = "frameno";
-static PyObject *__pyx_kp_frameno;
-static char __pyx_k_timestamp[] = "timestamp";
-static PyObject *__pyx_kp_timestamp;
-static char __pyx_k_pts[] = "pts";
-static PyObject *__pyx_kp_pts;
-static char __pyx_k_data[] = "data";
-static PyObject *__pyx_kp_data;
-static char __pyx_k_FFVideoError[] = "FFVideoError";
-static PyObject *__pyx_kp_FFVideoError;
-static char __pyx_k_Exception[] = "Exception";
-static PyObject *__pyx_kp_Exception;
-static char __pyx_k_DecoderError[] = "DecoderError";
-static PyObject *__pyx_kp_DecoderError;
-static char __pyx_k_FFVideoValueError[] = "FFVideoValueError";
-static PyObject *__pyx_kp_FFVideoValueError;
-static char __pyx_k_ValueError[] = "ValueError";
-static PyObject *__pyx_kp_ValueError;
-static char __pyx_k_NoMoreData[] = "NoMoreData";
-static PyObject *__pyx_kp_NoMoreData;
-static char __pyx_k_StopIteration[] = "StopIteration";
-static PyObject *__pyx_kp_StopIteration;
-static char __pyx_k_FAST_BILINEAR[] = "FAST_BILINEAR";
-static PyObject *__pyx_kp_FAST_BILINEAR;
-static char __pyx_k_BILINEAR[] = "BILINEAR";
-static PyObject *__pyx_kp_BILINEAR;
-static char __pyx_k_BICUBIC[] = "BICUBIC";
-static PyObject *__pyx_kp_BICUBIC;
-static char __pyx_k_1[] = "RGB";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_2[] = "L";
-static PyObject *__pyx_kp_2;
-static char __pyx_k_3[] = "YUV420P";
-static PyObject *__pyx_kp_3;
-static char __pyx_k_FRAME_MODES[] = "FRAME_MODES";
-static PyObject *__pyx_kp_FRAME_MODES;
-static char __pyx_k_4[] = "RGB";
-static PyObject *__pyx_kp_4;
-static char __pyx_k_6[] = "RGB";
-static PyObject *__pyx_kp_6;
-static char __pyx_k_TypeError[] = "TypeError";
-static PyObject *__pyx_kp_TypeError;
-static char __pyx_k_round[] = "round";
-static PyObject *__pyx_kp_round;
-static char __pyx_k_xrange[] = "xrange";
-static PyObject *__pyx_kp_xrange;
-static char __pyx_k_15[] = "L";
-static PyObject *__pyx_kp_15;
-static char __pyx_k_16[] = "F";
-static PyObject *__pyx_kp_16;
-static char __pyx_k_IOError[] = "IOError";
-static PyObject *__pyx_kp_IOError;
-static char __pyx_k_num[] = "num";
-static PyObject *__pyx_kp_num;
-static char __pyx_k_den[] = "den";
-static PyObject *__pyx_kp_den;
-static char __pyx_k_MemoryError[] = "MemoryError";
-static PyObject *__pyx_kp_MemoryError;
-static char __pyx_k_30[] = "RGB";
-static PyObject *__pyx_kp_30;
-static char __pyx_k_31[] = "L";
-static PyObject *__pyx_kp_31;
-static char __pyx_k_32[] = "F";
-static PyObject *__pyx_kp_32;
-static char __pyx_k_Image[] = "Image";
-static PyObject *__pyx_kp_Image;
-static char __pyx_k_ImportError[] = "ImportError";
-static PyObject *__pyx_kp_ImportError;
-static char __pyx_k_PIL[] = "PIL";
-static PyObject *__pyx_kp_PIL;
-static char __pyx_k_frombuffer[] = "frombuffer";
-static PyObject *__pyx_kp_frombuffer;
-static char __pyx_k_34[] = "raw";
-static PyObject *__pyx_kp_34;
-static char __pyx_k_35[] = "RGB";
-static PyObject *__pyx_kp_35;
-static char __pyx_k_36[] = "L";
-static PyObject *__pyx_kp_36;
-static char __pyx_k_numpy[] = "numpy";
-static PyObject *__pyx_kp_numpy;
-static char __pyx_k_38[] = "RGB";
-static PyObject *__pyx_kp_38;
-static char __pyx_k_39[] = "L";
-static PyObject *__pyx_kp_39;
-static char __pyx_k_buffer[] = "buffer";
-static PyObject *__pyx_kp_buffer;
-static char __pyx_k_dtype[] = "dtype";
-static PyObject *__pyx_kp_dtype;
-static char __pyx_k_40[] = "uint8";
-static PyObject *__pyx_kp_40;
-static char __pyx_k_shape[] = "shape";
-static PyObject *__pyx_kp_shape;
 static PyObject *__pyx_builtin_Exception;
 static PyObject *__pyx_builtin_ValueError;
 static PyObject *__pyx_builtin_StopIteration;
 static PyObject *__pyx_builtin_IOError;
 static PyObject *__pyx_builtin_MemoryError;
 static PyObject *__pyx_builtin_ImportError;
-static PyObject *__pyx_kp_8;
-static char __pyx_k_8[] = "Not supported frame mode";
-static PyObject *__pyx_kp_9;
-static PyObject *__pyx_kp_10;
-static char __pyx_k_9[] = "frame_size must be a tuple (int, int)";
-static char __pyx_k_10[] = "both width and height cannot be None";
-static PyObject *__pyx_kp_11;
-static PyObject *__pyx_kp_12;
-static PyObject *__pyx_kp_13;
-static PyObject *__pyx_kp_14;
-static PyObject *__pyx_kp_17;
-static PyObject *__pyx_kp_18;
-static char __pyx_k_11[] = "Unable to open file %s";
-static char __pyx_k_12[] = "Unable to find stream info: %d";
-static char __pyx_k_13[] = "Unable to find video stream";
-static char __pyx_k_14[] = "Unable to get decoder";
-static char __pyx_k_17[] = "Unable to open codec";
-static char __pyx_k_18[] = "Video width/height is 0; cannot decode";
-static PyObject *__pyx_kp_19;
-static char __pyx_k_19[] = "max_b_frames=%s";
-static PyObject *__pyx_kp_20;
-static PyObject *__pyx_kp_21;
-static char __pyx_k_20[] = "Unable to read frame [%d]";
-static char __pyx_k_21[] = "Unable to decode video picture: %d";
-static PyObject *__pyx_kp_22;
-static PyObject *__pyx_kp_23;
-static PyObject *__pyx_kp_24;
-static PyObject *__pyx_kp_25;
-static char __pyx_k_22[] = "pts=%d, frameno=%d";
-static char __pyx_k_23[] = "f.pts=%s, ";
-static char __pyx_k_24[] = "codec_ctx.frame_number=%s";
-static char __pyx_k_25[] = "f.coded_picture_number=%s, f.display_picture_number=%s";
-static PyObject *__pyx_kp_26;
-static char __pyx_k_26[] = "Unable to allocate new frame";
-static PyObject *__pyx_kp_27;
-static char __pyx_k_27[] = "Unable to seek: %d";
-static PyObject *__pyx_kp_28;
-static char __pyx_k_28[] = "Unable to rewind: %d";
-static PyObject *__pyx_kp_29;
-static char __pyx_k_29[] = "<VideoStream '%s':%.4f>";
-static PyObject *__pyx_kp_33;
-static char __pyx_k_33[] = "Cannot represent this color mode into PIL Image";
-static PyObject *__pyx_kp_37;
-static char __pyx_k_37[] = "Cannot represent this color mode into PIL Image";
-
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":86
+static char __pyx_k_1[] = "Not supported frame mode";
+static char __pyx_k_2[] = "frame_size must be a tuple (int, int)";
+static char __pyx_k_3[] = "both width and height cannot be None";
+static char __pyx_k_6[] = "Unable to open file %s";
+static char __pyx_k_7[] = "Unable to find stream info: %d";
+static char __pyx_k_8[] = "Unable to find video stream";
+static char __pyx_k_9[] = "Unable to get decoder";
+static char __pyx_k_10[] = "Unable to open codec";
+static char __pyx_k_11[] = "Video width/height is 0; cannot decode";
+static char __pyx_k_12[] = "max_b_frames=%s";
+static char __pyx_k_13[] = "Unable to read frame. [%d]";
+static char __pyx_k_14[] = "Unable to decode video picture: %d";
+static char __pyx_k_15[] = "display_picture_number";
+static char __pyx_k_16[] = "pts=%d, frameno=%d";
+static char __pyx_k_17[] = "f.pts=%s, ";
+static char __pyx_k_18[] = "codec_ctx.frame_number=%s";
+static char __pyx_k_19[] = "f.coded_picture_number=%s, f.display_picture_number=%s";
+static char __pyx_k_20[] = "coded_picture_number";
+static char __pyx_k_21[] = "Unable to allocate new frame";
+static char __pyx_k_22[] = "Unable to seek: %d";
+static char __pyx_k_23[] = "Unable to rewind: %d";
+static char __pyx_k_24[] = "<VideoStream '%s':%.4f>";
+static char __pyx_k_25[] = "Cannot represent this color mode into PIL Image";
+static char __pyx_k__F[] = "F";
+static char __pyx_k__L[] = "L";
+static char __pyx_k__PIL[] = "PIL";
+static char __pyx_k__RGB[] = "RGB";
+static char __pyx_k__den[] = "den";
+static char __pyx_k__dts[] = "dts";
+static char __pyx_k__num[] = "num";
+static char __pyx_k__pts[] = "pts";
+static char __pyx_k__raw[] = "raw";
+static char __pyx_k__data[] = "data";
+static char __pyx_k__mode[] = "mode";
+static char __pyx_k__name[] = "name";
+static char __pyx_k__size[] = "size";
+static char __pyx_k__Image[] = "Image";
+static char __pyx_k__codec[] = "codec";
+static char __pyx_k__dtype[] = "dtype";
+static char __pyx_k__flags[] = "flags";
+static char __pyx_k__frame[] = "frame";
+static char __pyx_k__numpy[] = "numpy";
+static char __pyx_k__range[] = "range";
+static char __pyx_k__round[] = "round";
+static char __pyx_k__shape[] = "shape";
+static char __pyx_k__uint8[] = "uint8";
+static char __pyx_k__width[] = "width";
+static char __pyx_k__buffer[] = "buffer";
+static char __pyx_k__height[] = "height";
+static char __pyx_k__packet[] = "packet";
+static char __pyx_k__stream[] = "stream";
+static char __pyx_k__xrange[] = "xrange";
+static char __pyx_k__BICUBIC[] = "BICUBIC";
+static char __pyx_k__IOError[] = "IOError";
+static char __pyx_k__YUV420P[] = "YUV420P";
+static char __pyx_k__current[] = "current";
+static char __pyx_k__frameno[] = "frameno";
+static char __pyx_k__ndarray[] = "ndarray";
+static char __pyx_k__pix_fmt[] = "pix_fmt";
+static char __pyx_k__streams[] = "streams";
+static char __pyx_k__BILINEAR[] = "BILINEAR";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k__codec_id[] = "codec_id";
+static char __pyx_k__duration[] = "duration";
+static char __pyx_k__filename[] = "filename";
+static char __pyx_k__linesize[] = "linesize";
+static char __pyx_k__streamno[] = "streamno";
+static char __pyx_k__Exception[] = "Exception";
+static char __pyx_k__TypeError[] = "TypeError";
+static char __pyx_k__codec_ctx[] = "codec_ctx";
+static char __pyx_k__framerate[] = "framerate";
+static char __pyx_k__skip_idct[] = "skip_idct";
+static char __pyx_k__time_base[] = "time_base";
+static char __pyx_k__timestamp[] = "timestamp";
+static char __pyx_k__NoMoreData[] = "NoMoreData";
+static char __pyx_k__ValueError[] = "ValueError";
+static char __pyx_k__codec_name[] = "codec_name";
+static char __pyx_k__codec_type[] = "codec_type";
+static char __pyx_k__format_ctx[] = "format_ctx";
+static char __pyx_k__frame_mode[] = "frame_mode";
+static char __pyx_k__frame_size[] = "frame_size";
+static char __pyx_k__frombuffer[] = "frombuffer";
+static char __pyx_k__nb_streams[] = "nb_streams";
+static char __pyx_k__scale_mode[] = "scale_mode";
+static char __pyx_k__skip_frame[] = "skip_frame";
+static char __pyx_k__start_time[] = "start_time";
+static char __pyx_k__FRAME_MODES[] = "FRAME_MODES";
+static char __pyx_k__ImportError[] = "ImportError";
+static char __pyx_k__MemoryError[] = "MemoryError";
+static char __pyx_k__frame_width[] = "frame_width";
+static char __pyx_k__DecoderError[] = "DecoderError";
+static char __pyx_k__FFVideoError[] = "FFVideoError";
+static char __pyx_k____frame_mode[] = "__frame_mode";
+static char __pyx_k__frame_height[] = "frame_height";
+static char __pyx_k__frame_number[] = "frame_number";
+static char __pyx_k__get_frame_no[] = "get_frame_no";
+static char __pyx_k__max_b_frames[] = "max_b_frames";
+static char __pyx_k__r_frame_rate[] = "r_frame_rate";
+static char __pyx_k__stream_index[] = "stream_index";
+static char __pyx_k__FAST_BILINEAR[] = "FAST_BILINEAR";
+static char __pyx_k__StopIteration[] = "StopIteration";
+static char __pyx_k__get_frame_at_pts[] = "get_frame_at_pts";
+static char __pyx_k__FFVideoValueError[] = "FFVideoValueError";
+static char __pyx_k__ffmpeg_frame_mode[] = "ffmpeg_frame_mode";
+static char __pyx_k____decode_next_frame[] = "__decode_next_frame";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_s_10;
+static PyObject *__pyx_kp_s_11;
+static PyObject *__pyx_kp_s_12;
+static PyObject *__pyx_kp_s_13;
+static PyObject *__pyx_kp_s_14;
+static PyObject *__pyx_n_s_15;
+static PyObject *__pyx_kp_s_16;
+static PyObject *__pyx_kp_s_17;
+static PyObject *__pyx_kp_s_18;
+static PyObject *__pyx_kp_s_19;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_n_s_20;
+static PyObject *__pyx_kp_s_21;
+static PyObject *__pyx_kp_s_22;
+static PyObject *__pyx_kp_s_23;
+static PyObject *__pyx_kp_s_24;
+static PyObject *__pyx_kp_s_25;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_6;
+static PyObject *__pyx_kp_s_7;
+static PyObject *__pyx_kp_s_8;
+static PyObject *__pyx_kp_s_9;
+static PyObject *__pyx_n_s__BICUBIC;
+static PyObject *__pyx_n_s__BILINEAR;
+static PyObject *__pyx_n_s__DecoderError;
+static PyObject *__pyx_n_s__Exception;
+static PyObject *__pyx_n_s__F;
+static PyObject *__pyx_n_s__FAST_BILINEAR;
+static PyObject *__pyx_n_s__FFVideoError;
+static PyObject *__pyx_n_s__FFVideoValueError;
+static PyObject *__pyx_n_s__FRAME_MODES;
+static PyObject *__pyx_n_s__IOError;
+static PyObject *__pyx_n_s__Image;
+static PyObject *__pyx_n_s__ImportError;
+static PyObject *__pyx_n_s__L;
+static PyObject *__pyx_n_s__MemoryError;
+static PyObject *__pyx_n_s__NoMoreData;
+static PyObject *__pyx_n_s__PIL;
+static PyObject *__pyx_n_s__RGB;
+static PyObject *__pyx_n_s__StopIteration;
+static PyObject *__pyx_n_s__TypeError;
+static PyObject *__pyx_n_s__ValueError;
+static PyObject *__pyx_n_s__YUV420P;
+static PyObject *__pyx_n_s____decode_next_frame;
+static PyObject *__pyx_n_s____frame_mode;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s__buffer;
+static PyObject *__pyx_n_s__codec;
+static PyObject *__pyx_n_s__codec_ctx;
+static PyObject *__pyx_n_s__codec_id;
+static PyObject *__pyx_n_s__codec_name;
+static PyObject *__pyx_n_s__codec_type;
+static PyObject *__pyx_n_s__current;
+static PyObject *__pyx_n_s__data;
+static PyObject *__pyx_n_s__den;
+static PyObject *__pyx_n_s__dts;
+static PyObject *__pyx_n_s__dtype;
+static PyObject *__pyx_n_s__duration;
+static PyObject *__pyx_n_s__ffmpeg_frame_mode;
+static PyObject *__pyx_n_s__filename;
+static PyObject *__pyx_n_s__flags;
+static PyObject *__pyx_n_s__format_ctx;
+static PyObject *__pyx_n_s__frame;
+static PyObject *__pyx_n_s__frame_height;
+static PyObject *__pyx_n_s__frame_mode;
+static PyObject *__pyx_n_s__frame_number;
+static PyObject *__pyx_n_s__frame_size;
+static PyObject *__pyx_n_s__frame_width;
+static PyObject *__pyx_n_s__frameno;
+static PyObject *__pyx_n_s__framerate;
+static PyObject *__pyx_n_s__frombuffer;
+static PyObject *__pyx_n_s__get_frame_at_pts;
+static PyObject *__pyx_n_s__get_frame_no;
+static PyObject *__pyx_n_s__height;
+static PyObject *__pyx_n_s__linesize;
+static PyObject *__pyx_n_s__max_b_frames;
+static PyObject *__pyx_n_s__mode;
+static PyObject *__pyx_n_s__name;
+static PyObject *__pyx_n_s__nb_streams;
+static PyObject *__pyx_n_s__ndarray;
+static PyObject *__pyx_n_s__num;
+static PyObject *__pyx_n_s__numpy;
+static PyObject *__pyx_n_s__packet;
+static PyObject *__pyx_n_s__pix_fmt;
+static PyObject *__pyx_n_s__pts;
+static PyObject *__pyx_n_s__r_frame_rate;
+static PyObject *__pyx_n_s__range;
+static PyObject *__pyx_n_s__raw;
+static PyObject *__pyx_n_s__round;
+static PyObject *__pyx_n_s__scale_mode;
+static PyObject *__pyx_n_s__shape;
+static PyObject *__pyx_n_s__size;
+static PyObject *__pyx_n_s__skip_frame;
+static PyObject *__pyx_n_s__skip_idct;
+static PyObject *__pyx_n_s__start_time;
+static PyObject *__pyx_n_s__stream;
+static PyObject *__pyx_n_s__stream_index;
+static PyObject *__pyx_n_s__streamno;
+static PyObject *__pyx_n_s__streams;
+static PyObject *__pyx_n_s__time_base;
+static PyObject *__pyx_n_s__timestamp;
+static PyObject *__pyx_n_s__uint8;
+static PyObject *__pyx_n_s__width;
+static PyObject *__pyx_n_s__xrange;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_3;
+static PyObject *__pyx_k_4;
+static PyObject *__pyx_k_5;
+
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":86
  * 
  *     property frame_mode:
  *         def __set__(self, mode):             # <<<<<<<<<<<<<<
 static int __pyx_pf_7ffvideo_11VideoStream_10frame_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode); /*proto*/
 static int __pyx_pf_7ffvideo_11VideoStream_10frame_mode___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mode) {
   int __pyx_r;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  __Pyx_SetupRefcountContext("__set__");
-
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":87
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_t_5;
+  __Pyx_RefNannySetupContext("__set__");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+  __Pyx_INCREF(__pyx_v_mode);
+
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":87
  *     property frame_mode:
  *         def __set__(self, mode):
  *             if mode not in FRAME_MODES:             # <<<<<<<<<<<<<<
  *                 raise FFVideoValueError("Not supported frame mode")
  *             self.__frame_mode = mode
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FRAME_MODES); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = (!PySequence_Contains(__pyx_1, __pyx_v_mode)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  if (__pyx_t_1) {
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":88
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FRAME_MODES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_1, __pyx_v_mode))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_2) {
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":88
  *         def __set__(self, mode):
  *             if mode not in FRAME_MODES:
  *                 raise FFVideoValueError("Not supported frame mode")             # <<<<<<<<<<<<<<
  *             self.__frame_mode = mode
  *             self.ffmpeg_frame_mode = FRAME_MODES[mode]
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FFVideoValueError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_INCREF(__pyx_kp_8);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_8);
-    __Pyx_GIVEREF(__pyx_kp_8);
-    __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FFVideoValueError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_1));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L5;
   }
   __pyx_L5:;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":89
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":89
  *             if mode not in FRAME_MODES:
  *                 raise FFVideoValueError("Not supported frame mode")
  *             self.__frame_mode = mode             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->__pyx___frame_mode);
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->__pyx___frame_mode = __pyx_v_mode;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":90
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":90
  *                 raise FFVideoValueError("Not supported frame mode")
  *             self.__frame_mode = mode
  *             self.ffmpeg_frame_mode = FRAME_MODES[mode]             # <<<<<<<<<<<<<<
  * 
  *         def __get__(self):
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_FRAME_MODES); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_mode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_2);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->ffmpeg_frame_mode = __pyx_t_4;
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FRAME_MODES); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_v_mode); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->ffmpeg_frame_mode = __pyx_t_5;
 
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
-  __Pyx_XDECREF(__pyx_2);
-  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("ffvideo.VideoStream.frame_mode.__set__");
   __pyx_r = -1;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_DECREF(__pyx_v_mode);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":92
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":92
  *             self.ffmpeg_frame_mode = FRAME_MODES[mode]
  * 
  *         def __get__(self):             # <<<<<<<<<<<<<<
 static PyObject *__pyx_pf_7ffvideo_11VideoStream_10frame_mode___get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pf_7ffvideo_11VideoStream_10frame_mode___get__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
-  __Pyx_SetupRefcountContext("__get__");
-
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":93
+  __Pyx_RefNannySetupContext("__get__");
+
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":93
  * 
  *         def __get__(self):
  *             return self.__frame_mode             # <<<<<<<<<<<<<<
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":96
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":96
  * 
  *     property frame_size:
  *         def __set__(self, size):             # <<<<<<<<<<<<<<
   PyObject *__pyx_v_fh;
   PyObject *__pyx_v_e;
   int __pyx_r;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
-  PyObject *__pyx_3 = 0;
-  int __pyx_4;
-  PyObject *__pyx_5 = 0;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
+  PyObject *__pyx_t_3 = NULL;
   int __pyx_t_4;
-  int __pyx_t_5;
+  PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  __Pyx_SetupRefcountContext("__set__");
+  PyObject *__pyx_t_7 = NULL;
+  int __pyx_t_8;
+  int __pyx_t_9;
+  int __pyx_t_10;
+  __Pyx_RefNannySetupContext("__set__");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+  __Pyx_INCREF(__pyx_v_size);
   __pyx_v_fw = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_fh = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_e = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":97
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":97
  *     property frame_size:
  *         def __set__(self, size):
  *             try:             # <<<<<<<<<<<<<<
     __Pyx_XGOTREF(__pyx_save_exc_tb);
     /*try:*/ {
 
-      /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":98
+      /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":98
  *         def __set__(self, size):
  *             try:
  *                 fw, fh = size             # <<<<<<<<<<<<<<
  */
       if (PyTuple_CheckExact(__pyx_v_size) && likely(PyTuple_GET_SIZE(__pyx_v_size) == 2)) {
         PyObject* tuple = __pyx_v_size;
-        __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
-        __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
+        __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_v_fw);
-        __pyx_v_fw = __pyx_2;
-        __pyx_2 = 0;
+        __pyx_v_fw = __pyx_t_1;
+        __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_v_fh);
-        __pyx_v_fh = __pyx_3;
-        __pyx_3 = 0;
+        __pyx_v_fh = __pyx_t_2;
+        __pyx_t_2 = 0;
       } else {
-        __pyx_1 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-        __Pyx_GOTREF(__pyx_1);
-        __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-        __Pyx_GOTREF(__pyx_2);
-        __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-        __Pyx_GOTREF(__pyx_3);
-        if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-        __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+        __pyx_t_3 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_3, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        if (__Pyx_EndUnpack(__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_v_fw);
-        __pyx_v_fw = __pyx_2;
-        __pyx_2 = 0;
+        __pyx_v_fw = __pyx_t_1;
+        __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_v_fh);
-        __pyx_v_fh = __pyx_3;
-        __pyx_3 = 0;
+        __pyx_v_fh = __pyx_t_2;
+        __pyx_t_2 = 0;
       }
     }
     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
     goto __pyx_L12_try_end;
     __pyx_L5_error:;
-    __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
-    __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
-    __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":99
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":99
  *             try:
  *                 fw, fh = size
  *             except (TypeError, ValueError), e:             # <<<<<<<<<<<<<<
  *                 raise FFVideoValueError("frame_size must be a tuple (int, int)")
  *             if fw is None and fh is None:
  */
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_builtin_TypeError);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_TypeError);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_TypeError);
     __Pyx_GIVEREF(__pyx_builtin_TypeError);
     __Pyx_INCREF(__pyx_builtin_ValueError);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError);
     __Pyx_GIVEREF(__pyx_builtin_ValueError);
-    __pyx_4 = PyErr_ExceptionMatches(((PyObject *)__pyx_t_1));
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    if (__pyx_4) {
-      __Pyx_AddTraceback("ffvideo.__set__");
-      if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_1);
-      __Pyx_GOTREF(__pyx_2);
-      __Pyx_GOTREF(__pyx_3);
-      __Pyx_INCREF(__pyx_2);
+    __pyx_t_4 = PyErr_ExceptionMatches(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_4) {
+      __Pyx_AddTraceback("ffvideo.VideoStream.frame_size.__set__");
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_v_e);
-      __pyx_v_e = __pyx_2;
-
-      /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":100
+      __pyx_v_e = __pyx_t_1;
+
+      /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":100
  *                 fw, fh = size
  *             except (TypeError, ValueError), e:
  *                 raise FFVideoValueError("frame_size must be a tuple (int, int)")             # <<<<<<<<<<<<<<
  *             if fw is None and fh is None:
  *                 raise FFVideoValueError("both width and height cannot be None")
  */
-      __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_FFVideoValueError); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_5);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      __Pyx_INCREF(__pyx_kp_9);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_9);
-      __Pyx_GIVEREF(__pyx_kp_9);
-      __pyx_t_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_5); __pyx_5 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0);
+      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FFVideoValueError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
+      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_2));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
+      __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_Raise(__pyx_t_7, 0, 0);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-      __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-      __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       goto __pyx_L6_exception_handled;
     }
     __pyx_L7_except_error:;
-    __Pyx_XDECREF(__pyx_save_exc_type);
-    __Pyx_XDECREF(__pyx_save_exc_value);
-    __Pyx_XDECREF(__pyx_save_exc_tb);
+    __Pyx_XGIVEREF(__pyx_save_exc_type);
+    __Pyx_XGIVEREF(__pyx_save_exc_value);
+    __Pyx_XGIVEREF(__pyx_save_exc_tb);
+    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
     goto __pyx_L1_error;
     __pyx_L6_exception_handled:;
     __Pyx_XGIVEREF(__pyx_save_exc_type);
     __pyx_L12_try_end:;
   }
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":101
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":101
  *             except (TypeError, ValueError), e:
  *                 raise FFVideoValueError("frame_size must be a tuple (int, int)")
  *             if fw is None and fh is None:             # <<<<<<<<<<<<<<
  *                 raise FFVideoValueError("both width and height cannot be None")
  * 
  */
-  __pyx_t_3 = (__pyx_v_fw == Py_None);
-  if (__pyx_t_3) {
-    __pyx_t_4 = (__pyx_v_fh == Py_None);
-    __pyx_t_5 = __pyx_t_4;
+  __pyx_t_8 = (__pyx_v_fw == Py_None);
+  if (__pyx_t_8) {
+    __pyx_t_9 = (__pyx_v_fh == Py_None);
+    __pyx_t_10 = __pyx_t_9;
   } else {
-    __pyx_t_5 = __pyx_t_3;
+    __pyx_t_10 = __pyx_t_8;
   }
-  if (__pyx_t_5) {
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":102
+  if (__pyx_t_10) {
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":102
  *                 raise FFVideoValueError("frame_size must be a tuple (int, int)")
  *             if fw is None and fh is None:
  *                 raise FFVideoValueError("both width and height cannot be None")             # <<<<<<<<<<<<<<
  * 
  *             if fw is None:
  */
-    __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_FFVideoValueError); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_5);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_INCREF(__pyx_kp_10);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_10);
-    __Pyx_GIVEREF(__pyx_kp_10);
-    __pyx_t_1 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FFVideoValueError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_5); __pyx_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
+    __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L15;
   }
   __pyx_L15:;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":104
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":104
  *                 raise FFVideoValueError("both width and height cannot be None")
  * 
  *             if fw is None:             # <<<<<<<<<<<<<<
  *                 self.frame_width = round(fh * <float>self.width / self.height / 2.0) * 2
  *                 self.frame_height = round(fh / 2.0) * 2
  */
-  __pyx_t_5 = (__pyx_v_fw == Py_None);
-  if (__pyx_t_5) {
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":105
+  __pyx_t_10 = (__pyx_v_fw == Py_None);
+  if (__pyx_t_10) {
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":105
  * 
  *             if fw is None:
  *                 self.frame_width = round(fh * <float>self.width / self.height / 2.0) * 2             # <<<<<<<<<<<<<<
  *                 self.frame_height = round(fh / 2.0) * 2
  *             elif fh is None:
  */
-    __pyx_t_1 = PyFloat_FromDouble(((float)((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->width)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(((float)((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->width)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyNumber_Multiply(__pyx_v_fh, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyNumber_Multiply(__pyx_v_fh, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_7;
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":106
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_4;
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":106
  *             if fw is None:
  *                 self.frame_width = round(fh * <float>self.width / self.height / 2.0) * 2
  *                 self.frame_height = round(fh / 2.0) * 2             # <<<<<<<<<<<<<<
  *             elif fh is None:
  *                 self.frame_width = round(fw / 2.0) * 2
  */
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_fh, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_fh, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_7;
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_4;
     goto __pyx_L16;
   }
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":107
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":107
  *                 self.frame_width = round(fh * <float>self.width / self.height / 2.0) * 2
  *                 self.frame_height = round(fh / 2.0) * 2
  *             elif fh is None:             # <<<<<<<<<<<<<<
  *                 self.frame_width = round(fw / 2.0) * 2
  *                 self.frame_height = round(fw * <float>self.height / self.width / 2.0) * 2
  */
-  __pyx_t_5 = (__pyx_v_fh == Py_None);
-  if (__pyx_t_5) {
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":108
+  __pyx_t_10 = (__pyx_v_fh == Py_None);
+  if (__pyx_t_10) {
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":108
  *                 self.frame_height = round(fh / 2.0) * 2
  *             elif fh is None:
  *                 self.frame_width = round(fw / 2.0) * 2             # <<<<<<<<<<<<<<
  *                 self.frame_height = round(fw * <float>self.height / self.width / 2.0) * 2
  *             else:
  */
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_fw, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_fw, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_7;
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":109
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_4;
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":109
  *             elif fh is None:
  *                 self.frame_width = round(fw / 2.0) * 2
  *                 self.frame_height = round(fw * <float>self.height / self.width / 2.0) * 2             # <<<<<<<<<<<<<<
  *             else:
  *                 self.frame_width = round(fw / 2.0) * 2
  */
-    __pyx_t_1 = PyFloat_FromDouble(((float)((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->height)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(((float)((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->height)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyNumber_Multiply(__pyx_v_fw, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyNumber_Multiply(__pyx_v_fw, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_7;
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_4;
     goto __pyx_L16;
   }
   /*else*/ {
 
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":111
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":111
  *                 self.frame_height = round(fw * <float>self.height / self.width / 2.0) * 2
  *             else:
  *                 self.frame_width = round(fw / 2.0) * 2             # <<<<<<<<<<<<<<
  *                 self.frame_height = round(fh / 2.0) * 2
  * 
  */
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_fw, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_fw, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_7;
-
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":112
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_width = __pyx_t_4;
+
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":112
  *             else:
  *                 self.frame_width = round(fw / 2.0) * 2
  *                 self.frame_height = round(fh / 2.0) * 2             # <<<<<<<<<<<<<<
  * 
  *         def __get__(self):
  */
-    __pyx_t_1 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_fh, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_fh, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_7;
+    ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height = __pyx_t_4;
   }
   __pyx_L16:;
 
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
-  __Pyx_XDECREF(__pyx_2);
-  __Pyx_XDECREF(__pyx_3);
-  __Pyx_XDECREF(__pyx_5);
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("ffvideo.VideoStream.frame_size.__set__");
   __pyx_r = -1;
   __pyx_L0:;
   __Pyx_DECREF(__pyx_v_fw);
   __Pyx_DECREF(__pyx_v_fh);
   __Pyx_DECREF(__pyx_v_e);
-  __Pyx_FinishRefcountContext();
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_DECREF(__pyx_v_size);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":114
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":114
  *                 self.frame_height = round(fh / 2.0) * 2
  * 
  *         def __get__(self):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
-  __Pyx_SetupRefcountContext("__get__");
-
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":115
+  __Pyx_RefNannySetupContext("__get__");
+
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":115
  * 
  *         def __get__(self):
  *             return (self.frame_width, self.frame_height)             # <<<<<<<<<<<<<<
   __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+  __Pyx_GOTREF(__pyx_t_3);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_1 = 0;
   __pyx_t_2 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_3);
+  __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":117
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":117
  *             return (self.frame_width, self.frame_height)
  * 
  *     def __cinit__(self, filename, frame_size=None, frame_mode='RGB',             # <<<<<<<<<<<<<<
   PyObject *__pyx_v_frame_mode = 0;
   PyObject *__pyx_v_scale_mode = 0;
   int __pyx_r;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_frame_size,&__pyx_kp_frame_mode,&__pyx_kp_scale_mode,0};
-  __Pyx_SetupRefcountContext("__cinit__");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__frame_size,&__pyx_n_s__frame_mode,&__pyx_n_s__scale_mode,0};
+  __Pyx_RefNannySetupContext("__cinit__");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[4] = {0,0,0,0};
-    values[1] = Py_None;
-    values[2] = __pyx_kp_4;
-    values[3] = __pyx_k_5;
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)__pyx_n_s__RGB);
+    values[3] = __pyx_k_4;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_frame_size);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame_size);
         if (unlikely(value)) { values[1] = value; kw_args--; }
       }
       case  2:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_frame_mode);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame_mode);
         if (unlikely(value)) { values[2] = value; kw_args--; }
       }
       case  3:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale_mode);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale_mode);
         if (unlikely(value)) { values[3] = value; kw_args--; }
       }
     }
     __pyx_v_frame_mode = values[2];
     __pyx_v_scale_mode = values[3];
   } else {
-    __pyx_v_frame_size = Py_None;
-    __pyx_v_frame_mode = __pyx_kp_4;
-    __pyx_v_scale_mode = __pyx_k_5;
+    __pyx_v_frame_size = ((PyObject *)Py_None);
+    __pyx_v_frame_mode = ((PyObject *)__pyx_n_s__RGB);
+    __pyx_v_scale_mode = __pyx_k_4;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  4: __pyx_v_scale_mode = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3: __pyx_v_frame_mode = PyTuple_GET_ITEM(__pyx_args, 2);
   return -1;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":119
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":119
  *     def __cinit__(self, filename, frame_size=None, frame_mode='RGB',
  *                   scale_mode=BICUBIC):
  *         self.format_ctx = NULL             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->format_ctx = NULL;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":120
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":120
  *                   scale_mode=BICUBIC):
  *         self.format_ctx = NULL
  *         self.codec_ctx = NULL             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->codec_ctx = NULL;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":121
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":121
  *         self.format_ctx = NULL
  *         self.codec_ctx = NULL
  *         self.frame = avcodec_alloc_frame()             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frame = avcodec_alloc_frame();
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":122
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":122
  *         self.codec_ctx = NULL
  *         self.frame = avcodec_alloc_frame()
  *         self.duration = 0             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->duration = 0;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":123
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":123
  *         self.frame = avcodec_alloc_frame()
  *         self.duration = 0
  *         self.width = 0             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->width = 0;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":124
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":124
  *         self.duration = 0
  *         self.width = 0
  *         self.height = 0             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->height = 0;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":125
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":125
  *         self.width = 0
  *         self.height = 0
  *         self.frameno = 0             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->frameno = 0;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":126
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":126
  *         self.height = 0
  *         self.frameno = 0
  *         self.streamno = -1             # <<<<<<<<<<<<<<
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->streamno = -1;
 
   __pyx_r = 0;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":128
+/* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":128
  *         self.streamno = -1
  * 
  *     def __init__(self, filename, frame_size=None, frame_mode='RGB',             # <<<<<<<<<<<<<<
   int __pyx_v_ret;
   int __pyx_v_i;
   int __pyx_r;
-  PyObject *__pyx_1 = 0;
   int __pyx_t_1;
   char *__pyx_t_2;
   int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
+  PyObject *__pyx_t_6 = NULL;
   int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_frame_size,&__pyx_kp_frame_mode,&__pyx_kp_scale_mode,0};
-  __Pyx_SetupRefcountContext("__init__");
+  int __pyx_t_8;
+  int __pyx_t_9;
+  double __pyx_t_10;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,&__pyx_n_s__frame_size,&__pyx_n_s__frame_mode,&__pyx_n_s__scale_mode,0};
+  __Pyx_RefNannySetupContext("__init__");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[4] = {0,0,0,0};
-    values[1] = Py_None;
-    values[2] = __pyx_kp_6;
-    values[3] = __pyx_k_7;
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)__pyx_n_s__RGB);
+    values[3] = __pyx_k_5;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_frame_size);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame_size);
         if (unlikely(value)) { values[1] = value; kw_args--; }
       }
       case  2:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_frame_mode);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame_mode);
         if (unlikely(value)) { values[2] = value; kw_args--; }
       }
       case  3:
       if (kw_args > 1) {
-        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale_mode);
+        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale_mode);
         if (unlikely(value)) { values[3] = value; kw_args--; }
       }
     }
     __pyx_v_frame_mode = values[2];
     __pyx_v_scale_mode = values[3];
   } else {
-    __pyx_v_frame_size = Py_None;
-    __pyx_v_frame_mode = __pyx_kp_6;
-    __pyx_v_scale_mode = __pyx_k_7;
+    __pyx_v_frame_size = ((PyObject *)Py_None);
+    __pyx_v_frame_mode = ((PyObject *)__pyx_n_s__RGB);
+    __pyx_v_scale_mode = __pyx_k_5;
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  4: __pyx_v_scale_mode = PyTuple_GET_ITEM(__pyx_args, 3);
       case  3: __pyx_v_frame_mode = PyTuple_GET_ITEM(__pyx_args, 2);
   __Pyx_AddTraceback("ffvideo.VideoStream.__init__");
   return -1;
   __pyx_L4_argument_unpacking_done:;
-
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":133
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+  __Pyx_INCREF(__pyx_v_filename);
+  __Pyx_INCREF(__pyx_v_frame_size);
+  __Pyx_INCREF(__pyx_v_frame_mode);
+  __Pyx_INCREF(__pyx_v_scale_mode);
+
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":133
  *         cdef int i
  * 
  *         self.filename = filename             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->filename);
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->filename = __pyx_v_filename;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":135
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":135
  *         self.filename = filename
  * 
  *         self.frame_mode = frame_mode             # <<<<<<<<<<<<<<
  *         self.scale_mode = scale_mode
  * 
  */
-  if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_frame_mode, __pyx_v_frame_mode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":136
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__frame_mode, __pyx_v_frame_mode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":136
  * 
  *         self.frame_mode = frame_mode
  *         self.scale_mode = scale_mode             # <<<<<<<<<<<<<<
   __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_scale_mode); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   ((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->scale_mode = __pyx_t_1;
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":138
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":138
  *         self.scale_mode = scale_mode
  * 
  *         ret = av_open_input_file(&self.format_ctx, filename, NULL, 0, NULL)             # <<<<<<<<<<<<<<
   __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_ret = av_open_input_file((&((struct __pyx_obj_7ffvideo_VideoStream *)__pyx_v_self)->format_ctx), __pyx_t_2, NULL, 0, NULL);
 
-  /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":139
+  /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":139
  * 
  *         ret = av_open_input_file(&self.format_ctx, filename, NULL, 0, NULL)
  *         if ret != 0:             # <<<<<<<<<<<<<<
   __pyx_t_3 = (__pyx_v_ret != 0);
   if (__pyx_t_3) {
 
-    /* "/home/zakhar/workspace2/ffvideo/ffvideo/ffvideo.pyx":140
+    /* "/home/zakhar/workspace/ffvideo/src/ffvideo/ffvideo.pyx":140
  *         ret = av_open_input_file(&self.format_ctx, filename, NULL, 0, NULL)
  *         if ret != 0:
  *             raise DecoderError("Unable to open file %s" % filename)             # <<<<<<<<<<<<<<
  * 
  *         ret = av_find_stream_info(self.format_ctx)
  */
-    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DecoderError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __pyx_t_4 = PyNumber_Remainder(__pyx_kp_11, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DecoderError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0);
+    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_filename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);