-
Notifications
You must be signed in to change notification settings - Fork 39
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
Bug: Audio file treated as a video file #90
Comments
My proposed solution is to maintain an array of audio file extensions. When a file is uploaded, we can check if its extension matches any entry in our array. If a match is found, the file can be treated as an audio file. |
Hi @Rushi1109, thanks for reporting this bug and also the proposed solution! For completeness, this was initially reported over at discord, and with your help we understood that the issue stemmed from the audio file having a cover picture. This cover image was being mistakenly identified as a video stream (with no duration) by Currently, for an audio file, we do not expect any video streams and the existence of that stream is causing the video pipeline to be erroneously invoked. Briefly checking this, it seems it's intended behavior for Regarding how we should fix this, your suggestion of keeping a list of audio file extensions may be a possibility, but I feel it'd be error prone to solely rely on the extension. Given the fact, that Revisiting the image you'd provided in discord, below: I'd propose to use the Thanks again for finding this and the initiative to take it on! |
Hello @omeryusufyagci, For the file which I provided, we are receiving two stream. One audio stream which contains duration. Another is video stream which doesn't contain duration. When I try to get the duration of video stream, I get the same duration as audio stream. So, It can't be used to determine the media type. Instead, I used codec_name from the stream to determine media type. And It successfully fixes the issue. But, It will only work for cover image which has mjpeg codec. check the pr #91. Also, If you have any idea for solution better than the current one. Let me know. |
I have cover images that are png, so selecting mjpeg is not going to work for me.
|
Hi @mdlaat, thanks for your feedback. Indeed, that may not be a robust solution, and I've proposed to use directly the We could use cover, or Rushi has found another alternative as well, but I'd rather stick to the field mentioned above as it seems to be the official way of checking for this. |
Describe the bug
When uploading a .mp3 file. The backend serves the .mp4 file which is very short in duration. So, The correct output is not being served from backend.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
As a user I expect the correct output of my audio file. ( Instead of .mp4 file, The backend should serve correct audio file.)
Logs and Debug Information
Please include any relevant log messages and error outputs here.
Screenshots
If applicable, add screenshots to help explain your problem.
System and software (please complete the following information):
ffmpeg -version
: ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developersbuilt with gcc 12 (Debian 12.2.0-14)
Additional context
Please include system settings, configuration changes, or anything else you believe might contribute to the problem.
The text was updated successfully, but these errors were encountered: