Uploading direct video with MUX - php

I am going with the Docs API to do a direct Upload with Mux, But cannot seems to find any one solid example where I have to select the from my local, say one mp4 file of size 100 MB and once I click the submit button, it should call the MUX to upload at least the headers and then webhook can keep doing its work, but all I see is the examples they have is passing the URL to it and then the webhooks can be called?
This is really confusing, in every post I searched they had written it can be done but how they have not shown it anywhere
anyone who can guide in this
Thanks

Related

Video upload from site to YouTube through api v3

I have created a script using YouTube API v3 to make submitted videos from users sent directly to YouTube channel. The issue I am facing is that YouTube refuses to accept videos larger than 100mb. Is this a limitation YouTube has set or am I doing something wrong? I test the script by submitting a video of 394mb and in the end of the upload it presents the error message, though this doesn't happen when uploading videos of less than 100mb. Is there any way to manage to let upload larger videos.
I thought not to attach any script sample as first need to know the answer to this question. Thanks in advance for all answers. Suggestions are welcomed.
You can upload videos in excess of 15 minutes long. All you need to do is verify your YouTube account using the following link. Make sure you are logged into your YouTube account:
https://www.youtube.com/verify
Make sure you’re using an up-to-date version of your browser so you can upload files greater than 20GB. The maximum file size you'll be able to upload to YouTube is 128GB and the maximum duration is 11 hours.

POST request to API

So some quick background: I'm trying to teach myself to code, but right now I'm really a beginner. I'm trying to help out my younger brother's school with setting up a moodle-powered online course system featuring videos of full classes, and I've run into a snag with the school's preferred video host.
Basically, here's my problem:
The guys hosting the videos don't want to allow people to directly link to the videos, instead they built an API they want us to use that takes a POST request, then outputs a new URL, which expires after one use.
I've figured out how to use the API using POSTman or in the terminal
#for example:
# curl -F
# api_key='the api key they gave us' -F
# email='a user's email' -F
# destination='a subdirectory'
# 'the target URL'
What I can't figure out, is how to automate this process so that teachers can input the link to their video on our host's site ('somesite.com/videos/teacherx/') directly in the moodle class editor (if possible), so that whenever a student is taking the class they can click a link that runs the script, does the POST request, and redirects them to the new temporary URL.
In case you can't tell, I have no idea what I'm doing.
Thanks in advance
It sounds like you'll need a text filter - basically search for text and replace it with something else when displaying.
See if your application is listed here : https://moodle.org/plugins/browse.php?list=category&id=7
If not then you will need to write your own filter - the instructions are here https://docs.moodle.org/dev/Filters
Maybe download the code for the screencast filter and see how that works :
https://moodle.org/plugins/view.php?plugin=filter_screencast
Or you can look at the screencast code on github at https://github.com/TechSmith/Moodle-Screencast-Filter

upload videos to youtube in one step php

I am using a wordpress frontend form. I want the user to upload video and shall be directly uploaded to youtube account.
I have read API and that is a two way process i.e first step is to enter the title,description,category and tags and then it will be sent to youtube and a secure token is generated and then we use that token to send the uploaded video info..
What i require is a simple one step process so as i can submit the title,description,category,tags and the uploaded video in a single step.
Any help is really appreciated.
You can do that two steps in one.
Just get title, description and file form user and then do that two steps in sequence in your php script (eg. it can be proxy script with only one task - adding movies).

YouTube Data API Resumable Video Upload Request Error

I have video files stored on my web server which I want to be able to upload to YouTube in an automated kind of way. These videos are created on my website, which then the user can just upload to their YouTube Channel.
I am trying to make HTTP request calls to automate this video upload process, according to the Resumable Video Upload process here: https://developers.google.com/youtube/2.0/developers_guide_protocol_resumable_uploads
Everything works fine (getting the user's access permission, sending the metadata of the video) until the final step, which is the upload of the video itself. When I make the PUT request, it returns a response code 417 and says Invalid Request. Like this:
The following error was encountered:
Invalid Request
Some aspect of the HTTP Request is invalid. Possible problems:
Missing or unknown request method
Missing URL
Missing HTTP Identifier (HTTP/1.0)
Request is too large
Content-Length missing for POST or PUT requests
Illegal character in hostname; underscores are not allowed
I took a look at all those suggested possible problems, but I cannot find a fault anywhere in my code.
And the error message is just to vague and not specific enough to tell me where the problem is.
I am performing every step of the video upload process using the PHP's standard Http Request class. (http://www.php.net/manual/en/class.httprequest.php)
Here is my code:
$videoFile = *Some Video File*;
$httpRequest = new httpRequest($_SESSION['youtube_data_api']['upload_url'], HttpRequest::METH_PUT);
$httpRequest->setContentType('video/mp4');
$httpRequest->setPutFile($videoFile);
$headersArr = array('Content-Length' => strlen($httpRequest->getRawRequestMessage()));
$httpRequest->setHeaders($headersArr);
$httpMessage = $httpRequest->send();
I dug around on the internet a lot regarding this question, and a lot of times what I found are people using the Zend framework's YouTube library to accomplish this instead, which is a lot easier. Unfortunately, with the size of my website right now, it is just not feasible to spend some much time trying to integrate framework into my website.
Any insight into this problem would help tremendously! Thanks!

Facebook application with video uploading capabilities

I need to upload video files through Facebook application and later visualize all uploaded videos so that people can vote for a video they like. I searched and read some articles, but I still have questions that are not completely clear for me:
Is it better to use iframe or FBML
If I use iframe is it possible to use input type="file" and PHP to handle the uploading just like on a normal page (not with Facebook PHP SDK)
Please give me an advice what direction to take.
Uploading to Facebook using their API is notoriously difficult; first of all check out the thread on the faceboook dev forum.
I would recommend doing it in an iframe, and you'll need about 60 cigarettes and several large whiskeys to get it working.

Categories