video

Stop playing video in iframe when modal is closed

走远了吗. 提交于 2020-05-26 10:57:23
问题 I have a play image with text 'Watch video', when clicked would open up a bootstrap modal window to play the video i put in. I've got the moday view to work. The problem I'm having with this is when I play the video and exit the screen while it is being played, the video continues to play in the background. If I click on the Watch Video link again, it would play the video from where it stopped off previously. I need to have the video stop when the modal window is closed. It needs to then play

How to get frame from video by its index via OpenCV and Python?

女生的网名这么多〃 提交于 2020-05-26 02:48:13
问题 I need to access frames from video by the frame index. So far I used code like this: video = cv2.VideoCapture(video_path) status, frame = video.read() The code reads the first frame. If I use the code repeatedly I will get next frames. But how I can access directly any frame by its index? In other words, if I want second frame, how can I access directly the second frame without calling read() two times? 回答1: Use VideoCapture::set() with CAP_PROP_POS_FRAMES property id to set the position of

ffmpeg set subtitles track as default

笑着哭i 提交于 2020-05-20 13:44:53
问题 By adding an .ass subtitles track to an mkv video with ffmpeg, it isn't set as default track, so on playback you have to manually turn on subtitles. Is it possible to set the default flag for the subtitles track? ffmpeg command used: ffmpeg -i video.mp4 -i subtitles.ass -c:v libx264 -preset veryslow \ -pix_fmt yuv420p10le -c:a copy -c:s copy output.mkv Note that I want to keep .ass subtitle format, not convert the subtitles to mov_text like suggested in this similar question: How to set

ffmpeg set subtitles track as default

陌路散爱 提交于 2020-05-20 13:44:05
问题 By adding an .ass subtitles track to an mkv video with ffmpeg, it isn't set as default track, so on playback you have to manually turn on subtitles. Is it possible to set the default flag for the subtitles track? ffmpeg command used: ffmpeg -i video.mp4 -i subtitles.ass -c:v libx264 -preset veryslow \ -pix_fmt yuv420p10le -c:a copy -c:s copy output.mkv Note that I want to keep .ass subtitle format, not convert the subtitles to mov_text like suggested in this similar question: How to set

Rotating a video during encoding with ffmpeg and libav API results in half of video corrupted

喜欢而已 提交于 2020-05-17 05:50:12
问题 I'm using the C API for ffmpeg/libav to rotate a vertically filmed iphone video during the encoding step. There are other questions asking to do a similar thing but they are all using the CLI tool to do so. So far I was able to figure out how to use the AVFilter to rotate the video, base off this example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/filtering_video.c The problem is that half the output file is corrupt. Here is the code for my encoding logic. Its written with

React Native: Allow only a certain screen to change orientation

血红的双手。 提交于 2020-05-14 01:26:37
问题 I was wondering if it is possible to lock all screens on iOS and Android, except for one screen. I have a video player that I want to show in full screen after rotation, but all other screens need to be the only portrait. I use react-native-video for this. I manage to get it rotating when using the samples but I need to set the possible orientations in XCODE and Android studio. I also tried react-native-orientation and put a .lockToPortrait() on it but after tilting, it changes again. Any

JavaScript - How can I play multiple videos at once?

帅比萌擦擦* 提交于 2020-05-13 18:55:09
问题 I have an array of video elements that I wish to play at the same time. The only way I've found online that I could do this would be to use new MediaController(); but that doesn't seem widely/if at all supported. What I was expecting to do was: var videos = document.querySelectorAll('video'); var mc = new MediaController(); video.forEach(function(el) { el.controller = mc; }); mc.play(); The only way I've found to do this is doing a forEach on the array and playing them one after another, but

YouTubePlayerSupportFragment not playing Video

倾然丶 夕夏残阳落幕 提交于 2020-05-13 17:51:31
问题 I Have an Activity having two fragments (Just like youtube app.) YouTubePlayerSupportFragment - half width which plays video. ListFragment contains list of video title list like youtube. As soon as activity launches i am taking first item in list and playing video and it works. When any video is selected from list, I am launching same activity(new instance) it plays video well. But when i click back button and come back to previous screen. previous video is not playing it is showing

YouTubePlayerSupportFragment not playing Video

会有一股神秘感。 提交于 2020-05-13 17:46:40
问题 I Have an Activity having two fragments (Just like youtube app.) YouTubePlayerSupportFragment - half width which plays video. ListFragment contains list of video title list like youtube. As soon as activity launches i am taking first item in list and playing video and it works. When any video is selected from list, I am launching same activity(new instance) it plays video well. But when i click back button and come back to previous screen. previous video is not playing it is showing

Is it possible to get the current html5 video timeframe with milliseconds?

一笑奈何 提交于 2020-05-13 14:15:47
问题 I am trying to build a live video captioning editor and require that the JS/DOM returns the current video timeframe with milliseconds. According to the DOM, video.currentTime only returns the value in seconds. Is there anyway to get the value in/with milliseconds? 回答1: currentTime includes milliseconds. Open a YouTube video, open your console, then enter document.getElementsByTagName('video')[0].currentTime; You'll see the time milliseconds and beyond: 24.530629 回答2: ontimeupdate event gives