Great! I've added the image. Here's the updated README:
This Java API allows you to convert frames from the "Bad Apple!!" MP4 video into ASCII art. You can use this API to retrieve ASCII art representations of individual frames or stream them continuously. Additionally, an HTML file is provided to display the ASCII art in a web browser.
- Clone this repository.
- Ensure you have Java installed on your system.
- Run the
Main
class to start the HTTP server. - Access the API at
http://localhost:8080/play
.
You can retrieve ASCII art for a specific frame by accessing:
GET /play/{frameNumber}
Replace {frameNumber}
with the desired frame number.
You can stream ASCII art frames continuously by accessing:
GET /play
This endpoint will return ASCII art for frames sequentially.
Included in this repository is an HTML file (index.html
) that displays the ASCII art in a web browser. Open the HTML file in a browser to see the ASCII art animation.
This project uses the following dependencies:
- JCodec: A library for reading and writing video/audio files in Java.
- com.sun.net.httpserver: HTTP server included in the Java SE platform.
The API uses JCodec to extract frames from the "Bad Apple!!" MP4 video and converts each frame into ASCII art. The ASCII art is generated by converting the pixel values of the frame's grayscale image to ASCII characters. The server streams ASCII art frames upon client requests.
// Java example to retrieve ASCII art for frame number 50
String asciiArt = fetchAsciiArt(50);
System.out.println(asciiArt);
- Hana
This project is licensed under the Apache License 2.0.