Convert FLV to MP4 or 3GP - php

Can I convert videos with PHP or do I have to use some library?

You'll need to use some libraries to achieve this.
The Wordpress video solutions framework already does video conversion; is written in PHP and uses FFMPEG and other tools to do the conversion. This may be a good starting point for you.

Related

Play audio from any video using php

I have a video and I want to play it in audio and video both format.
I did not want to convert it in mp3 and download it.
I want to run it online.
Can i do this. Remember, I have only one file which in video format.
Is there any way to achieve this.
You have to use http://ffmpeg.org/
This is a library that allows you to manipulate videos.
Ffmpeg is a shell tool, so if you want to run it from PHP script you have to follow this guide:
https://trac.ffmpeg.org/wiki/PHP

how can I convert mp3 to wav using php code without external library or application

I am trying to generate waveform for mp3 files, and found that it is possible using php code to generate waveform for wav files, but not mp3. I need to convert mp3 to wav, but also it is not possible to install ffmpeg or lame on shared hosting, is there any other solutions like php based conversion?
I don't think this is possible. But you can use a SAAS platform to help you with that. maybe you can try http://www.encoding.com/ or http://aws.amazon.com/elastictranscoder/.

Converting G2M3 and G2M2 encoded Videos (GoToMeeting Videos) to a video type that FFMPEG supports

I'm developing a PHP application that uses FFMPEG-PHP to split videos and convert them to FLV. And I ran into this problem :
FFMPEG does not support G2M3 or G2M2 encoded videos, and I have to make the process of splitting and converting videos effortless for the client, I don't want him to convert the video locally before uploading to the server.
All I want to do is to find a way to convert the G2M3 encoded videos online to FLV or to any other video type that FFMPEG supports.
So, is there any way I can do that?
Can MEncoder handle this type of videos?
I tried doing something similar and could not find a solution. The only workaround I could get together was to use an older version of Windows Media Encoder (think it was version 9), which would let you convert to a different format.
The big hassle was that the GotoMeeting codec was only available on Windows (and maybe Mac). A possible workaround could be to setup GotoMeeting to record using standard WMV, which is not the default setting.
G2M3 is a proprietary codec, see this link on vlc-forum. As the thread says, you will not find a open-src implementation of it.
Google gives me this link for a conversion howto

How to read duration of an FLV file in PHP / through shell command?

How do I determine the length of an FLV file from within PHP or through shell access?
I think a dedicated libraries is available, but I'm really looking for a quicker more direct way.
Read this:
How To Get Video Duration With FFMPEG and PHP
You will need a FLV meta reader and AMF parser.
I have ALWAYS used this :
http://www.tommylacroix.com/2009/06/11/mp4-and-f4v-php-flash-video-meta-data-reader/
:) its really great. It gives lot more things for the FLV. it also allows editing FLV meta

PHP Extract audio from video

I need a way to extract the audio from some video (in PHP). I have the video streaming in from YouTube, so I would really like it if it were on the fly streaming, not I have to save it to a temp directory and process it there (though that is acceptable.) Thanks, Isaac Waller
Edit: to be more specific, I have a MP4 and I want it to be a MP3.
You're going to want to use something like ffmpeg and call it using php's exec command. If you look around in the docs, I'm sure you can figure out what flag to use to only get the audio.
I've used this app before on a project for live transcoding of video, works like a charm. Just make sure your server has it correctly installed.
Mplayer should do this for you, and there are libraries and codecs that you can call (PHP supports C libraries) which will strip the video from the AV stream on the fly.
Given that you're targeting youttube your job is a bit easier because they use a very small subset of file encodings.
If you take the time to learn the format, you can very easily remove the video stream on the fly and return only the audio stream.
If you give a little more information, such as what you're encoding it to, or where it's going to end up we may be able to help more specifically.
-Adam

Categories