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

gzip CRC check fails #33

Open
duanemoody opened this issue Feb 16, 2021 · 6 comments
Open

gzip CRC check fails #33

duanemoody opened this issue Feb 16, 2021 · 6 comments
Labels
Awaiting OP Action bug Something isn't working documentation Improvements or additions to documentation

Comments

@duanemoody
Copy link

fvid installed through pip3 to bring along dependencies.

Test file: 9.1Mb Photoshop document. Successfully encoded with fvid, uploaded to YouTube, downloaded with ytdl, then run through fvid's decoder. After seeing Bits are in place, fvid unpacks the frames 100%, but:

Unziping...

Traceback (most recent call last):

  File "/usr/local/bin/fvid", line 8, in <module>
   sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/fvid/fvid.py", line 274, in main
   save_bits_to_file(file_path, bits, key)
  File "/usr/local/lib/python3.9/site-packages/fvid/fvid.py", line 144, in save_bits_to_file
   bitstring = fo.read()
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 300, in read
    return self._buffer.read(size)
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 478, in read
    self._read_eof()
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/gzip.py", line 524, in _read_eof
    raise BadGzipFile("CRC check failed %s != %s" % (hex(crc32),
gzip.BadGzipFile: CRC check failed 0xebd7fa1e != 0xc3ae18db

I notice that regardless of the command syntax, fvid run multiple times on the same input file generates MP4s of consistently varying byte counts suggesting the algorithm or one of the modules it depends on is flaky. This is consistent across the following syntaxes:

fvid -ei filename.ext
fvid --encode -i filename.ext
fvid -i filename.ext -e

file.mp4 came out as lengths of 159,351,426; 159,351,436; 159,351,435; 159,351,433 and the resulting downloaded YT videos had similar variances.

@Theelx
Copy link
Collaborator

Theelx commented Feb 17, 2021

That's very interesting. I've never seen that before, I'll start googling for an answer now.

Edit: It seems that according to https://stackoverflow.com/questions/35459354/python-gzip-crc-check-failed, it's caused by corruption or something of the files you're using. Have you tried deleting the file and re-downloading it?

Edit 2: Can you send the corrupted file here so I can test with it?

@Theelx
Copy link
Collaborator

Theelx commented Feb 17, 2021

@dobrosketchkun As the person who implemented gzip support, do you think that the gzip could become problematic when run through youtube's compression and then redownloaded?

@smileyhogue
Copy link

Looks like I have the same issue when uploading, then downloading from youtube as well. Works just fine if I do not upload to youtube

@Theelx
Copy link
Collaborator

Theelx commented Feb 18, 2021

@smileyhogue Can you send the affected file(s) here so I can test?

Edit:
I need the file that has already been uploaded and downloaded form YouTube because I don't want to give Google any more information on me by uploading stuff than I need to.

@Theelx Theelx added Awaiting OP Action bug Something isn't working labels Feb 19, 2021
@Theelx
Copy link
Collaborator

Theelx commented Feb 20, 2021

Ok, well I just swallowed my pride and uploaded a test file to youtube. When I downloaded with youtube-dl with the -k option on youtube-dl (to keep the original video and the audio files separate), I found that the main .mp4 that had the .m4a audio in it had this CRC error, however decoding just the video worked fine. Test files attached for you guys to try.

Working one:

WORKING_rio_image.f137.mp4

Not working one:

BROKEN_rio_image.mp4

@Theelx Theelx added the documentation Improvements or additions to documentation label Feb 20, 2021
@pablo-01
Copy link

pablo-01 commented Aug 3, 2021

I can confirm similar issue, even with downloading video/audio separately using the -k switch.
OSError: CRC check failed 0x3af5c3bd != 0x4c4d5ef

Only happens when using the file downloaded from YouTube.

Link to video:
https://youtu.be/YV9dPIdqXC0

Edit:

Link to file before uploading to YouTube:
https://github.com/PavKmiec/Helpers/raw/main/Files/Neuromancer.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting OP Action bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants