Currently the MP3 file exceeds the limit set in wordpress. And Although I am going to raise that limit with some information I found on the topic, the Mp3s are still rather large. If the site were for me, I'd simply compress them. So I need to find a method to compress them. I assume it needs to save that large file, to transcode it to a smaller file, and then delete the old one. Any ideas?
Asked
Active
Viewed 646 times
1 Answers
0
I assume it needs to save that large file, to transcode it to a smaller file, and then delete the old one
This is correct. You always have to store the content first. Encoding should not be done via PHP though, there are more effective libraries for that. For example, you can run lame mp3 encoder on the command line via a system()
call in php. Be aware though that encoding might fail and also that it takes quite long. So you should run a cleaner script for the big files via cron instead of trying to delete them via the upload script.

Martin Müller
- 2,565
- 21
- 32
-
Thanks @Martin. What you said makes sense. I searched around with the info you provided, which got me on the right track.I decided to use alternative for hosting the media separately. As well as some possible CDNs for the future, if they decide to go that route. For now, I'm just going to have them use an external src and instead of 'upload' it will just be pasting the path to the file. Thanks a lot. I've heard of using cron for media before. Something I need to look more into for future projects. Thanks again. – nil Oct 12 '12 at 16:29
-
glad I could help. you should by the wack tick one of the correct answers as being the solution once your question has been answered ;) – Martin Müller Oct 16 '12 at 12:26