video-thumbnails

Creating thumbnail from video file returns null bitmap

大城市里の小女人 提交于 2019-12-04 04:59:47
I send an intent to launch the video camera PackageManager pm = getPackageManager(); if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)){ Intent video = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); File tempDir= new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES), "BCA"); if(!tempDir.exists()) { if(!tempDir.mkdir()){ Toast.makeText(this, "Please check SD card! Image shot is impossible!", Toast.LENGTH_SHORT).show(); } } String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss",Locale.US).format(new Date()); File mediaFile = new File(tempDir.getPath() +

Create Video Thumbnail of All Files in a Directory via FFmpeg and PHP

谁说我不能喝 提交于 2019-12-03 21:50:39
I have searched all over the Google and StackOverFlow, but still did not find a solution for this. I want to generate video thumbnail of all mp4 video files in a directory and name the thumbnails as "filename.mp4".jpg I have ffmpeg and ffmpeg-php installed on my server. I also succeeded in creating thumbnails of one file at a time. So this is the situation, I have a directory named uploads which has lots of mp4 videos. Now, when I run the script, thumbnail of size 100x100 shoud be created automatically and placed in another folder "skrin". Eg: xxx.mp4 should have xxx.mp4.jpg has the thumb name

How to force high quality thumbnails for YouTube Player API iframe Embeds?

寵の児 提交于 2019-12-03 12:32:51
The thumbnails looked fine for over a year, but suddenly became blurry. The thumbnail that appears on page load looks correct, but anytime a new thumbnail is displayed using 'player.cueVideoById', it looks very blurry. There is no mention in the documentation of how to control the thumbnail quality (only video quality settings, such as 'setPlaybackQuality' are available). The documentation: https://developers.google.com/youtube/iframe_api_reference How can I force high quality thumbnail images? Yes, this issue is easily reproducible. I've created a slightly modified version of the

Generate a thumbnail/snapshot of a video file selected by a file input at a specific time

那年仲夏 提交于 2019-12-03 03:55:23
问题 How do I grab a snapshot of a video file selected via <input type="file"> at a specific time in the video silently in-the-background (i.e. no visible elements, flickering, sound, etc.)? 回答1: There are four major steps: Create <canvas> and <video> elements. Load the src of the video file generated by URL.createObjectURL into the <video> element and wait for it to load by listening for specific events being fired . Set the time of the video to the point where you want to take a snapshot and

ThumbnailUtils.createVideoThumbnail returns null for existing mp4 video

試著忘記壹切 提交于 2019-12-02 10:41:35
I have a video and I need get its thumbnail. I use ThumbnailUtils class for this purpose, but it returns null instead of expected Bitmap . When I debug my app, I see that inside createVideoThumbnail method MediaMetadataRetriever.setDataSource invokes and it throws IllegalArgumentException . Inside setDataSource I see this code: public void setDataSource(String path) throws IllegalArgumentException { if (path == null) { throw new IllegalArgumentException(); } try (FileInputStream is = new FileInputStream(path)) { FileDescriptor fd = is.getFD(); setDataSource(fd, 0, 0x7ffffffffffffffL); } catch

Create video thumbnail from video source in python

♀尐吖头ヾ 提交于 2019-12-01 13:33:49
I have url of a video files and I want to generate the thumbnail each of this video source url.I'm using Django. My application does this:- 1. Crawl the some webpage 2. Extract all the video link from it. 3. If there are thumbnails, get those thumbnails. 4. if not thumbnails: #here I need to generate video thumbnails from the #links I extracted in 2nd step. Is there any way to do this without downloading the complete video and generating thumbnails. If I download each video, then there will be lot of bandwidth wastage and require lot time. Thanks martincpt You should try ffmpeg . sudo apt-get

Create video thumbnail from video source in python

不问归期 提交于 2019-12-01 10:08:09
问题 I have url of a video files and I want to generate the thumbnail each of this video source url.I'm using Django. My application does this:- 1. Crawl the some webpage 2. Extract all the video link from it. 3. If there are thumbnails, get those thumbnails. 4. if not thumbnails: #here I need to generate video thumbnails from the #links I extracted in 2nd step. Is there any way to do this without downloading the complete video and generating thumbnails. If I download each video, then there will

iOS Swift: video thumbnail error

我与影子孤独终老i 提交于 2019-12-01 07:03:39
I'm creating video thumbnails with the following code and it works in most cases. However sometimes it throws an error and the thumbnail is not created. I can't figure out why it does not work sometimes. Here is how I create video thumbnail: let asset = AVAsset(URL: url) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true do { let cgImage = try imgGenerator.copyCGImageAtTime(CMTimeMake(1, 30), actualTime: nil) let uiImage = UIImage(CGImage: cgImage) imageview.image = uiImage } catch let error as NSError { print("Image generation failed

iOS Swift: video thumbnail error

主宰稳场 提交于 2019-12-01 06:01:19
问题 I'm creating video thumbnails with the following code and it works in most cases. However sometimes it throws an error and the thumbnail is not created. I can't figure out why it does not work sometimes. Here is how I create video thumbnail: let asset = AVAsset(URL: url) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true do { let cgImage = try imgGenerator.copyCGImageAtTime(CMTimeMake(1, 30), actualTime: nil) let uiImage = UIImage

iOS - How to get thumbnail from video without play?

荒凉一梦 提交于 2019-11-30 18:37:01
I'm trying to get thumbnail from video and show it in my tableview. Here is my code: - (UIImage *)imageFromVideoURL:(NSURL *)contentURL { AVAsset *asset = [AVAsset assetWithURL:contentURL]; // Get thumbnail at the very start of the video CMTime thumbnailTime = [asset duration]; thumbnailTime.value = 25; // Get image from the video at the given time AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:asset]; CGImageRef imageRef = [imageGenerator copyCGImageAtTime:thumbnailTime actualTime:NULL error:NULL]; UIImage *thumbnail = [UIImage imageWithCGImage:imageRef];