Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows, av.logging messages like crazy, then crash #153

Closed
beville opened this issue Mar 19, 2016 · 3 comments
Closed

On Windows, av.logging messages like crazy, then crash #153

beville opened this issue Mar 19, 2016 · 3 comments

Comments

@beville
Copy link

beville commented Mar 19, 2016

Hey there, thanks putting together this great project. I recently used pyav to as part of a custom video app using PyQt4 on Linux. I'm trying to get the app running on Windows, but have run into a snag with pyav.

I came across this link (https://github.com/MichaelBarz/PyAV/tree/master/dist) in #38 and was able to install the wheel file without any issues. (Running on Windows 10, 32-bit, Python 2.7 (from Anaconda)).

On the first call to av.open(), I start getting a flood of messages like:

av.logging: vasprintf errored on (null): Probing %s score:%d size:%d
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: Format %s probed with size=%d and score=%d
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: ISO: File Type Major Brand: %.4s
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: time scale = %i
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: type: %08x '%.4s' parent:'%.4s' sz: %lld %lld %lld
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: type: %08x '%.4s' parent:'%.4s' sz: %lld %lld %lld
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: ctype= %.4s (0x%08x)
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: stype= %.4s
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: type: %08x '%.4s' parent:'%.4s' sz: %lld %lld %lld
av.logging: vasprintf errored on mov,mp4,m4a,3gp,3g2,mj2: type: %08x '%.4s' parent:'%.4s' sz: %lld %lld %lld

I created a simple test to recreate the problem:

import av

container = av.open('/path/to/video.mp4')
print "Got here 1"

video = next(s for s in container.streams if s.type == b'video')
print "Got here 2", video
print video

count = 0
for packet in container.demux(video):
    for frame in packet.decode():
        frame.to_image().save('frame-%04d.jpg' % frame.index)
        print "saving #", count
        count += 1
    if count > 10:
        break

Sometime the script will complete, other times will crash before writing all, or any of the frames out. In all cases, it floods the console with "av.logging: vasprintf errored on" messages.

Does anyone have any insights into what might be going on? I haven't yet tried to build my own dlls and pyd files, so maybe that would be worth a try. However, that fact that things kinda work means maybe there is something I can do to mitigate things..?

@mikeboers
Copy link
Member

My first guess is that there is a subtle difference in the Windows' vasprintf than the Linux one.

You should be able to completely cut off the library logging from the Python logging via:

import av.logging
av.logging.set_level(av.logging.QUIET)

Still seems like a PyAV "bug".

@beville
Copy link
Author

beville commented Mar 20, 2016

Well, bad news is that setting the log level to av.logging.QUIET didn't stop the flood. Good news is that for some reason, after a Windows reboot, neither the test app or my actual application are crashing. If redirect the command to 'nul', things are more or less working perfectly.

When I have time, I'm going to go through the entire ffmpeg build process, and I'll report back. Then at least I'll be able to tweak the pyav source

Thanks!

@beville
Copy link
Author

beville commented Mar 22, 2016

More testing with that downloaded wheel file made it seem like a dead end. I bit the bullet today, and when through the full ffmpeg build, and then was able to generate a functional wheel that I was able to use across different machines. Gonna mark this as closed, and open a new thread with some notes on my experience with the windows build.

@beville beville closed this as completed Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants