Why can’t VLC go in to fullscreen mode? - matlab

I’m working on a Matlab application that uses a VLC class to control a VLC-instance. One of the features is to set the VLC player to fullscreen. This feature works perfectly fine.
The VLC player is downloaded from Matlab’s File Exchange: https://se.mathworks.com/matlabcentral/fileexchange/56215-vlc (Thanks a lot Léa Strobino)
However, one particular clip insists on resizing the player to a smaller size.
I have done some research and it turns out that this is a common problem in some VLC versions.
Normal workarounds are to uncheck the “adapt interface to video size” (something like that) and to check the “Fullscreen” box.
This ought to make the player open in fullscreen and not resize the screen to video size. The video still resizes the player to a smaller size.
All the specs of the clips are the same: Same file extension (.vob), formats and were made the same way (I did some video trimming and such using ffmpeg – but the same way every time).
I have noticed one difference and that is that this particular video has a lower Data and bitrate (~1000-1500kbps) where as the others are higher (<4000kbps). Also when showing the properties of the clip the frame height and width are blank as opposed to the others that have specific values.
This should however not have an effect of the fullscreen command from Matlab called after loading the video into the playlist. The command has no effect on this video, but does on all other.
It is possible to set the player to fullscreen manually by clicking the window, so it is not caused by some restriction in the video not allowing it to fullscreen.
Why does the video refuse to go in to fullscreen?
Hope somebody is able to help.

Okay so I seem to have solved the problem now. Without being completely sure why - the problem was in the lowered data/framerate.
I tried to add -crf 18 when converting my .mp4 to a .vob file:
ffmpeg -i input.mp4 -vcodec copy -acodec ac3 -crf 18 output.vob
The -crf stands for Constant Rate Factor and is a way to ensure a specific Data rate. The values goes from 0-51 and 18 seems to be the lowest 'sane' value (highest data rate). A good explanation can be found here: https://superuser.com/questions/677576/what-is-crf-used-for-in-ffmpeg
With this higher data rate the video opens up in fullscreen everytime :=)

Related

flutter: record a video that has same duration as animated webp

what I'd like to do:
I would like to record a video using Flutter's CameraController that has the same duration as an animated webp. On top of my screen, the animated webp is playing and below there is a CameraPreview() widget that records whatever my camera catches. This recorded video's duration should be exact as long as the animated webp's duration.
what I've tried so far:
Since Giphy offers not only a webp-version, but also an mp4-version, I downloaded the mp4 version and used ffmpeg to get the duration of that file.
I then used a timer and called VideoController.stopVideoRecording() after this duration automatically after VideoController.startVideoRecording().
what I'd expect to happen:
I'd expect this recorded video to be as long as the animated webp. Unfortunately, it's not.
So, my question is:
Do you guys have any idea how I could manage to record a video with same duration as an animated webp?
Thanks :)
Ok, sort of found what the issue is: Webp (and also Gifs) in Flutter are played slower than in browsers. Dont know if that is the case for all webps and gifs, but the ones I tested are all animated faster in a desktop-browser than in flutter. So, animation time of those webp is not the same as playing-time of the respective .mp4 file.
I use those mp4-versions now instead and that does the job.

App Store preview video error: The frame rate of one or more of your app previews is too high

When I tried to upload a preview video followed by apple's guide, itunesconenct popup an error:
Any one knows how to solve this? Thanks,
Apple's Guide:
https://developer.apple.com/app-store/app-previews/
Movies in App Reviews are to have max frame rate of 30 fps. Therefore, you have to find ways to reduce your video frame rate. I reduced mine to 24 fps and got accepted by App Store. There are options as discussed below.
A. Using Terminal:
i) install ffmpeg program if you don't have:
brew install ffmpeg --with-chromaprint --with-fdk-aac --with-libass --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rtmpdump --with-rubberband --with-sdl2 --with-snappy --with-tools --with-webp --with-x265 --with-xz --with-zeromq --with-zimg
ii) run ffmpeg to force changing frame rate to, 24 fps, for example.
ffmpeg -i input.mp4 -r 24 output.mp4
B. Using a graphical program such LumaFusion. You can buy LumaFusion and install on an iPhone/iPad, and change frame rate upon saving the video.
C. I tried to change the frame rate on iMovie, version 10.1.9, (on the Mac High Sierra 10.13.6), but there is straight forward way to change frame rate.
Please check the official App Preview Properties: https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW10
Specifically, the Max Frame Rate is 30 fps
As you didn't mention, how you took the App Preview, I would recommend a video editing tool like iMovie, Adobe After Effects or Final Cut Pro to reduce the frame rate to the 30 fps limit.
I use DaVinci Resolve to create previews for the App Store.
There is a free download here. https://www.blackmagicdesign.com/products/davinciresolve/.
Set the project to the proper resolution (e.g. 866x1920 or 1080x1920).
Import the clip to the timeline
Right click and set the clips properties to 30FPS.
Select File -> Media Management
Then Transcode option
Set the wrapper to MP4 and the CODEC to H.264
Your clip will be exported in the proper format.

