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

Diverse Audio/Video support #120

Open
17 tasks
DonaldTsang opened this issue Jul 3, 2019 · 3 comments
Open
17 tasks

Diverse Audio/Video support #120

DonaldTsang opened this issue Jul 3, 2019 · 3 comments

Comments

@DonaldTsang
Copy link

DonaldTsang commented Jul 3, 2019

  • Audio
    • OGG/OGA/MOGG
    • OPUS
    • APE
    • FLAC
    • WAV
    • AAC/M4A/3GP
    • AIFF/AIF/AIFC
    • WMA/WMV
    • ALAC/M4A/CAF
  • Video
    • MKV
    • WMV
    • MOV/QT
    • AVI
    • FLV
    • OGG Video
    • MPG/MP2/MPEG/MPE/MPV
    • M4P/M4V (alternate for MP4)
@DonaldTsang DonaldTsang changed the title Diverse Audio support Diverse Audio/Video support Jul 3, 2019
@DangerOnTheRanger
Copy link
Owner

Video support is a matter of whether or not ffmpeg can render the format in question; Maniwani's attachment system only cares about whether or not it has a way to generate a thumbnail for a given format, and stores all actual attachments the same way and lets the client/browser figure out how to render them. So, .mkv should be supported, though I've admittedly never tried. AV1 support should also be present, but I can't recall trying that, either. Anything ffmpeg doesn't natively support probably isn't worth our time to look at supporting ourselves, in my opinion.

There's currently no means of thumbnailing audio in Maniwani right now, but I wouldn't be opposed to adding it. I would like a unique thumbnail per audio file if possible, perhaps something generated via the waveform of the audio itself. If it were a little prettier/memorable than just the actual waveform itself, that would be nice, as well.

@DonaldTsang
Copy link
Author

@DangerOnTheRanger in this case I would hope that you can check #121 (comment) out for some of the options for hashing-based thumbnails.
Also some music has albums in it, in those cases please use the album instead of using the hash thumbnail.
But if you really want waveform-based thumbnails that would be harder, as we would need spectrograms or others to handle it. I will do some research into the matter.

@DonaldTsang
Copy link
Author

DonaldTsang commented Jul 6, 2019

Okay so we need a logarithmic spectrogram from 20Hz to 20kHz (human auditory range),
where each pixel represents a 50ms note in a 12-tone scale set at A440 (A432 is too esoteric).
In this case the range would be from -53 to +66 (with A440 being 0), having 120 pixel height image.
Assuming that the music is N seconds long, the width of the spectrogram would be 20N seconds long...
that is not good news, so the new plan is to dice up the bits into X seconds (or 20Xpx) wide chunks and then stack them vertically.
Since most top pop songs average between 2 to 5 minutes according to most sources,
the best number for X would be 30 seconds (or 600 px wide), leading to 240~720px tall thumbnails.
A 128kbps audio takes up 0.96MB per minute, so it takes ~17 minutes to reach 16MB full,
or from the 600px wide perspective, 2040px high.
If it is 320kbps however, it takes up 2.4MB per minute or ~7 minutes to reach 16MB, or 840px high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants