I am trying to upload a 200MB video file, and it seems that the upload stops after the progress reaches 6.4%, and the final file is not displayed in the chat.
use app.send_video() funtion
Related
I have created a Rails app which uploads a video to a Box account. All works fine when a video is small sized video. However, when video is a big file, I get c9.io's bad gateway error. To avoid this, I wanna add a background process which will upload the video for me, as I have no issue with Box's API's session.
I have a page where users see the uploaded videos. Above the videos, there is an "Update" form with the ability to upload videos to the collection. The form uses realtime uploading (Upload starts as soon as user chooses file). And when the upload progress is 100%. The user hits "Update" button to update video collection.
The problem occurs when the user wants to upload a file when watching a video. The upload does not progress. There are no messages or errors in server development log or client javascript console. It just hangs (the video continues playing though). The upload usually hangs at the start (5%, 20% depending on the video file size).
By the way; i use refile gem for managing realtime uploads, storage, file serving, etc. Also it should be known that, i use same rails application server (Thin 1.6.3) to serve files and accept uploads. (Maybe the server gets busy and can not accept uploads? Because if i don't start playing the video, the upload progresses smoothly and completes without a problem.)
Could anyone point me in the right direction? Where to look? Are there any parameters i should set somewhere?
I'm trying to use chunked uploads to "stream" a video file up to Dropbox as it's being recorded.
I start the upload a few seconds after the video recording starts, in order to prevent the upload from ever catching up to the end of the video file.
When I stop recording before the chunked upload starts, everything works fine.
But if I stop recording after the upload starts, everything appears to work correctly, but the resulting movie file is corrupted.
Are chunked uploads of an open (and expanding) file not supported?
We've got an app we're working on that needs to provide playback of video files via AVPlayer. The files need to be stored on the user's device, but also must playback while downloading.
At the moment we've built a download module that uses the ASIHTTPRequest library to get the video files via PHP (we don't want the media to be linkable via public URLs) and write them to disk asynchronously.
We've then setup an AVPlayer as per the AV Foundation Programming Guide, getting the file with AVURLAsset, making an AVPlayerItem with the asset, building the AVPlayer with the item, then setting the player to an AVPlayerLayer. The player runs fine with a fully downloaded video file and will also run a progressively downloaded file perfectly well in the simulator.
Unfortunately on an actual device, the behavior of the player changes, where instead it seemingly loads the video once and doesn't attempt to grab new packets from disk. The result is that the player will play video and audio up to the point in the video that marks where the download progress was at the time the asset was loaded (e.g. if 2MB of data are buffered then the player is created, the player will only play up to the 2MB worth of data). Because it has the video's header, the player will happily continue thinking it's playing for the full duration of the video, but no other video is rendered to screen.
The last wrinkle is that if the video is inserted into an AVComposition and the AVPlayer is created with that, the progressive video will play fine. This would be a fine solution (and is necessary for our app anyway on occasion) except that the client for our app requires that the video be playable on an Apple TV via AirPlay, which AVCompositions are incapable of.
Does anyone know if there is a way to play progressively downloading video files using an AVPlayer built from AVURLAssets? Is there a way to force the player/playerItem to read from disk with an AVURLAsset the way it seems to do with an AVComposition instead of seemingly caching the video in memory?
Thanks!
I haven't a solution to just make it work wit AVURLAssets but I use a slightly different approach. We bundle our App with CocoaHTTPServer and play video files which aren't fully downloaded trough a HTTP request against the local server.
The server knows the total length of the file and can then decide by looking at the HTTP-Headers which part of the file is request and either loads it from disk or from remote source.
While developing this there where always 3 initial requests, one for the first two bytes of the file, one of a larger chunk from the beginning of the file and one chunk directly of the end of the file. That's why it was always needed to load at least the last part directly from the remote server since the player would need it right from the start. I would guess the same happens for local files so the player loads the last bytes from the file (which aren't the right last bytes) and won't play over that length.
You would have to subclass HTTPConnection and make your own HTTPResponse class by looking at the provided "HTTPAsyncFileResponse".
I hope this gives you an idea how to accomplish this with a different approach.
I am trying to get the MPMovieplayerController to play incomplete video files. I want to use this so a user can download a part of a movie and play it offline. I am using ASIHTTP so i can resume downloads, if i try to play the temporary the player does nothing and and i get no errors. Also i registered for the MPMoviePlayerContentPreloadDidFinishNotification notification but it does not get dispatched. When the file is done downloading i can play it correctly.
Is it possible to somehow play incomplete video files? Alternatives to MPMovieplayerController are also welcome if that offers a solution.
I needed to download the first part op the mp4 file and the last part before i was able to play the video. So i am now downloading the first mb of the file then the last mb then the middle part and now i can play the file while it is not complete.