Describe the bug
When I try to record a video with mp4 format, the video has no audio if it is longer than 30 seconds.
To Reproduce
set filetype to mp4 and record a long video
Environment (please complete the following information):
Installation Type
I found the issue, it turns out AVPlayer can't play a video from AVCaptureSession that has a .MP4 extension that is longer than 10 seconds by default.
This is due to fact that AVCaptureMovieFileOutput creates a MovieFragment every 10 seconds. MP4 doesn't support fragmentation, so for some reason all iOS devices can't play the video, but everything else can.
I created a PR and hopefully we can get @s4cha or someone from the Yummypets team to merge quickly :)
The fix:
private var videoOutput = AVCaptureMovieFileOutput()
videoOutput.movieFragmentInterval = .invalid
@Berk-Kaya Thank you for reporting this. @gintechsystems Can't thank you enough for finding the issue and taking the time to make the fix, this is greatly appreciated :) This will be in the next version.
Closing this as this is now solved :)
Most helpful comment
I found the issue, it turns out AVPlayer can't play a video from AVCaptureSession that has a .MP4 extension that is longer than 10 seconds by default.
This is due to fact that AVCaptureMovieFileOutput creates a MovieFragment every 10 seconds. MP4 doesn't support fragmentation, so for some reason all iOS devices can't play the video, but everything else can.
I created a PR and hopefully we can get @s4cha or someone from the Yummypets team to merge quickly :)
The fix:
PR: https://github.com/Yummypets/YPImagePicker/pull/359