sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
414 stars 94 forks source link

Recorded video cannot be played in iOS #215

Closed vincent1000 closed 1 year ago

vincent1000 commented 2 years ago

I recorded some videos and they can be played in windows and android, but they cannot be played when I put them in my iphone. I thought that the encoder may be incompatible with iOS, so I convert them with ffmpeg, something like "ffmpeg -i input.mp4 -c:v libx264 -crf 23 -profile:v baseline -level 3.0 -pix_fmt yuv420p -c:a aac -ac 2 -b:a 128k -movflags faststart ksk-output.mp4". After that, the videos can be played in iphone. So I wonder whether there are some settings to fix it. I use the following when recording: VideoEncoderOptions = new VideoEncoderOptions { Framerate = 30, IsFixedFramerate = true, IsFragmentedMp4Enabled = true, IsThrottlingDisabled = false, IsHardwareEncodingEnabled = true, IsLowLatencyEnabled = false, IsMp4FastStartEnabled = false }

vincent1000 commented 1 year ago

Find the root cause. IsFragmentedMp4Enabled should be false in order to play in iOS.