Getting a thumbnail from a video url or data in iOS

-(UIImage *)generateThumbImage : (NSString *)filepath { NSURL *url = [NSURL fileURLWithPath:filepath]; AVAsset *asset = [AVAsset assetWithURL:url]; AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc]initWithAsset:asset]; imageGenerator.appliesPreferredTrackTransform = YES; CMTime time = [asset duration]; time.value = 0; CGImageRef imageRef = [imageGenerator copyCGImageAtTime:time actualTime:NULL error:NULL]; UIImage *thumbnail = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); // CGImageRef won’t be released by ARC return thumbnail; } … Read more

How can I set preview of video file, selecting from input type=’file’

@FabianQuiroga is right that you should better use createObjectURL than a FileReader in this case, but your problem has more to do with the fact that you set the src of a <source> element, so you need to call videoElement.load(). $(document).on(“change”, “.file_multi_video”, function(evt) { var $source = $(‘#video_here’); $source[0].src = URL.createObjectURL(this.files[0]); $source.parent()[0].load(); }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> … Read more

Get video dimension in python-opencv

It gives width and height of file or camera as float (so you may have to convert to integer) But it always gives me 0.0 FPS. import cv2 vcap = cv2.VideoCapture(‘video.avi’) # 0=camera if vcap.isOpened(): # get vcap property width = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) # float `width` height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) # float `height` # or width = … Read more

Android intent for playing video?

Use setDataAndType on the Intent Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(newVideoPath)); intent.setDataAndType(Uri.parse(newVideoPath), “video/mp4″); startActivity(intent); Use “video/mp4” as MIME or use “video/*” if you don’t know the type. Edit: This not valid for general use. It fixes a bug in old HTC devices which required the URI in both the intent constructor and be set afterwards.

This code to write video+audio through AVAssetWriter and AVAssetWriterInputs is not working. Why?

In startVideoRecording I call (I assume you are calling this at some point) [_capSession startRunning] ; In stopVideoRecording I do not call [_videoWriterInput markAsFinished]; [_videoWriter endSessionAtSourceTime:lastSampleTime]; The markAsFinished is more for use with the block style pull method. See requestMediaDataWhenReadyOnQueue:usingBlock in AVAssetWriterInput for an explanation. The library should calculate the proper timing for interleaving the … Read more

GPU-accelerated video processing with ffmpeg

FFmpeg provides a subsystem for hardware acceleration, which includes NVIDIA: https://trac.ffmpeg.org/wiki/HWAccelIntro In order to enable support for GPU-assisted encoding with an NVIDIA GPU, you need: A ​supported GPU Supported drivers for your operating system The NVIDIA Codec SDK ffmpeg configured with –enable-nvenc (default if the drivers are detected while configuring)

Automatic height when embedding a YouTube video?

This article contains a good answer, copied below. CSS: .video-container { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; } .video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } Example Html <div class=”video-container”> <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/_TyJeKKQh-s?controls=0″ frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe> </div> How this works: The … Read more

Create thumbnail from video file via file input

Canvas.drawImage must be based on html content. source here is a simplier jsfiddle //and code function capture(){ var canvas = document.getElementById(‘canvas’); var video = document.getElementById(‘video’); canvas.getContext(‘2d’).drawImage(video, 0, 0, video.videoWidth, video.videoHeight); } The advantage of this solution is that you can select the thumbnail you want based on the time of the video.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)