Coder Social home page Coder Social logo

castro's People

Contributors

hugs avatar mikitebeka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

castro's Issues

Running castro on OSX

I feel like I'm getting close, but the generated SWF is only 70 bytes. Any ideas about the Socket errors / Broken pipe?

# get pygame something like http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lion/
brew install sdl sdl_ttf sdl_image sdl_mixer hg
pip install hg+http://bitbucket.org/pygame/pygame

# get castro
pip install castro

# Turn on VNC
* System Preferences > Sharing
* Enable Screen Sharing
* Allow access for all users
* Computer Settings > Enabled "VNC viewers may control screen with password" and set a password

# write an encrypted ~/.vnc/passwd file with your vnc password
mkdir ~/.vnc
cd /tmp
git clone https://github.com/trinitronx/vncpasswd.py.git
cd vncpasswd.py/
./vncpasswd.py -f ~/.vnc/passwd your-vnc-password

# encrypted password there seems legit
cat ~/.vnc/passwd  | base64
29g8/XJ6FFg=

# try it out
cd /tmp
python -c "import castro; castro.test()"

Recording a 10 second video...

10 Connected: localhost:5900, protocol_version=3.3, preferred_encoding=(0, -232, -239)
9 VNC Screen: size=5440x2340, name='Jason\xe2\x80\x99s MacBook Pro'
Output movie size: 5440x2340
Creating movie: '/var/folders/qz/4yw7g_b560j9ns1hqk86tyrr0000gn/T/castro-video.swf': version=5, size=5440x2340, framerate=12, compression=None
Socket error: [Errno 32] Broken pipe
8 Connected: localhost:5900, protocol_version=3.3, preferred_encoding=(0, -232, -239)
VNC Screen: size=5440x2340, name='Jason\xe2\x80\x99s MacBook Pro'
RFB error: Connection closed unexpectedly.
7 Connected: localhost:5900, protocol_version=3.3, preferred_encoding=(0, -232, -239)
6 VNC Screen: size=5440x2340, name='Jason\xe2\x80\x99s MacBook Pro'
RFB error: Connection closed unexpectedly.
5 Connected: localhost:5900, protocol_version=3.3, preferred_encoding=(0, -232, -239)
VNC Screen: size=5440x2340, name='Jason\xe2\x80\x99s MacBook Pro'
RFB error: Connection closed unexpectedly.
Writing: /var/folders/qz/4yw7g_b560j9ns1hqk86tyrr0000gn/T/castro-video.html...

ls -lah /var/folders/qz/4yw7g_b560j9ns1hqk86tyrr0000gn/T/castro-video.swf
-rw-r--r--  1 jason  staff    70B Nov 19 15:29 /var/folders/qz/4yw7g_b560j9ns1hqk86tyrr0000gn/T/castro-video.swf

Facing issues working with castro

Here's my code---
import castro
video = castro.Castro()
video.start()

The error is -

Socket error: [Errno 111] Connection refused
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(_self._args, *_self._kwargs)
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.6.egg/castro/lib/pyvnc2swf/vnc2swf.py", line 611, in main
merge=merge, debug=debug, reconnect=reconnect)
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.6.egg/castro/lib/pyvnc2swf/vnc2swf.py", line 429, in vnc2swf
client.loop()
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.6.egg/castro/lib/pyvnc2swf/rfb.py", line 489, in loop
if not self.loop1(): break
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.6.egg/castro/lib/pyvnc2swf/rfb.py", line 276, in loop1
self.request_update()
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.6.egg/castro/lib/pyvnc2swf/rfb.py", line 551, in request_update
self.send('\x03\x01' + pack('>HHHH', *self.clipping))
AttributeError: RFBNetworkClient instance has no attribute 'clipping'

not able to record getting some error

Finding files... done.
Importing test modules ... done.

Connected: localhost:5901, protocol_version=3.8, preferred_encoding=(0, -232, -239)
VNC Screen: size=1024x768, name="anuj's X desktop (gs-2671:1)"
Output movie size: 1024x768
Creating movie: '/tmp/castro-video.swf': version=5, size=1024x768, framerate=12, compression=None
Writing: /tmp/castro-video.html...
Running ffmpeg: encoding and creating keyframes
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --disable-ffserver --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc --enable-libzimg
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Option 'sameq' was removed. If you are looking for an option to preserve the quality (which is not what -sameq was for), use -qscale 0 or an equivalent quality factor option.
Failed to set value '1' for option 'sameq': Invalid argument
Error parsing global options: Invalid argument
Getting Duration:

ERROR: test_my (examples.recording_test.mypms)

Traceback (most recent call last):
File "/home/anuj/workspace/parallel_wd/examples/recording_test.py", line 27, in tearDown
self.video.process()
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.7.egg/castro/init.py", line 99, in process
self.calc_duration()
File "/usr/local/lib/python2.7/dist-packages/castro-1.0.6-py2.7.egg/castro/init.py", line 125, in calc_duration
self.duration = int(round(flv_data[flv_data.keys()[0]]['duration']))
TypeError: string indices must be integers, not str


Ran 1 test in 10.715s

FAILED (errors=1)

Traceback error when filename ends in ".vnc"

If I do this:
>>> c = Castro(filename = "my-cool-screencast.swf")
... everything is great.

BUT, if I do this:
>>> c = Castro(filename = "my-cool-screencast.vnc")

