how to record streaming audio with PHP - php

Is there an API (PHP???) that I can use to allow users on my site to record streaming live audio that is converted into mp3 file as the audio is streaming?

Related

How to stream remote mp4 videos using apache and php

I have a laravel website on shared hosting and some videos on a cloud storage.
What do I need to hide direct links and stream videos on my website?
The videos are for sell and somebody might download them without paying. so every time that a user wants to see a video, I generate a random link and use it in video src. I generate random string and pass it to a function. The function finds video link and uses curl to get and play video (PHP stream remote video file) but it's not good enough. If it is possible to stream videos from another source, what do I need to do it right?
Do I need a streaming server? is apache good enough? what should I learn?

Get YouTube audio stream on-the-fly

I am trying to get an audio stream (in mp3 format with fixed quality) from a YouTube video in PHP.
Notice that I cannot use FFMPEG and also i do not want to save the mp3 on my server, but I need only the audio stream (on the fly use).
Do you have any code or script? I have used many, but the half needs FFMPEG and the other saves the mp3 file in the server.
My plan is to hit on the browser:
http://host.com/process.php?url=<youtubeurl>
and get the audio stream in the page in variable that creating every time
&stream = ......;
It's not PHP, but we've open sourced a simple all-in-one node.js/CoffeeScript web app that can download a YouTube videos from a URL and then convert the video into an MP3 using ffmpeg.
github / demo / blog

Skipping MP4 video

I like to create the video player to show videos on my website. I made a video player in flash CS5 and actionscript3 to stream the videos on the website.
My videos are often flv or mp4 format.
In the flv files I use flvmdi app to inject the metadata to that ,and for skipping the flv file I use xmoov-php (video player can pass the keyframe number from flv metadat to xmoov-php to create the new flv file from passed keyframe to the last flv keyframe, and return the flv video file on the php header for flash video player to show the video ).
but about mp4 format in Xmoov-php wiki it says:
this file can't support the mp4 format to skiping...!!!
Now I need skiping the mp4 files in my video player (I like my viewers select a part of video before buffering all video on their browser and play it ).
please give me a suggestion to skipping the mp4 file in the php or .net platform
for read mp4 metadata you can use getid3
for skipping see this pages help you
http://forum.videolan.org/viewtopic.php?p=345230#p345230
Reading mp4 files with PHP
opening mp4 via php results in full download before playback
i read Xmoov wiki.
Note: xmoov-php does not support playback of .mp4 files. If you wish
to allow streaming for .mp4 files, we recommend that you use jwplayer
or flowplayer and install any necessary plugins for .mp4 playback.
that mean jwplayer or flowplayer support it by Byte-Range Requests

Record video on browser and upload to LAMP server

I have tried a lot of things out there: red5, jquery webcam, html5 ... but none of these solution record a video and leave it ready to upload to a server.
Is there anyway (html5, flash, whatever ... the better cross-broswer solution, the best) to upload video (+ audio!) and upload the result to a server (I guess through AJAX) ?
Summarize:
jQueryWebcam (https://github.com/infusion/jQuery-webcam): it has flash video, uploads to a server image, not a video
Eric Bidelman's solution (http://ericbidelman.tumblr.com/post/31486670538/creating-webm-video-from-getusermedia):records video in html5 and allows you to download (so you can upload
to a server), but no audio !
Red5 (http://www.red5-recorder.com/services.php): paid services, not
uploading in free version :(
DMV (https://github.com/rwldrn/dmv): it just captures a photo ... besides not cross-browser
I have developed video recording solutions for the better part of the last 5 years and contributed a lot to fixing video recording bugs in Red5.
There are currently 2 production ready technical solutions for recording audio and video on the web. One for desktop and one for mobile.
On desktop you will need a Flash application that sits embedded in a web page, captures the visitors webcam and mic, encodes the raw video and audio data and streams it as it is recorded (through rtmp) to a media server.
You have at least 3 options for the media server:
Red5 is free and open source (btw. recording works out of the box in Red5)
Wowza ($65/month)
Adobe Media Server Pro ($4500)
The media server receives (again through streaming/rtmp not through http) the data and, depending on the codec used on the client, saves it to mp4, flv or f4v files.
This Flash client + media server recording process - which has worked pretty well since Flash Player 6 in 2002 - will most likely replaced by the HTML5 alternative named MediaStream Recorder (not yet implemented fully by any browser).
On mobile you can use HTML Media Capture (explained here with screenshots) to record video using the device's native video recording app and codecs. HTML Media Capture records locally (on the device) and then you upload (normal HTTP upload process) the file to the web server.
A commercial solution that implements both (Flash client + media server on desktop and HTML Media Capture on mobile) is HDFVR.
You could use something like binary download via javascript.
Here is one example
As you have not much info about video protocols i cant give you better answer
you can try this library, RecordRTC. It generates a blob file to put in video source and you can upload this file later to your server.
RecordRTC Library
This library is a container for other libraries, like Whammy for video, Recorderjs for audio and jsGif for gifs.
You can use Whammy library for record videos too:
Whammy

How to upload videos to youtube from url

I have an option for users to share videos. I use to filepicker.io to handle my uploads. I am using zend gdata plugin, it works well for videos stored on my server. But it does not work for videos saved on amazon s3 servers. Can I upload videos on s3 to youtube.
I appreciate any help.
The YouTube Data API requires that you send the actual bytes of the video you're uploading as part of the upload request. You can't just provide a reference to a remote URL as part of an upload request and expect the YouTube API servers to retrieve the video file from that URL.
If your video is on Amazon S3 and your code is running from a place that doesn't have direct access to the video file, then you're going to have to download it temporarily to someplace your code does have access to, and then include the video file in your YouTube upload request.

Categories