It would be great to store some extra audio fields in filefield meta. Namely file format, dataformat, bitrate mode, bitrate, channelmode and sample_rate.
Here is a patch that adds these fields to filefield meta ... hopefully I've created the patch properly.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | patch_61.patch | 4.31 KB | moonray |
| #9 | patch.patch | 6.36 KB | jdelaune |
| #7 | patch.patch | 6.35 KB | jdelaune |
| #5 | patch.patch | 6.35 KB | jdelaune |
| #2 | patch.patch | 3.78 KB | jdelaune |
Comments
Comment #1
dopry commentedcan you explain each column to me? and comment it in the patch... I'd prefer column names that adhere more closely to ffmpeg... format, audio_codec, audio_channels, audio_bitrate, video_codec, video_bitrate etc... at the very least prefix them with audio/video. cheers.
Comment #2
jdelaune commentedHey guys updated patrickharris's patch with dopry's recommendations. Hope this helps :)
Comment #3
drewish commentedlooks good but the one thing that jumps out at me is that we need an update function to create the new fields...
Comment #4
moonray commentedsubscribing
Comment #5
jdelaune commentedNever written a database update script. So this could be totally wrong, and I have no way of testing it.
Comment #6
moonray commentedI tested the patch, and the only part not working properly is:
should be:
Comment #7
jdelaune commentedSweet. Cheers mate.
Comment #8
moonray commentedEhm... that's exactly the same patch as before, no changes. Uploaded the wrong file?
Comment #9
jdelaune commenteddoh! lets try again...
Comment #10
moonray commentedWorks for me. Thanks Starnox.
Comment #11
dopry commentedone more minor nit pick... width/height apply to both images and video... It can probably be kept as just width and height. other than that everything looks good.
Comment #12
moonray commentedWhy are we not gathering all the id3 data from the audio file if it has it? Or would that be better done in a sub-module of filefield that deals specifically with audio files?
Comment #13
moonray commentedUpdated patch incorporating comments from #11
Comment #14
moonray commentedComment #15
patrickharris commentedMoonray - yes, maybe the other id3 data should be stored as well (dopry said 'go to town' re adding in extra fields, so I guess he wouldn't mind). I really just included the fields I was most interested in, and they also happen to be the fields that audio module stores I think.
Comment #16
moonray commentedAudio module pulls out all the id3 info as well.
Comment #17
jdelaune commentedHmm my only reserve in doing this is sometimes you would want to edit the ID3 data (like in the Audio module), so a separate sub-module of FileField to handle this data would be the best way forward IMO.
Comment #18
moonray commentedAgreed.
On the other hand, then you'd have to do a dual call to getid3 to get the info, no? Perhaps there needs to be a plug-in module for the WRITING part of the id3, but the READING part should be included in filefield_meta.
Thoughts?
Comment #19
dopry commented@starnox: For now I only want a minimal amount of data in a denormalized table for filefield_meta... I'm working on a silghtly different schema for storing meta data thats more flexible... I really wanted a denormalized table for performance purposes, but for the long run probably will not work as well as I wanted and I wanted filefield_meta to contain a minimum of common media attributes, which is why all of the getID3 information isn't in there... If only mysql had a pivot function... If you really want to see more extensive changes, step up and write a patch instead of asking other people why they didn't scratch your itch. ;)
@moonray: I'll be doing commits one day this week... This is totally going in...
Comment #20
jdelaune commented@dopry: I wasn't asking other people to do it? I didn't even think it was a good idea which is why I never rolled out a patch with it in. I'm quite capable of scratching my own itch thank-you, I'm using this current filefield_meta patch on my site and thought I would polish it up and commit it back with the changes you asked for. Sorry for helping out.
Comment #21
drewish commenteddopry, think you misread that one. i'd specifically asked starnox to submit back a patch after he'd mentioned some changes he'd made on irc.
Comment #22
dopry commentedcommitted to head. tnx.