Going one step forward

22 views
Skip to first unread message

nouvel

unread,
Jun 21, 2009, 9:54:03 PM6/21/09
to pyffmpeg-dev
Dear Pyffmpeg developpers,

Well so far, I haven't received any answer about my proposal branch
for a new version of pyffmpeg2.
I will try to continue to improve it for a few days, and then I hope
to turn it into a beta.

I may need help for :
- writing example applications
- checking support on all platforms
- supporting streamed contents

I am looking forward those that want to help.

Bertrand Nouvel

Sebastien

unread,
Jun 28, 2009, 12:03:32 PM6/28/09
to pyffmpeg-dev
Hi Bertrand,
thanks for your work on this new version, and sorry for the late, i
had not seen your earlier message.
I will try it this week on GNU/Linux only.

Séb

Sébastien Campion

unread,
Jun 29, 2009, 3:11:09 AM6/29/09
to pyffmpeg-dev
Hi,
some feedback on Linux,

With an Ubuntu 8.10 Intrepid, cython seems to be too old

cythoning pyffmpegb.pyx to pyffmpegb.c

Error converting Pyrex file to C:
------------------------------------------------------------
...
    cdef AVPacket * prepacket
    cdef AVPacket packetbufa
    cdef AVPacket packetbufb
    cdef int altpacket
    #
    cdef bool observers_enabled
             ^
------------------------------------------------------------

/tmp/pyffmpeg/branches/pyffmpeg2-alpha-candidate/pyffmpegb.pyx:979:14: Syntax error in C variable declaration

For information (apt-cache show cython )  :

Package: cython
Priority: optional
Section: universe/python
Maintainer: Ubuntu MOTU Developers <ubunt...@lists.ubuntu.com>
Original-Maintainer: Python Applications Packaging Team <python-a...@lists.alioth.debian.org>
Architecture: all
Version: 0.9.6.14-1



On Debian Squeeze, i have a strange message :

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ffmpeg -I/usr/include/libavcodec -I/usr/include/libavutil -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/include/python2.5 -c pyffmpegb.c -o build/temp.linux-i686-2.5/pyffmpegb.o
pyffmpegb.c: In function ‘__pyx_f_9pyffmpegb_av_read_frame_flush’:
pyffmpegb.c:1326: error: ‘AVStream’ has no member named ‘cur_pkt’


My ffmpeg  packages are :

ii  libavcodec52                              5:0.5+svn20090508-0.1       library to encode decode multimedia streams - runtime f
ii  libavdevice52                             5:0.5+svn20090508-0.1       ffmpeg device handling library
ii  libavfilter0                              5:0.5+svn20090508-0.1       a graphics library;
ii  libavformat52                             5:0.5+svn20090508-0.1       ffmpeg file format library
ii  libavutil50                               5:0.5+svn20090508-0.1       avutil shared libraries


I'll check my ffmpeg installation.

Wich version of ffmpeg are you using ?


Sébastien





2009/6/28 Sebastien <sebastie...@gmail.com>

Bertrand Nouvel

unread,
Jun 29, 2009, 3:58:45 AM6/29/09
to pyffmp...@googlegroups.com
Hi Sebastian,

Thanks for your comments.

For the ubuntu, yes, I guess you should upgrade your cython

$ cython --version
Cython version 0.11.2

I'll remember to write this in README file.

For the FFMPEG related bug, I was on a 200903 svn release, I will try to upgrade to check
whether the bug appears.

Bertrand





2009/6/29 Sébastien Campion <sebastie...@gmail.com>

Bertrand Nouvel

unread,
Jun 29, 2009, 4:21:47 AM6/29/09
to pyffmp...@googlegroups.com
I just made some tests with the latest version of pyffmpeg. There is no
compilation problem and AVStream structure does have a "cur_pkt" field,
the headers "avformat.h" starts with this version information :

#define LIBAVFORMAT_VERSION_MAJOR 52
#define LIBAVFORMAT_VERSION_MINOR 36
#define LIBAVFORMAT_VERSION_MICRO  0

However, AVFormatContext has a deprecated "cur_pkt" field but I believe dependencies to this field have already
been removed. Your version seem quite recent so you should have the same.
Can you please recheck your headers to see ‘AVStream' structure really lacks the "cur_pkt" field.

Thanks,

Bertrand


2009/6/29 Bertrand Nouvel <bertran...@gmail.com>

Sébastien Campion

unread,
Jun 29, 2009, 7:28:44 AM6/29/09
to pyffmp...@googlegroups.com
I'd clean my apt source package and previous manual install and all seems to be ok now.

