mp4

Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)

穿精又带淫゛_ 提交于 2019-11-27 18:06:47
I have a web page, which (among other things) needs to extract a specific frame from a user-uploaded video. The user seeks to a particular part of a .mp4 in the player, then clicks a button, and an ajax call gets fired off to a php script which takes the .mp4, and the exact time from the video, and uses that to extract a "thumbnail" frame. My current solution is using the php exec command: exec("ffmpeg -i $videoPath -ss $timeOffset -vframes 1 $jpgOutputPath"); ...which works just great, except it's as slow as molasses. My guess is that ffmpeg is a little too much for the job, and I might be

Record, save and/or convert video in mp4 format?

岁酱吖の 提交于 2019-11-27 17:11:07
I have the following problem - I am trying to create an app that records video, then save it to the camera roll and after that I am uploading that video to the web. The problem is that the only supported format is "mp4", but my videos are "mov". So my question is how to save video from camera in "mp4" format, or save it in "mov" and then convert it to "mp4". Here's my code: this is how I open the camera: picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.delegate = self; picker.showsCameraControls = YES; picker.allowsEditing =

Use ffmpeg to add text subtitles

本小妞迷上赌 提交于 2019-11-27 16:38:38
I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error : Nmber of stream maps must match number of output streams. If I try to change the mp4 to mkv (although mp4 supports text subtitles), like this: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mkv It correctly maps the streams, but gives an error : Encoder (codec id 94210) not found for output stream #0.2 When I launch ffmpeg -codecs I can see that srt codec is supported as decoder

ffmpeg Too many bits per frame requested

℡╲_俬逩灬. 提交于 2019-11-27 14:52:09
I am using ffmpeg to convert videos to mp4 format. Everything works fine except with MOV format. The command I use for everything is: ffmpeg -i input.mov -strict experimental -sameq -s vga -aspect 1.7777 -vcodec libx264 -preset fast -crf 22 -y output.mp4 but the output I keep getting is: ffmpeg version 0.9, Copyright (c) 2000-2011 the FFmpeg developers built on Mar 12 2012 11:01:05 with gcc 4.4.5 configuration: --enable-libx264 --enable-gpl --disable-yasm libavutil 51. 32. 0 / 51. 32. 0 libavcodec 53. 42. 0 / 53. 42. 0 libavformat 53. 24. 0 / 53. 24. 0 libavdevice 53. 4. 0 / 53. 4. 0

what is the codec for mp4 videos in python OpenCV

╄→гoц情女王★ 提交于 2019-11-27 14:49:14
问题 fourcc = cv2.cv.CV_FOURCC(*'XVID') The above line is used for avi video. In the same fashion, which codec do we use for mp4 videos in Ubuntu? 回答1: The codec is H.264. One of these should work for you: fourcc = cv2.cv.CV_FOURCC(*'H264') #or #fourcc = cv2.cv.CV_FOURCC(*'X264') However, I should warn you that you'll probably need to have ffmpeg and the x264 libraries installed so since you are in Ubuntu, try doing this command in the terminal : sudo apt-get install ffmpeg x264 libx264-dev Also,

Unable to play MP4 video file from mainBundle

时光总嘲笑我的痴心妄想 提交于 2019-11-27 14:31:31
问题 So I'm trying to play a simple intro animation video file that I've dragged into my project in XCode and therefore should be able to play from my mainBundle, right? With this code: NSURL *urlString = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"introvideo" ofType:@"mp4"]]; MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:urlString]; [player play]; I get this error message: * Terminating app due to uncaught exception

mp4 from PHP - Not playing in HTML5 Video tag

≯℡__Kan透↙ 提交于 2019-11-27 14:31:21
I am using the video tag to play videos. I using php files for the playback like this: <video id="playvideo" preload="auto" width="845" height="395" poster="http://video-js.zencoder.com/oceans-clip.png"> <source src="../getvideo_webm.php" type='video/webm' /> <source src="../getvideo_mp4.php" type='video/mp4'/> <source src="../getvideo_ogv.php" type='video/ogg' /> </video> All .php files are playing fine when i check them directly in the brower. But the above setup with all .php as source files will not play. If i give a straight .mp4 source it will play fine. The getvideo_mp4.php looks like

How to load videos from assets folder? (to play them with VideoView)

半世苍凉 提交于 2019-11-27 13:39:55
问题 I need to open a mp4 video from the assets folder and play it with VideoView. I tryed with these two options, but none of them works.... mVideoView.setVideoPath("file:///android_asset/videos.mp4"); mVideoView.requestFocus(); mVideoView.start(); and... String uriPath = "file:///android_asset/videos.mp4"; Uri uri = Uri.parse(uriPath); mVideoView.setVideoURI(uri); mVideoView.requestFocus(); mVideoView.start(); These options didn't works, but if I try to open the video from the SDCARD it works

MP4 Atom Parsing - where to configure time…?

☆樱花仙子☆ 提交于 2019-11-27 12:57:47
I've written an MP4 parser that can read atoms in an MP4 just fine, and stitch them back together - the result is a technically valid MP4 file that Quicktime can open and such, but it can't play any audio as I believe the timing/sampling information is all off. I should probably mention I'm only interested in audio. What I'm doing is trying to take the moov atoms/etc from an existing MP4, and then take only a subset of the mdat atom in the file to create a new, smaller MP4. In doing so I've altered the duration in the mvhd atom, as well as the duration in the mdia header. There are no tkhd

What is the proper way to serve mp4 files through rails to an Ipad?

巧了我就是萌 提交于 2019-11-27 12:46:41
问题 We're having trouble serving mp4s that will play on an ipad using a default rails 3 app. The mp4 is served correctly when viewing the route in chrome and other browsers on a desktop. Here is our code: file_path = File.join(Rails.root, 'test.mp4') send_file(file_path, :disposition => "inline", :type => "video/mp4") We hit 0.0.0.0:3000/video/test.mp4 to view the video and are presented with cannot play icon on the ipad. We've tried modifying various headers "Content-Length", "Content-Range",