... I get this traceback:
>>> Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/processing-0.52-py2.5-linux-i686.eg
self.run()
File "/usr/lib/python2.5/site-packages/processing-0.52-py2.5-linux-i686.eg
self._target(_self._args, *_self._kwargs)
File "/usr/lib/python2.5/site-packages/castro-1.0-py2.5.egg/castro/lib/pyv
merge=merge, debug=debug)
File "/usr/lib/python2.5/site-packages/castro-1.0-py2.5.egg/castro/lib/pyv
stream.close()
UnboundLocalError: local variable 'stream' referenced before assignment

error "Missing parentheses in call to 'print'" with python3.11.2 on OSX

I get the following traceback message when trying to run a module that imports castro:

tests/examples/test_website.py:4: in
from castro import Castro
E File "/Users/derek/dev/v3/lib/python3.11/site-packages/castro/init.py", line 110
E print "Running ffmpeg: encoding and creating keyframes"
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

I see 4 print statements missing the parens. I'm running python 3.11.2 on OSX 12.6.3.

RFB NetworkClient instance has no attribute clipping

Hi hugs, I'm trying to start a video using your lib but I'm facing this error who is very annoying

Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(_self._args, *_self._kwargs)
File "/usr/local/lib/python2.7/site-packages/castro-1.0.6-py2.7.egg/castro/lib/pyvnc2swf/vnc2swf.py", line 611, in main
merge=merge, debug=debug, reconnect=reconnect)
File "/usr/local/lib/python2.7/site-packages/castro-1.0.6-py2.7.egg/castro/lib/pyvnc2swf/vnc2swf.py", line 429, in vnc2swf
client.loop()
File "/usr/local/lib/python2.7/site-packages/castro-1.0.6-py2.7.egg/castro/lib/pyvnc2swf/rfb.py", line 489, in loop
if not self.loop1(): break
File "/usr/local/lib/python2.7/site-packages/castro-1.0.6-py2.7.egg/castro/lib/pyvnc2swf/rfb.py", line 276, in loop1
self.request_update()
File "/usr/local/lib/python2.7/site-packages/castro-1.0.6-py2.7.egg/castro/lib/pyvnc2swf/rfb.py", line 551, in request_update
self.send('\x03\x01' + pack('>HHHH', *self.clipping))
AttributeError: RFBNetworkClient instance has no attribute 'clipping'

Here is my code for the video

from selenium import webdriver, selenium
from selenium.webdriver.common.keys import Keys
import castro

class Video(object):
def init(self, _args, *_kwargs):
self.verificationErrors = []
self.video = castro.Castro()
self.driver = webdriver.Firefox()
super(Video, self).init()

def manager_video(self):
    self.video.start()
    self.driver.get('http://www.n1ght.com')
    element = self.driver.find_element_by_id("appendedInputButton")
    element.send_keys("brussel")
    self.driver.close()
    self.video.stop()
    self.video.process()

I normally installed all dependancies so don't understand why it's not working when I do video.start()

Thank you in advance

Support Python 3

Just instaled castro in my project, where I use python 3.6 and got following error

Traceback (most recent call last):
File "/usr/local/lib/python3.6/unittest/loader.py", line 428, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/local/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
import(name)
File "/app/src/test_auth.py", line 1, in
from .base import SeleniumTestCase
File "/app/src/base.py", line 9, in
from castro import Castro
File "/usr/local/lib/python3.6/site-packages/castro/init.py", line 110
print "Running ffmpeg: encoding and creating keyframes"
^
SyntaxError: Missing parentheses in call to 'print'

This is obviously python2 syntax, it would be nice to have a package that uses python 3

Create a Docker Image for Castro

I think it would be very interesting to create a docker image to be used for the Castro library. I need to use it to record videos in Selenium tests and I can't find any other solution.

Windows7 TightVNC issue - AssertionError pyvnc2swf\swf.py", line 545, in writebits assert 0 <= x and x < (1<<bits)

python -c "import castro; castro.test()"

Recording a 10 second video...

10 Connected: localhost:5900, protocol_version=3.8, preferred_encoding=(0, -232, -239)
VNC Screen: size=4960x1921, name='beast'
Output movie size: 4960x1921
Creating movie: 'c:\users\matt\appdata\local\temp\castro-video.swf': version=5, size=4960x1921, framerate=12, compression=None
9 8 7 6 5 4 3 2 1 Process Process-2:
Traceback (most recent call last):
File "c:\python27\lib\multiprocessing\process.py", line 232, in _bootstrap
self.run()
File "c:\python27\lib\multiprocessing\process.py", line 88, in run
self._target(_self._args, *_self._kwargs)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\vnc2swf.py", line 611, in main
merge=merge, debug=debug, reconnect=reconnect)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\vnc2swf.py", line 429, in vnc2swf
client.loop()
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 489, in loop
if not self.loop1(): break
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 448, in loop1
self.finish_update()
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 136, in finish_update
self.fb.update_screen(time.time())
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 839, in update_screen
self.stream.next_frame()
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\output.py", line 564, in next_frame
self.add_object(self.screen.get_image(x0, y0, w, h), depth, x0, y0)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\output.py", line 531, in add_object
self.place_object2(self.define_shape(w, h, data), x, y, depth)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\output.py", line 431, in define_shape
self.writer.write_shape(3, [(0,(20,20)),(1,(w_20,0)),(1,(0,h_20)),(1,(-w_20,0)),(1,(0,-h_20))], fillstyle=1)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\swf.py", line 708, in write_shape
self.writebits(4, n-2)
File "c:\python27\lib\site-packages\castro\lib\pyvnc2swf\swf.py", line 545, in writebits
assert 0 <= x and x < (1<<bits)
AssertionError

The swf file is created, (37k), but is unplayable.

It also creates a large number (1 per second, approximately) of python.exe processes until the original processes is terminated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.