Config : Debian/Squeeze using default repository

For information,
#define LIBAVFORMAT_VERSION_MAJOR 52
#define LIBAVFORMAT_VERSION_MINOR 31
#define LIBAVFORMAT_VERSION_MICRO  0


An issue appear with cython :
PyBool_CheckExact not found

As explain in this thread [1] i replace bool by bint. Maybe it's a bug with cython [2]
and example work.

I correct example import oss and get_samplerate, see the patch.

  1. http://www.mail-archive.com/cytho...@codespeak.net/msg04003.html
  2. http://trac.cython.org/cython_trac/ticket/227

Sébastien


Index: pyffmpegb.pyx
===================================================================
--- pyffmpegb.pyx       (revision 12)
+++ pyffmpegb.pyx       (working copy)
@@ -976,7 +976,7 @@

     cdef AVPacket packetbufb
     cdef int altpacket
     #
-    cdef bool observers_enabled
+    cdef bint observers_enabled
 
 
     cdef AVFormatContext *FormatCtx
@@ -1701,7 +1701,7 @@
           self.FormatCtx=NULL
 
     cdef read_packet(self):
-        cdef bool packet_processed=False
+        cdef bint packet_processed=False
         while not packet_processed:
             #ret = av_read_frame(self.FormatCtx,self.packet)
             #if ret < 0:

Index: examples/example0.py
===================================================================
--- examples/example0.py        (revision 12)
+++ examples/example0.py        (working copy)
@@ -10,7 +10,7 @@
 from PyQt4 import QtGui
 
 import sys, numpy
-import ossaudiodev as oss
+import oss
 
 try:
     LazyDisplayQt__imgconvarray={
@@ -76,7 +76,7 @@
 
 ao=oss.open_audio()
 ao.stereo(1)
-ao.speed(tracks[1].get_sample_rate())
+ao.speed(tracks[1].get_samplerate())
 ao.format(oss.AFMT_S16_LE)
 tracks[1].set_observer(lambda x:ao.write(x[0].data))
 tracks[0].seek_to_seconds(10)



2009/6/29 Bertrand Nouvel <bertran...@gmail.com>

Sébastien Campion

unread,
Jun 29, 2009, 7:38:11 AM6/29/09
to pyffmp...@googlegroups.com
It's work well with clean avi file, but not with MPEG2 TS data.

[swscaler @ 0x99598b0]No accelerated colorspace conversion found.
Traceback (most recent call last):
  File "examples/example0.py", line 82, in <module>
    tracks[0].seek_to_seconds(10)
  File "pyffmpegb.pyx", line 1512, in pyffmpegb.VideoTrack.seek_to_seconds (pyffmpegb.c:11325)
    self.seek_to_pts(pts)
  File "pyffmpegb.pyx", line 1518, in pyffmpegb.VideoTrack.seek_to_pts (pyffmpegb.c:11388)
    self.vr.seek_to(pts)
  File "pyffmpegb.pyx", line 1772, in pyffmpegb.FFMpegReader.seek_to (pyffmpegb.c:14071)
    ret = av_seek_frame(self.FormatCtx,-1,ppts,  AVSEEK_FLAG_BACKWARD)#|AVSEEK_FLAG_ANY)
OverflowError: long too big to convert


2009/6/29 Sébastien Campion <sebastie...@gmail.com>

Bertrand Nouvel

unread,
Jun 30, 2009, 3:31:42 AM6/30/09
to pyffmp...@googlegroups.com
Sebastien,

Thanks, a lot for these bugs, I have included minor fixups.
You should now be able to play a TS file (but not seeking into it for the moment).
I'll try to have a look soon.

Bertrand

Sébastien Campion

unread,
Jul 3, 2009, 5:39:36 AM7/3/09
to pyffmp...@googlegroups.com
Hi Bertrand,

I had commit example2 based on pygtk. It works but too slowly, i try to find a solution.

I also update my repo but the issue with mpeg2 ts file isn't corrected.

Sébastien

2009/6/30 Bertrand Nouvel <bertran...@gmail.com>

Bertrand Nouvel

unread,
Jul 20, 2009, 10:08:39 PM7/20/09
to pyffmp...@googlegroups.com
Hi Sebastien,

Sorry, I went busy, and then I took my vacations.


Thanks for the PyGTK example.

Is it possible for you to send me the TS file where the problem
occurs, or at least the head of the file.

Thanks

Bertrand

Reply all
Reply to author
Forward
0 new messages