How do I pause video at the exact moment I capture a photo?

I am using AVFoundation to display a Video in my UIView via an AVCaptureVideoPreviewOverlay.
I then use AVStillImageOutput's -captureStillImageAsynchronouslyFromConnection: to capture a still Image from the Video with the AVCaptureSessionPresetPhoto preset.
I am freezing the video using AVCaptureSession's -stopRunning in the -captureStillImageAsynchronouslyFromConnection completion block mentioned earlier. However, it's too late and the video has continued running while the still image is taken, so the freeze is a second or two later. When I display the image there is a jump.
How can I freeze the video at the exact moment the photo is taken?
Almost a year later...Your approach is all wrong. Instead of trying to pause the video at the precise moment that the image is captured why don't you pause the video and then capture that paused image. To a user it makes no difference, to a developer you don't have to worry about exact precision.
To reiterate my idea, if you pause a video and flash white visual and play a click the user will think you have just captured that frame regardless if you are or not. Actually, you could consider pausing video the same as capturing an image without saving it.

Play mp3 file smoothly upon dragging a scroll using AVToolbox or openAL

I have been facing this since so many days but I have not reach to any conclusion.
My problem is : I want to play an mp3 file but not simply by clicking on a play button.
It is this way I want to play it.
*There is a slider that I can drag using finger, I want that the mp3 should play with the frequency with which I am dragging the finger (or speed with which I am dragging my finger, so that it will give an effect of fast forwarding (funny type of voice)) or if I drag slider slowyly the output will be slow *
The problem is the output of the sound is not coming out smooth. its very distorted and disturbed voice.
I want the outuput to be smoother.
Please help. Any suggestions please. Presently I am using AVAudioPlayer and passing the time value based upon slider input to play the file. (It does not seems to be feasible though).
I feel that it is possible using openAL only and no other way. Because using openAL we can modify the frequency of the sound file (pitch)
CAN SOME ONE PLEASE REFER ME A LINK TO openAL implementation for iPhone . I have never played a sound file using openAL
Help!!
You won't be able to do it with AVAudioPlayer, as it does not support pitch operations.
You can load and decode the entire track into memory for playback with OpenAL (which supports pitch), or you can do realtime loading/decoding and pitch changing using Audio Units (MUCH lower level, and more complicated, though).

FFmpeg on iPhone - Modifying Video Orientation

I'm messing with h264 videos loaded with FFmpeg on the iPhone 3GS. The problem is any videos recorded in "Portrait" orientation have a transformation matrix applied to them causing them to display rotated 90 degrees counter-clock.
From what I understand thus far, I just need to modify the transform matrix in the 'tkhd' atom. The problem is I am having trouble accessing or modifying this data. I checked out the FFmpeg implementation for:
static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
which clearly shows how the matrix is accessed in avformat but when I try to access the header bytes using the same functions I am not getting any rational values. Even if I were to successfully pull the matrix I'm not sure how to replace it? FFmpeg has functions for retrieving and appending to the track header but nothing for replace it seems?
Any help would be greatly appreciated.
Thanks,
Matt.
To those who cannot get the v filter option to work, after some searching I found an alternative option which works for my build:
ffmpeg -i in.avi -vf "transpose=1" out.avi
this flips the video 90 degrees clockwise. hope this helps all those on ubuntu struggling like I was!! :)
I just had a patch accepted on the FFMPEG git master branch which should help all of us in adjusting for the iPhone's orientation and subsequent transform applied to the .mov file it sends out. FFMPEG will now send back in metadata:
'rotate'=90,180,or 270 depending on how many degrees you need to turn the image clockwise to get the true rotation.
Portrait video recorded in iPhone 3GS is strangely rotated in landscape, and only quicktime plays it correctly, players like VLC etc play the portrait mode videos in landscape because it is encoded that way! Maybe apple have set some bit so that quicktime identifies and sets the orientation properly.
You can use -vfilters option of ffmpeg to rotate the video. It is available in version r21242. You have to patch it on your version of ffmpeg.
configure the build by using --enable-vfilters
and you can use the option:
ffmpeg -vfilters "rotate=90" -i input.mp4 output.mp4
to rotate the input movie.
the movie is recorded directly with the orientation of the hardware camera. when you turn it the camera still records with the same orientation and the same straight write to file.
What determines the orientation of the video is the Transform matrix
The matrix is set dependent on the iphone's orientation. And this is what will determine if you have to rotate the video. And that rotation could be 90 degrees and it could be 180 degrees. It depends on the phone orientation.
After you get an idea of what the matrix is and how it relates to the image you will be able to determine the orientation of the video.