InDashPC.org Forum Index InDashPC.org
In Dash Car PC forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

player.py pymedia example problem - video speed too quick

 
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software
View previous topic :: View next topic  
Author Message
god_of_war



Joined: 05 Nov 2007
Posts: 3

PostPosted: Mon Nov 05, 2007 5:07 am    Post subject: player.py pymedia example problem - video speed too quick Reply with quote

Hi,

I just came across pymedia and thought I would have a go with it. I am using python 2.4.4 with pymedia 1.3.7.2.win32-py2.4

I thought I would start by looking at one of the examples provided, so started with player.py. When I run it the video is shown and the audio played, however they are not in sync, the video is being displayed too quickly.

For the life of me I cannot figure out why this is happening, or find anything in the documentations to do with the player class that allows any options on frame rate to be altered.

Any help would be very much appreciated.

Regards

God_of_war
Back to top
View user's profile Send private message
jbors
Site Admin


Joined: 12 Nov 2004
Posts: 1675

PostPosted: Mon Nov 05, 2007 10:28 pm    Post subject: Reply with quote

Can you try to use other examples like vplayer_thread or vplayer.py ?
Back to top
View user's profile Send private message
god_of_war



Joined: 05 Nov 2007
Posts: 3

PostPosted: Tue Nov 06, 2007 6:24 am    Post subject: Reply with quote

Hi jbors,

Thank you for your reply. As you suggested I tried the example vplayer.py.

Again this did not work, however it had different symptoms. In both cases the audio plays fine, however in this case the video plays for a few frames, but then stops. It is possible to get it to show a few frames before stopping again by pressing the left and right arrow keys.

This is the output I got:

Quote:

Main video loop has started.
({'index': 0, 'block_align': 0, 'type': 0, 'frame_rate_base': 1001, 'height': 24
0, 'channels': 0, 'width': 352, 'length': 19, 'sample_rate': 0, 'frame_rate': 30
000, 'bitrate': 0, 'id': 12}, {'index': 1, 'block_align': 4, 'type': 1, 'frame_r
ate_base': 1, 'height': 0, 'channels': 2, 'width': 0, 'length': 4, 'sample_rate'
: 44100, 'frame_rate': 25, 'bitrate': 1411200, 'id': 65536})
C:\Program Files\Python25\lib\site-packages\pymedia\video\ext_codecs\__init__.py
:59: DeprecationWarning: raising a string exception is deprecated
raise 'No codec with id %d exists' % id
!! 0.0 0 0 0.0 1 0 0.566893424036
!! 0.0333666666667 1 0.0333666666667 0.0 2 0 0.736961451247
!! 0.0333666666667 1 0.0333666666667 0.0 3 0 0.793650793651
!! 0.0333666666667 1 0.0333666666667 0.0 4 0 0.850340136054
!! 0.0333666666667 1 0.0333666666667 0.0 5 0 0.907029478458
!! -0.00826598561605 1 0.0333666666667 0.0444444455206 5 0 0.861133786497
!! 0.00696008936961 2 0.0667333333333 0.0702040791512 5 0 0.892244894556
!! 0.00821791270971 3 0.1001 0.0992290228605 5 0 0.91945578386
!! 0.00339863273303 4 0.133466666667 0.136961445212 5 0 0.938503399829
!! 0.0124569159349 5 0.166833333333 0.164263039827 5 0 0.968072569255
!! -0.0588356036345 5 0.166833333333 0.229115650058 5 0 0.903129255657
!! -0.0457863871336 6 0.2002 0.249070301652 4 0 0.882993182425
!! -0.0299254109224 7 0.233566666667 0.267120182514 3 0 0.864580502991
!! -0.0193251555602 8 0.266933333333 0.290521532297 2 0 0.841088434939
!! -0.0348473808289 9 0.3003 0.338956922293 1 0 0.792925169949
!! -0.0681474066575 10 0.333666666667 0.405623584986 1 0 0.8398185988
!! -0.0651662044207 11 0.367033333333 0.436190485954 1 0 0.863401345926
!! -0.0732507833004 12 0.4004 0.481723368168 1 0 0.933696154361
!! -0.095757123216 13 0.433766666667 0.533242642879 1 0 0.905442171291
!! -0.120349655501 14 0.467133333333 0.591020405293 1 0 0.867845830096
!! -0.113377534866 15 0.5005 0.619501113892 1 0 0.84868478642
!! -0.128355539926 16 0.533866666667 0.666938781738 1 0 0.821428599395
!! -0.148685028807 17 0.567233333333 0.722902476788 1 0 0.799365103823
!! -0.150420431519 18 0.6006 0.754376411438 1 0 0.786893431702
!! -0.158414262327 19 0.633966666667 0.796281158924 1 0 0.751859432705
!! -0.227995486418 20 0.667333333333 0.899863958359 1 0 0.668911586229
!! -0.237622007656 21 0.7007 0.942131519318 1 0 0.663718827733
!! -0.241987763341 22 0.734066666667 0.993741512299 1 0 0.632018160766
!! -0.24989087588 23 0.767433333333 1.02240359783 1 0 0.613310708437
!! -0.247635330391 24 0.8008 1.0524263382 1 0 0.603650825829
!! -0.264427402814 25 0.834166666667 1.10240364075 1 0 0.563809473812
!! -0.270607225863 26 0.867533333333 1.15328800678 1 0 0.535419539367
!! -0.287127262688 27 0.9009 1.19274377823 1 0 0.505102055911
!! -0.30083539079 28 0.934266666667 1.2418140173 1 0 0.456938761119
!! -0.322434697024 29 0.967633333333 1.29405891895 1 0 0.405510204676
!! -0.325530575752 30 1.001 1.3312472105 1 0 0.368049877528
!! -0.334703624852 31 1.03436666667 1.37351477146 1 0 0.348571459496
!! -0.355849458949 32 1.06773333333 1.42639458179 1 0 0.30682538145
!! -0.344342199707 33 1.1011 1.44843542576 1 0 0.284693819217
!! -0.34988711408 34 1.13446666667 1.48689341545 1 0 0.246417266063
!! -0.339468235652 35 1.16783333333 1.51038551331 1 0 0.222925168208
!! -0.335217245865 36 1.2012 1.53950119019 1 0 0.19344673746
!! -0.340217969831 37 1.23456666667 1.57750570774 1 0 0.155804973773
!! -0.32698730189 38 1.26793333333 1.59746026993 1 0 0.159251668242
!! -0.313212443542 39 1.3013 1.61732423306 1 0 0.149433056589
!! -0.308598580678 40 1.33466666667 1.64707481861 1 0 0.119319717165
!! -0.303168491809 41 1.36803333333 1.67410433292 1 0 0.0921996037922
!! -0.305357426262 42 1.4014 1.70947849751 1 0 0.0570974748097
!! -0.291945321782 43 1.43476666667 1.72934246063 1 0 0.0372335116825
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:



p.s.I came across the version of pymedia for python 2.5, so tried that instead, it shows exactly the same problems.
Back to top
View user's profile Send private message
jbors
Site Admin


Joined: 12 Nov 2004
Posts: 1675

PostPosted: Wed Nov 07, 2007 8:33 am    Post subject: Reply with quote

Yeah, I know there are some issues in player app.
I'm working on it now and will let you know by end of the next week.
Back to top
View user's profile Send private message
god_of_war



Joined: 05 Nov 2007
Posts: 3

PostPosted: Wed Nov 07, 2007 8:47 am    Post subject: Reply with quote

Again thank you jbors for getting back to me.

When you say "there are some issues in player app" do you mean the player class in player.py. Since I am also having problems with vplayer.py, which from my understanding doesn't use the player class.

The problems I am having seem to be related to the message "raise 'No codec with id %d exists' % id". What is this referring to. I am right in thinking that pymedia doesn't have any external codec dependencies, am I?
Back to top
View user's profile Send private message
psvieira



Joined: 02 Sep 2008
Posts: 1

PostPosted: Tue Sep 02, 2008 11:18 am    Post subject: Reply with quote

god_of_war,

I'm having the same problem with player.py. The video and audio aren't in sync too. I tried to limit the FPS for that the images don't be displayed too quickly, but I didn't find how to do this in pymedia.

Did you solve this problem? If yes, what did you do?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group