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

Not able to run custom movie #12

Open
lisbonjoker opened this issue Apr 5, 2021 · 10 comments
Open

Not able to run custom movie #12

lisbonjoker opened this issue Apr 5, 2021 · 10 comments

Comments

@lisbonjoker
Copy link

I did a text movie according to the examples but I always get this

Playing movie sample_movies/computer.txt
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 52912)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 599, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/home/lain/Programs/ascii-telnet-server/ascii_telnet/ascii_server.py", line 57, in handle
    movie.load(TelnetRequestHandler.filename)
  File "/home/lain/Programs/ascii-telnet-server/ascii_telnet/ascii_movie.py", line 170, in load
    time_metadata = int(line.strip())
ValueError: invalid literal for int() with base 10: '@@@@  O  @@@@@@ |||| @@@@@@  O  @@@@@@ |||| @@@@@@  O  @@@@@@ |||| @@@@@@  O  @@@@@@ |||| @@@@@@  O  @@@@@@ ||'
----------------------------------------
^CAscii Player Quit.
@nitram509
Copy link
Owner

Hi,

thanks for reporting this issue.
May I ask, if there's a chance to upload the sample movie?
From the error I guess, there's an issue with the file.

Regards
Martin

@lisbonjoker
Copy link
Author

@nitram509
Copy link
Owner

Unfortunately, I can't get the file you've linked.

This is what I see, when I click the link.
What I'm doing wrong?

Screenshot 2021-04-06 at 11 05 48

@lisbonjoker
Copy link
Author

lisbonjoker commented Apr 6, 2021

Odd, I'll try send it here:
computer.txt

@lisbonjoker
Copy link
Author

Do you know what could be?

@nitram509
Copy link
Owner

Hi,

the original specification limits the number of characters per line and the number of lines to 67x14 characters.
The player is somewhat restricted to that magic numbers.
After looking at your provided files, it seems to not match this restrictions.

You may can shrink your movie file, no?
Alternatively, feel free to provide a PR to make the player configurable for other movie source sizes ;)
(currently I can't work on that.)

From ascii_movie.py

    def load(self, filepath):
        """
        Loads the ASCII movie from given text file.
        Using an encoded format, described on
        http://www.asciimation.co.nz/asciimation/ascii_faq.html
        In short:
            67x14 chars
            lines separated with \n
            first line is a number telling delay in number of frames
            13 lines effective frame size
            15 frames per second

        Args:
            filepath (str): Path to Ascii Movie Data
        """

Original spec ... http://www.asciimation.co.nz/asciimation/ascii_faq.html

@ZenithalHourlyRate
Copy link
Contributor

ZenithalHourlyRate commented Apr 16, 2021

Alternatively, feel free to provide a PR to make the player configurable for other movie source sizes ;)

There used to be a commit e3753e1 that implemented this function. But it was reverted by 930aa00. Shrug.

I would like to suggest nitram509 reverting this revert or cherry-pick some of my commits. For lisbonjoker, you may try my fork in https://github.com/ZenithalHourlyRate/ascii-telnet-server

@nitram509
Copy link
Owner

Oh, you're right.
And I apologize for not remembering ... this was once in but AFAIK did not work as expected,
hence reverted and moved into a separate branch https://github.com/nitram509/ascii-telnet-server/tree/refactoring-auto-detection-frame-size. Also, I thought it would be smarter to auto-detect the frame size, as I guess, that would be easier for everyone to use then.

I'm sorry for not mentioning this earlier and I will have a look at your fork.

Thank you, for pointing this out.

@nitram509 nitram509 reopened this Apr 16, 2021
@ZenithalHourlyRate
Copy link
Contributor

ZenithalHourlyRate commented Apr 16, 2021

AFAIK did not work as expected,

I wonder if you are referring to #10. I think that was caused by this single commit 8160654. As I indicated in my comment, the state in commit 5b69116 works as expected.

hence reverted

I suggested reverting that single commit in that comment, but I'm afarid that you have reverted too many.

Also, I thought it would be smarter to auto-detect the frame size, as I guess, that would be easier for everyone to use then.

Detecting is hard, as we need to place some metadata in the movie file, thus designing the file format, or having some assumption about the movie file content. I suggest giving these parameters manually as a middle step.

I will have a look at your fork.

That fork remains what it was when I was sending PR to you, so no need to look at that again. Just review the earlier commits in this repo.

@ZenithalHourlyRate
Copy link
Contributor

Odd, I'll try send it here:
computer.txt

I have looked into your movie. You meant to use 110x24 as your frame size, but your first six frames did not follow this convention. Here is a fixed version of your movie. computer.txt

With this version, you may play it using the earlier version (or my fork) by the following command

python3 ascii_telnet_server.py -f /path/to/your/computer.txt --stdout -S 110x24 -s 110x25 -r 5

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

3 participants