WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.89k stars 972 forks source link

Encoders Need this new input for the Iphone to work right with large long videos #9207

Closed JoshWho closed 2 months ago

JoshWho commented 2 months ago

To ensure the best compatibility with iPhones, you can fine-tune your ffmpeg command. The following command ensures optimal settings for iOS devices:

Explanation: Container: .mp4 format is widely supported by iPhones. Video Codec: libx264 ensures high compatibility. Profile and Level: -profile:v baseline -level 3.0 ensures compatibility with older iPhones. Audio Codec: aac with a bitrate of 128k provides good audio quality. Fast Start: -movflags +faststart optimizes for streaming. These settings provide the best compatibility and performance on iOS devices.

so should look like this

MP4 Low: ffmpeg -i ${pathFileName} -vf scale=-2:480 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4 SD: ffmpeg -i ${pathFileName} -vf scale=-2:540 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4 HD: ffmpeg -i ${pathFileName} -vf scale=-2:720 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4FHD: ffmpeg -i ${pathFileName} -vf scale=-2:1080 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

The -profile:v baseline -level 3.0 settings in ffmpeg specify the H.264 profile and level for video encoding. Here's what they do:

Profile: baseline The baseline profile is designed for low-complexity video, suitable for devices with limited processing power, such as older iPhones and mobile devices. It excludes features like B-frames and CABAC entropy coding, making it more compatible with a broader range of devices. Level: 3.0 The level defines the constraints on parameters like maximum bitrate and resolution. Level 3.0 supports up to 720p resolution at 30 fps, which is sufficient for most mobile devices and ensures smooth playback on iPhones. These settings ensure that the encoded video is highly compatible with iOS devices, including older models.

JoshWho commented 2 months ago

This is a must @DanielnetoDotCom please have it put into the next get pull for the encoders URGENT to make all IOS work right

DanielnetoDotCom commented 2 months ago

did you try change it here ?

image

JoshWho commented 2 months ago

Yes, I did.

I am just saying your encoders and all future encoders should have this in it

JoshWho commented 2 months ago

Superfast preset with the new Profile and Level: -profile:v baseline -level 3.0 is the best way to default it all

JoshWho commented 2 months ago

Give me a few I will repost samples so u can try on Iphone and let me know how each one works.

JoshWho commented 2 months ago

just saying this should be the defaults for all new installs

MP4 Low: ffmpeg -i ${pathFileName} -vf scale=-2:480 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4 SD: ffmpeg -i ${pathFileName} -vf scale=-2:540 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4 HD: ffmpeg -i ${pathFileName} -vf scale=-2:720 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

MP4FHD: ffmpeg -i ${pathFileName} -vf scale=-2:1080 -movflags +faststart -preset superfast -c:v libx264 -profile:v baseline -level 3.0 -c:a aac -b:a 128k -max_muxing_queue_size 1024 -y ${destinationFile}

DanielnetoDotCom commented 2 months ago

thanks