diff options
author | Anthony Wang | 2024-04-28 19:33:51 -0400 |
---|---|---|
committer | Anthony Wang | 2024-04-28 19:33:51 -0400 |
commit | 80b6b746b82be2046847a658711b6845c39bc52f (patch) | |
tree | d717335c0251b488613bdc0f43e4115ad1003b27 | |
parent | 5259da7b02e62f81c383fa67e06cd7ee554e6301 (diff) |
Format code, update usage instructions
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | decoder.py | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -14,7 +14,7 @@ Encode: `python encoder.py -i in -o vid.mkv` Play video: `mpv --scale=nearest --fullscreen --loop --no-keepaspect vid.mkv` -Decode: `python decoder.py -o out` +Copy the flags printed by the encoder and pass them to the decoder: `python decoder.py -o out FLAGS` Formatting: `black -l 120 *.py` @@ -60,7 +60,7 @@ while data is None: # raw_frame is a uint8 BE CAREFUL if type(args.input) == int: X, Y = raw_frame.shape[:2] - raw_frame = raw_frame[X // 4:3 * X // 4, Y // 4: 3 * Y // 4] + raw_frame = raw_frame[X // 4 : 3 * X // 4, Y // 4 : 3 * Y // 4] cv2.imshow("", raw_frame) cv2.waitKey(1) raw_frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB) @@ -127,7 +127,7 @@ while data is None: ) ) # erase_pos = bytearray(np.where(frame == 0)[0]) if args.erasure else bytearray() - data = decoder.decode(bytes(rsc.decode(bytearray(np.packbits(frame) ^ frame_xor))[0][:args.psize])) + data = decoder.decode(bytes(rsc.decode(bytearray(np.packbits(frame) ^ frame_xor))[0][: args.psize])) print("Decoded frame") except KeyboardInterrupt: sys.exit() |