-
Notifications
You must be signed in to change notification settings - Fork 142
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
Make MPEG file to have a valid header #494
Conversation
My dirty hack to repair broken header of MPEG files. Now i'm finally able to send files via a messenger like WhatsApp or so and they are playable there.
Thank you for submitting a work-around. I am not sure if this is the right issue, but it looks like issue #410 is the relevant one in this case? Do you have a reproduction that we might be able to use to write a test case for this work-around? If not, how are you validating that the work-around does in fact fix the issue in all cases? |
Hello. Sorry for a late answer. This workaround is close to #410 but not the same case. It's just adding a little bit of silence to beginning of each file which appear to cure a bad header of the file and allow to pass it via internet communicators. Without a patch, file starts with "LAME" header (4C 41 4D 45) which is not a correct header for MPEG file. That's why i.e. WhatsApp don't allow direct drop-in of that kind of file. Valid MPEG header starts with 0xFF. To reproduce the case just drop an exapmle mp3 file to a chat of https://web.whatsapp.com/ before and after applying the patch. This patch is not fixing artifacts that can occur later in the file since i don't have an idea what cause them. |
Thank you for your patience. I'll be working on this project again next week. |
I've had a chance to dig in. There are three issues with mp3 encoding. One of them leads to an invalid initial header. I'll be working on a PR and when it's ready I'd really appreciate it if you would test it in your setups for extra verification. |
Would you be willing to test #499 and see if that fixes the issue you encountered with the bad initial header? |
Hello. I'm testing #499 and it seems it fixed the file header. I'm leaving the program running and we will see if it fix the artifacts as well. Thank you for the fix. Edit: at the first glance, it fixed the artifacts as well. |
Great news! Thank you. Please keep me posted on your long-term testing. |
Fixed via: #499 |
My dirty hack to repair broken header of MPEG files. Now i'm finally able to send files via a messenger like WhatsApp or so and they are playable there.