I have play video using AVPlayervewcontroller ,but I am facing issue to pause video.
It has a method to stop video than start from beging, but I want to pause video.
Please give me some ideas how can I achieve this?
Thanx
An AVPlayerViewController has an AVPlayer (its player). Tell the player to pause, or set the player's rate to 0. This pauses the video without resetting its playhead position.
AVplayerviewcontroller has audioPlayer property which access the the Player Object. To manage the playback, use the pause method. Read the full documentation here:- https://developer.apple.com/reference/avfoundation/avplayer/1387895-pause
Code example for reference:-
audioPlayer.pause()
Related
Hello i am recording screen to video file with GStreamer ximagesrc element using QT.
I want to draw circles on mouse clicks locations.
Can someone give a hint how to achieve this, looking at GstVideoOverlay I understand that it is used only on playing video in some window and draw in that window not directly in video stream that could be saved to file. Guessing that GstVideoOverlayRectangle can help here, but i`m not sure...
Thanks :)
I would recommend to look at cairooverlay:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-cairooverlay.html
I´m working with OMXPlayer on Raspberry.
Right now I have a loop(with Python2.7) to show videos and it works correctly.
But I have two problems:
1. When one video is finished, the Desktop will be shown for one second. And I don't want it. How can I change quickly to another video without showing the Desktop?
2. Another problem is that I wanna show some pictures too.. I know that OMXPlayer does not show images... Can I use another program in my code? But the user should not notice the change.
Thanks.
I was trying to figure this out too but I'm afraid it's not possible. It seams to me that omxplayer is only able to play a single video at a time and to play another video you have to run a new instance of the program. It takes a while to initialize, hence the gap between the videos.
That said, I figured a nasty way to get around it. When playing a video, you can extract it's last frame into a PNG file with ffmpeg. Then, you can play the video with omxplayer and use whatever graphical tools you have to display the picture fullscreen in the background. When the video ends, it disappears but the picture stays there and since it's the last frame of the video, it appears to just freeze at the end for a second, before the next video starts. Then, you just repeat the process. Hope it helps.
I am learning after effects. I have got one template for after effect and trying to render it. all thing is working fine but just issue in audio output. I have selected audio output also in render but I am not getting audio, as well in preview ram. what I am missing ?
Thanks
Audio is simply muted. Check speaker icon, must help
Check your mute button or click RAM preview. Wait for video to render and click RAM preview button several times. I think it will solve the problem. I got this problem too but I clicked the RAM preview button and waited for it to render. And boom it worked.
I want to seek to a position before playing a video :
player= new VlcMediaPlayer(instance);
player->setPosition(pos);
player->setTime(time);
player->play();
but it does not work and instead I used this code:
player= new VlcMediaPlayer(instance);
player->play();
player->setPosition(pos);
player->setTime(time);
it now works but first plays the video (and shows some frames of the begining of the file) , is there any way to seek to a position before playing?
I don't know what VlcMediaPlayer is but seeking in libvlc is done with libvlc_media_player_set_time call. And as you can see in the documentation it requires to be called on the video being played. So you have to call play before you can call seek. But you can pause right after the play and then seek. That should do the job.
The link to the libvlc forum containing the similar question.
I'm trying to implement a "frame by frame" function for users on the Video Widget from Qt Examples, but I didn't find how to do that with QMediaPlayer. I also want to get MetaData of a video file (e.g. how many frames per second, duration, etc...) but .metadata("Duration") function give nothing.
Is QMediaPlayer the right class to use ? If yes, how can I do what I want ?
If not what class do I have to use ?
Thanks for your help.