How to download video from youtube and also trim or cut that downloaded video in iphone sdk? - iphone

I want to download video from youtube. Then the downloaded video should saved and user can also play it in offline mode and user can also trim or edit that downloaded video.
I have searched a lot on Google and i find some answers but they didn't satisfy my question.
This question tell downloading video from youtube may reject your application is this true?
The screen shot from apple. YouTube Terms & Condition are also not allowing to download videos. Read section 5-B.
I have also try to load some examples for video downloading from youtube but they all failed for loading video MyTube , YouTube , SCBTube , PSYouTubeExtractor
Some questions related to youtube download. and for video trimming or cutting i am following this code .
is this downloading is possible or not ?

Downloading is, in some cases, possible, but it's against the YouTube T&Cs...so yeah, don't do it. Furthermore, even if you did implement this not all videos on YouTube are actually available in the appropriate H.264 format (e.g, videos which require advertising or content protection are often not available).

Related

Using Youtube as video storage for my app

I am still relatively new to these topics.
I am programming my app in Flutter and I can already use Flutter to play a foreign video from Youtube in the app.
I want to upload in Youtube all my video resources as private to be able to display them in my app.
Is there any documentation on how to do this? What are the costs per request?
Is Youtube even right for such a mobile app?`
I was going to use Firebase cloud storage, but think that can get very expensive once I release the app.
What other options would I have?
This question isn't really suitable for StackOverflow, since it's basically just asking whether you can use YouTube.
That being said, as long as you don't violate the T&C of YouTube and you're fine with storing all your videos on their platform, yes, you can do this. Using YouTube this way is free as of now. But note that there is a difference between "private" and "unlisted".
You can create a profile on youtube, upload as many videos as you want and list them as unlisted, meaning you can only find the video if you have the link, then in your app link the vides to whatever selection method you have. so ex I have a button when clicked launches a specific unlisted youtube url link and plays the video.
It would be the same as if someone was searching your video publicly and playing it, both are free.

Playing video from youtube link without UIWebView

I want to play a video in my app from youtube link e.g: http://www.youtube.com/watch?v=Uner-3tTY1I.
But i don't want to redirect the user to any web view in the app. Just want to play that video in the video player in the current view of my application.
Is it possible to play the video without redirecting to UIWebView? If possible, how can i do this? Thanks for the help in advance.
The only allowed way seems to be using UIWebview. Doing it other way will violate youtube copyrights.
However there are few open source libraries out there. You can use it at your own risk.
Just use XCDYouTubeVideoPlayerViewController. It uses progressive download + MoviePlayer and AVFoundation frameworks.
To play this video you need to have the link to the video stream that is associated with video you want to play. Unfortunately this isn't so simple to get this link for some movies on YouTube since this link can be encoded for some movies (channel VEVO for example). Read this for more information about encoded links http://www.jwz.org/blog/2013/06/youtube-download-counter-countermeasures-applied/.
Unfortunattely as for now there is no simple way to decode these links. Despite this, you can get the source link for the not encoded films without bigger problems using some calls to the YouTube Api.

Detect video is going to be played in UIWebView

I want something similar to this:
https://itunes.apple.com/us/app/video-download-ibolt-downloader/id481606548?mt=8
I want to detect there is any video in web page and want to download that stream into iphone device.
In console media players tells that it is setting the movie path to some URL. There must be a way to download stream and save in local device.
P.S: I know how to download a video file. I want it using online streaming or from sites which does not provide a download link.
P.S++: Video download from HTML + UIWebView is not helpful.
Thanks.
The post is old but it might be worth to clear this
Those apps are probably using undocumented API. Apple doesn't accept private API when apps are submitted to the app store, however they might not be looking for usage of undocumented notifications
You can find more information in here and here
Those apps show you the download button after you click video, and after the video starts. So probably they are listening for media playback notifications and get the url from MPMoviePlayer instance.
By the way, apple doesn't allow apps that download videos from youtube. There might be some apps on the app store that does that, but I recently got rejected because of this. It might not be worth the hassle, as most big video streaming websites don't want people downloading their videos and work hard to make sure that they don't.

Creating YouTube videos in iPhone app

I'm doing a project where we want to create a video inside an iPhone app and upload it to YouTube. I've seen the you upload the video using Google's Data API (http://code.google.com/p/gdata-objectivec-client/).
However it seems that you need to upload the movie as an actual movie. Has anyone got any experience on making a movie in a format that YouTube will accept via the Data API and care to give me a few pointers on what would work?
(Just a quick note, I cannot use hidden APIs for this project)
Many thanks
Youtube accepts a broad range of formats. Just try it yourself, use any free video editing software to create a short movie and upload that movie to youtube, you're almost guaranteed that youtube would be able to process that.
The second part of your question is whether ios is able to produce a movie from still frames, then the answer is - yes - and you want to look at AVFoundation, particularly at AVAssetWriter

Can we play only audio using youtube api for iPhone

In my project i have to use youtube api and play only audio of the video. We must not show the youtube player. Is it possible to play only audio without showing video using youtube api?
Extraction may be the incorrect implied word here. From what I understand, is user133611 wants to have an audio only stream from YouTube. Unfortunately, YouTube directly forbids it. Here is a quote from Kuan Yong from the YouTube API team:
Your API Client will not, and You will not encourage or create
functionality for Your users or other third parties to:
"separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team
Link reference: https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/7fac8e8ff913b6c4?pli=1
I don't think this is really possible only using Youtube API. The Youtube API is not intended to be used for "downloading" videos/audio from them. You should go here, to understand what the Youtube API is really about.
A small abstract:
Unless I am missing something really big, the Youtube API consists of 5 main parts:
Data API
Custom Player
YouTube Direct
Player APIs
Widgets
None of this APIs allow you to for example "download" a video. Also I think (correct me if I'm wrong), that in a youtube video, the audio is actually embedded in the flash video, making the task even less trivial.
To illustrate you, the Data API, allows you to perform and use the youtube video search capabilities, use playlist capabilities and many more of the operations available on the YouTube website.
That have being said, the Youtube API, can be used for example to upload a video from your iPhone to youtube, as this example illustrates.
My Thoughts:
I think that extracting the audio from a youtube video, is actually possible, but involves a whole different process of downloading the video in H264 and then extracting the audio... but it still involves downloading the whole video.
Is the audio only prohibition still valid? Streamus is available as a Chrome Extension. It streams audio only from YT - see website https://streamus.com/
Well, one can simply give the video a width and height of 1px, or better yet do:
.video { text-indent: -9999px; }
And then force the video to play via the API controls. But I wouldn't do it as it is against their TOS and would result in my app being blocked if they find out.
I really confused about your platform. Do you want to do it over iOS platform with writing native code? If yes, you can do it without playing video. But you have to stream both video and music. You can do it with AVAudioPlayer Class, check the reference from
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/
But yes, you will makes users GSM data overload and it's not fair with letting users about that situation.
Maybe you can force your view over the youtube view? Have you tried that?
If it is against TOS, the op should just drop the idea of implementing his idea.
Just imagine the free music everyone will be streaming out of the promo videos of major videos on youtube!