Hide controls in AVPlayerViewController — only at start

UPDATE: I ended up making my own controls for better customization. It’s more difficult but worth the time. Please read Apple’s sample code for reference. It’s about implementing PiP but also about making custom controls: https://developer.apple.com/library/prerelease/ios/samplecode/AVFoundationPiPPlayer/Introduction/Intro.html UPDATE: When tapped, AVPlayerViewController only fires touchesBegan event, and not touchesEnded event. But it’s enough to show the controls. … Read more

How to turn a video into numpy array?

skvideo is a python package can be used to read video and stores into the multi-dimensional array. import skvideo.io videodata = skvideo.io.vread(“video_file_name”) print(videodata.shape) For more details: http://www.scikit-video.org/stable/index.html and http://mllearners.blogspot.in/2018/01/scikit-video-skvideo-tutorial-for.html

Creating thumbnails from video files with Python

I could not install ffvideo on OSX Sierra so i decided to work with ffmpeg. OSX: brew install ffmpeg Linux: apt-get install ffmpeg Python 3 Code: import subprocess video_input_path=”/your/video.mp4″ img_output_path=”/your/image.jpg” subprocess.call([‘ffmpeg’, ‘-i’, video_input_path, ‘-ss’, ’00:00:00.000′, ‘-vframes’, ‘1’, img_output_path])

Howto merge two avi files using ffmpeg?

You should look into the concat demux and concat protocol that was added in ffmpeg 1.1. Assuming the codecs are the same you create a file (example mylist.txt): file ‘/path/here/file1.avi’ file ‘/path/here/file2.avi’ file ‘/path/here/file3.avi’ Then pass that file to ffmpeg ffmpeg -f concat -i mylist.txt -c copy video_draft.avi You can use this command to make … Read more

How to get the duration of video using OpenCV

In OpenCV 3, the solution is: import cv2 as cv cap = cv.VideoCapture(“./video.mp4”) fps = cap.get(cv.CAP_PROP_FPS) # OpenCV v2.x used “CV_CAP_PROP_FPS” frame_count = int(cap.get(cv.CAP_PROP_FRAME_COUNT)) duration = frame_count/fps print(‘fps=” + str(fps)) print(“number of frames=” + str(frame_count)) print(“duration (S) = ‘ + str(duration)) minutes = int(duration/60) seconds = duration%60 print(‘duration (M:S) = ‘ + str(minutes) + ‘:’ … Read more

AVPlayer frame animation

Here’s my opinion, add AVPlayer layer property(AVPlayerLayer class) to a sublayer to a UIView layer, then manipulate the view animation. for example, AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:blahURL options:nil]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:urlAsset]; AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem]; AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player]; playerLayer.frame = yourFrame; UIView *videoView = [UIView new]; [videoView addSublayer:playerLayer]; then give … Read more

Using FFMPEG: How to do a Scene Change Detection? with timecode?

Combining the scene filter (for detecting scene changes) and the showinfo filter should achieve what you want: ffmpeg -i input.flv \ -filter:v “select=”gt(scene,0.4)”,showinfo” \ -f null \ – 2> ffout This command extracts all frames that differ from the previous frame by more than (gt) 0.4 (on a scale from 0 to 1). For these … Read more

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