|
|
|
Return to General Discussion
by ThomasEgi » Wed Nov 09, 2011 5:03 pm
i stumbled across a very odd thing when i tried to playback MovieTextures like in the mediaplayer code.
the movies didnt run smooth, so first i blamed the weak cpu, but then i notice panda itself ran at 800fps and there was plenty of cpu power left for decoding.
so i tried a lot of different codes, video, audio, on windows an linux , on 2 different computers. and it was the same for every combination.
the video only drew every second frame, cutting the effective video framerate in half and producing nonsmooth playback this way.
can anyone else confirm this bug?
[EDIT] it appears that this also introduces a lot of visual glitches for codecs that rely on the last frames visual content (most modern codecs like h.264 mpeg do so).
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Wed Nov 09, 2011 5:42 pm
Is this in the trunk or 1.8 version, or in a 1.7.2 or earlier version? There were some issues with ffmpeg decoding that I recently fixed.
I'm also, incidentally, working on some further performance issues in there as we speak, by offloading the video decoding onto a secondary thread if requested.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ThomasEgi » Wed Nov 09, 2011 5:51 pm
hm.. it is in the daily build. in 1.7.2 i could not test anything cause any codec other then the one used in the sneezing panda failed to play.
my linux panda version is from 5th okt. the windows one is build 368 (8th november). both versions are affected.
i do not remember having choppy playback when i worked with it in march. so i guess it is a bug that sneaked in during the last 6 month or so.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Wed Nov 09, 2011 5:55 pm
I haven't seen any problem with any of my videos; perhaps there's something unique about this one? Can you perhaps post it where I can try it out as well?
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ThomasEgi » Wed Nov 09, 2011 6:14 pm
it is not one particular video. it affects everything i tested. big bucks bunny, sintel, a whole set of videos i had on my disks. i also tried to change encoding of sintel clips. mjpeg, h.246, h.236, mpeg2, divx5,YV12 (raw). same for all.
good thing is: ffmpeg spams me with warnings every frame it decodes. so i set up a task that prints the time every 1./24 second (movies has 24 fps)
- Code: Select all
:movies:ffmpeg(warning): No accelerated colorspace conversion found. tick 1320880214.58 tick 1320880214.62 :movies:ffmpeg(warning): No accelerated colorspace conversion found. tick 1320880214.66 tick 1320880214.71 ....
as you can see, 2/24 second pass between each frame.
that makes 12 fps for the actualy decoded frames. the movie is still in sync with the audio, it just skips every 2nd frame.
setting the playback rate to 1/24 allows me to count frames,too. one every 2 seconds.
the effect is less noticeable for movies with 29 or 30 fps. but still pretty visible for scenes with motion if you have a side by side playback with vlc-player.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Wed Nov 09, 2011 6:35 pm
Hmm, I don't know why it's giving this problem for you, when I don't seem to see it. Or is it possible I am seeing it and just don't notice it?
What do you see if you set "notify-level-ffmpeg debug"?
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ThomasEgi » Wed Nov 09, 2011 6:54 pm
the effect is subtle, especially for movies with 29 or 30 fps. try setting the playrate to 1/fps. if you get one frame second, it is ok. if you wait 2 seconds for a frame. then you have the bug.
output from debug (the tick task is still running):
- Code: Select all
:movies:ffmpeg(debug): Sliding forward to 6.00195 from 6 :movies:ffmpeg(debug): Wanted 6.00195, got 6.08333 :movies:ffmpeg(warning): No accelerated colorspace conversion found. tick 1320882601.34 tick 1320882601.38 :movies:ffmpeg(debug): Sliding forward to 6.08573 from 6.08333 :movies:ffmpeg(debug): Wanted 6.08573, got 6.16667 :movies:ffmpeg(warning): No accelerated colorspace conversion found. tick 1320882601.42 tick 1320882601.47 ....
looks like the problem pops up in the numbers there,too.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by jean-claude » Wed Nov 09, 2011 7:07 pm
Hi Thomas,
Just in case it helps.
I experienced too bad behaviour of ffmpeg a couple of days ago getting warnings such as :
:movies:ffmpeg(warning): Invalid and inefficient vfw-avi packed B frames detected
neverseen before...
All this was magically fixed with David's changes in FMOD yesterday, in the CVS 1.8.0.
Maybe you'd better regenerate a build.
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by ThomasEgi » Wed Nov 09, 2011 7:28 pm
updated to lucid_64 build 336 (nov. 9) . but still the same.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by ThomasEgi » Thu Nov 10, 2011 9:57 am
i tested 60fps movie that had every frame double.
it displayed 30 and showed smooth playback.
oh and. another bug. i can open movie files ok. but when i open the same movie a 2nd time, it crashes.
- Code: Select all
:movies(error): Seek failure. Shutting down movie.
i can load as many movies as i want, but when i want to play a file i already opened, bang.
how are chances to get those bugs fixed before december? i sorta wanted to deploy stuff end of november but if they presist i have to hack some vlc player or so.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Thu Nov 10, 2011 2:45 pm
I'm investigating these bugs as we speak. Shouldn't be more than a few more days.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by drwr » Fri Nov 11, 2011 12:18 am
I've just committed several tasty fixes, please give them a try and see if it solves this issue for you. It should also improve performance considerably.
I haven't been able to reproduce this problem:
i can open movie files ok. but when i open the same movie a 2nd time, it crashes.
partly because I don't understand what you mean by "open the same movie a 2nd time". If you use loader.loadTexture(), of course, you actually get the same Texture object back, and there's no problem--but both instances have to show the same frame. If you create a MovieTexture explicitly and use tex.read() to explicitly re-read the same file, so you have two compies of the same file open that you can set to different frames, then again there's no problem, because they are two completely unrelated copies of the same file.
What else might you mean by "open the same movie a 2nd time"?
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ThomasEgi » Fri Nov 11, 2011 3:29 am
- Code: Select all
def playVid(self,vidname ,barcode): self.sound.stop() self.card1.remove() self.tex = MovieTexture("name") assert self.tex.read(vidname), "Failed to load video,%s" %(vidname)
cm = CardMaker("My Fullscreen Card"); cm.setFrameFullscreenQuad() cm.setUvRange(self.tex) self.card1 = NodePath(cm.generate()) self.card1.reparentTo(aspect2d) self.card1.setTexture(self.tex) self.sound=loader.loadSfx(vidname) self.tex.synchronizeTo(self.sound) if barcode == "trailer": self.sound.setLoop(True) else: self.sound.setLoop(False) self.sound.play()
i researched a bit more.
the first movie i load with this function runs fine,i can re-load it as often as i want.
i can also load any other movie, but those i can only load once. when i load any movie (except the first one i loaded) again, then it segfaults.
one interesting exception of that rule is the sneezing panda video. that one is perfectly fine no matter how often or when i load it. unfortunately i dont even have an divx encoder to test other vids with that codec. but even divx is affected by the half-fps bug. wasn't able to test your patches so far.
i will test as soon as the buildbot is finishes the new version. i dont have a build environment set up right now.
performance improvements are also very very welcome as i run that on an atom-cpu. so, my very personal thanks for optimizing that one,too.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by ThomasEgi » Fri Nov 11, 2011 5:05 am
ok. just tested the new build.
the good news: it did fix the half-frame issue for all videos.
more semi-good news. the crash-on-2nd-play is now less present. it still crashes if i play mjpeg encodes a 2nd time. some h.246 codecs run perfectly fine, other crash right away on first load.
i totaly cant find any differences in the files that run an the ones that dont.
and, indeed. decoding videos now takes a lot less time! big thx for that.
i will be testing all sorts of videos,container,codecs and encoders and report back as soon as i figured out what combination triggers the segfaults.
once again. thanks for your patch  it really helped me out.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by ThomasEgi » Fri Nov 11, 2011 5:46 am
small -in-between-report. the mpeg4 output by mencoder seems to work very well.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by ThomasEgi » Fri Nov 11, 2011 8:03 am
pretty much all formats i tested work when encoding with "mencoder".even the one that crashed earlier. so i guess this is more an issue of avidemux output or so. anyway videos now work pretty well. thanks a ton.
one thing you may wish to fix, as videos now spawn a new thread, they also appear as such in the pstats window-menu-bar. opening new videos will add more and more entries to the menu, old ones apparently are not removed, their stats data remains accessible.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Fri Nov 11, 2011 9:34 am
so i guess this is more an issue of avidemux output or so.
Interesting. It must be something with the sound channel, since the video channel is completely unique in this case, but your sound file is the same object (due to loader.loadSfx() returning a handle to the same object). Perhaps you could try forcing a new sound file to load with AudioManager.uncacheSound(filename). Edit: loader.unloadSfx() is probably the better interface to do this rather than low-level AudioManager.uncacheSound(). opening new videos will add more and more entries to the menu, old ones apparently are not removed
Oops, yeah, this is a PStats bug. I wasn't thinking in terms of threads coming and going when I built this PStats interface, so there's no removal of a thread from the menu after it stops. Hmm, I'll definitely have to do something about that.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by jean-claude » Fri Nov 11, 2011 10:08 am
FYI. for what it's worth.
Using the latest CVS, here is a new warning that is now popping up (I'm getting tons of it!)
:movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code
Don't know the reason and the consequence, but just to mention..
Last edited by jean-claude on Fri Nov 11, 2011 10:15 am, edited 1 time in total.
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by drwr » Fri Nov 11, 2011 10:14 am
Do you get the same warning when you just run pview on the video file? Did you get this warning prior to today's fixes? Can you post the video file where I can try it too?
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ThomasEgi » Fri Nov 11, 2011 10:53 am
talking about spam. i still get the
- Code: Select all
:movies:ffmpeg(warning): No accelerated colorspace conversion found. :movies:ffmpeg(warning): No accelerated colorspace conversion found. :movies:ffmpeg(warning): No accelerated colorspace conversion found.
at least on linux.
couldnt test the new patches on windows. the windows buildbot-build is currently a bit broken due to some NVIDIA folder error.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by jean-claude » Fri Nov 11, 2011 10:55 am
So, using today's CVS and after generating a Windows built
if the movie file is directly dropped into pview:
:movies:ffmpeg(error): frame skip 8 then immediately crashes !
my movie test file is around 1Gb, I'll try to megaupload it, but it may take some time...
any faster way to upload?
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by jean-claude » Fri Nov 11, 2011 11:32 am
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by ThomasEgi » Fri Nov 11, 2011 12:00 pm
test_3.avi runs fine for me on linux, just the regular warnings about non accelerated color-space.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by drwr » Fri Nov 11, 2011 6:29 pm
OK, I found and fixed a few more problems. Please give it another try. Thanks for your help!
Edit: Thomas, I didn't do anything with the multi-load movie issue yet. Not sure what's going on with that.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by jean-claude » Fri Nov 11, 2011 9:48 pm
No more crashes but still getting plenty of ::movies::ffmpeg (error) MS RLE: ended frame decode with bytes left over
tons of it for test2.avi file! for test3.aviKnown pipe types: wglGraphicsPipe (all display modules loaded.) Loading /c/Users/jc/Desktop/WORK/test_3.avi :movies:ffmpeg(error): frame skip 8 :movies:ffmpeg(error): frame skip 8
And still getting tons of spam on my test1.avi:movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code
When this warning starts the displayed movie texture remains black...
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by ThomasEgi » Sat Nov 12, 2011 7:57 am
so i am back from testing on my windows target machine with the latest daily build.
my mencoder movies run perfectly fine now. both , mpeg4 and mjpeg perform good, no warnings no errors. that atom-cpu even chews 720p pretty well.
i did try a 1080p vid (just for fun and testing) with 120Mbit/s video stream (even blueray is only 50MBit/s or so) and i got a whole bunch of the errors jean-claude is getting. but i don't get those for regular videos.
once again drwr, thanks a lot. if i ever open up a national park/panda protection park you will get your own monument 
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by jean-claude » Mon Nov 14, 2011 7:02 am
FYI. Tried again this morning with latest CVS... still the same symptoms as Saturday!
Use of pview - build on Windows
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
by drwr » Mon Nov 14, 2011 1:15 pm
jean-claude: these error messages are coming from the ffmpeg library which we use to decode the video. Maybe there really is something wrong with the video files? It's possible to squelch the error messages by adding the line:
- Code: Select all
notify-level-ffmpeg fatal
to your Config.prc file. However, this won't help you for the file that displays black when the error messages start. It sounds like my latest "fixes", which make Panda more responsible about responding to error conditions reported from ffmpeg, are actually causing you problems here by making Panda refuse to display a video that's reporting errors, even though it may be possible to display it anyway.
I can't reproduce this problem with my own videos. If you can post your test1.avi somewhere in spite of its size, or find a smaller video that demonstrates the same problem, I'll be happy to try to make Panda work around the problems that ffmpeg is yelling about.
Edit: I do see a problem with your test_2.avi going black after playing the first time through. Investigating.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by jean-claude » Mon Nov 14, 2011 6:24 pm
Hi David,
Here are some more details after additional testing.
I've been using test1.avi (which I'll be uploading in the next hour).
(1) Launched it with the latest pview built this afternoon (Paris time) from CVS.
The only warnings I'm getting are:
Known pipe types: wglGraphicsPipe (all display modules loaded.) Loading /c/Users/jc/Desktop/WORK/test_1.avi :movies:ffmpeg(error): frame skip 8 :movies:ffmpeg(error): frame skip 8
Then it runs fine upto the end (2) BUT!!!  Whenever launched in my app. Don't get any warnings at all... upto the time the quad on which the video is expected to play becomes visible by the camera.At this point, ffmpeg starts spamming: :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code :movies:ffmpeg(error): marker does not match f_code
and the quad remains black!
So:
> at init the camera is not looking at the quad:
> as soon as the quad is supposed to be seen :
fyi, code used to attach the video - Code: Select all
PT(Texture) stagescreen_tex = TexturePool::load_texture("test_1.avi"); cmp.set_frame(-32*dm, 32*dm, -24*dm, 24*dm); cmp.set_uv_range(stagescreen_tex);
NodePath stagescreen = stage.attach_new_node(cmp.generate()); stagescreen.set_effect(CompassEffect::make(render, CompassEffect::P_scale)); stagescreen.set_texture(stagescreen_tex); stagescreen.set_pos( 140*dm, 80*dm, 60*dm); stagescreen.set_two_sided(true); stagescreen.look_at( 140*dm, 160*dm, 60*dm); stagescreen.set_light(evambientLightNP);
BTW. It may well be that this is likely to happen with others avi. I'm on my way to check it!
-

jean-claude
-
- Posts: 378
- Joined: Sun Jan 23, 2011 1:41 pm
- Location: Paris - France
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests
| | |