AVC profiles supported in MOV or MP4 container - mp4

I am looking for a list of AVC profiles supported in MOV and MP4 containers. In particular, I am interested in knowing if AVC High 10, AVC High 4:2:2, and AVC High 10 4:2:2 profiles are supported in MOV and MP4 containers. Is this information listed in some standard reference ?

Mov and mp4 have no concept of profile. The profile is all encoded in the video sequence header and bitstream. Therefor mov and mp4 support all profiles and chroma sub sampling methods.
Players on the other hand, may not support all the profiles.

Related

MOV_RESAVE_CORRUPTED error on submitting app preview

When uploading an app preview to the app store submit process, I receive an unknown error MOV_RESAVE_CORRUPTED which is not documented anywhere in their uploading process.
I have captured the preview using QuickTime and had to reformat it using ffmpeg to a 30 FPS video, using this command
ffmpeg -r 30 -i preview1.mov -acodec copy -crf 12 -vf scale=886:1920,setsar=1:1 preview1-edit.mp4
The video is working fine on my local machine but upload won't work.
Frankly, the whole process is very annoying and super stressful. Hopefully I can help anyone else having this problem with this thread.
Thank you.
SOLUTION: In my case the issue was the audio encoding, used Handbrake free video tool and ensured the video specs were set to:
Video Codec (FPS) to : H.264(x264) Video Framerate (FPS) to : 30 Audio Codec to : AAC (Core Audio) Audio Mixdown to : Stereo Audio Sample rate to : 44.1 Audio Bitrate to : 256
The app preview videos are working fine now!
Create a new Preset. Set name iPhone 6.5 App Preview to recognize easily.
Select Audio Behavior. Set samplerate to 44.1, bitrate to 256. Then save it
Go to Audio tab. Then select Presets from right up corner.
Check audio samplerate and bitrate then click Start. Then upload it.
App Store Connect is very tough about video formats, only accepts H264 + AAC in mp4 or mov container, otherwise it just says (after 10 minutes): MOV_RESAVE_CORRUPTED. See details: https://help.apple.com/app-store-connect/#/dev4e413fcb8

How to add MOV file header to raw data written file with ffmpeg?

I am going to record H264 encoded video stream data in iOS using swift.
I am not familiar with video codec formats so don't know how to do this. But I've tried to write the H264 raw video data to the file sequently and see its file Info. I am surprised that it has almost video file info (compared with standard mp4, MOV file). The only missing info is video duration, file size, overall bit rate, encoded data, etc. So I am just wondering if video can play if I add the MOV file header to this file manually. Spent few hours to googling how to add MOV file header with ffmpeg but stacked. Any help would be appreciated. Thanks
You can nominally use ffmpeg to do this:
ffmpeg -i in.h264 -c copy out.mov
However, due to a bug in ffmpeg relating to generation of PTS for video streams with multiple B-frames, the output video may not play smoothly. Test and check.
If it doesn't there's a workaround which involves using mp4box from GPAC.
mp4box -add in.h264 -new out.mp4
and then
ffmpeg -i out.mp4 -c copy out.mov

using ffmpeg to display video on iPhone

anyone can help me on this ?
I have this API
ret = avRecvFrameData(avIndex, buf, VIDEO_BUF_SIZE, (char *)&frameInfo, sizeof(FRAMEINFO_t), &frmNo);
the buffer will fill with the content from the video thread the codec is H264 frameInfo contains the related information. If I want to display on iPhone, how to do it with ffmpeg?
much appreciated with your help .
You should not be using ffmpeg in an iOS for a number of reasons. First, there are real license issues that put including ffmpeg in a legal grey area when it comes to iOS apps. Second, performance will be very very poor. Third, iOS already includes APIs that have access to the h.264 hardware on the device. You can find my example Xcode project at AVDecodeEncode, this is an example of using my library to decode from h.264 and then encode back to h.264.

iOS Mjpeg encoding and muxing to MP4

I need to dev an app to encode a Mjpeg stream into an MP4 in ipad/iphone.
Are there available iOS API that I can use to encode & mux (hopefully hardware accelerated).

Video file formats supported in iPhone

What are the the video file formats supported by the iPhone OS?
Thanks
Quoting the iPhone OS Technology Overview:
iPhone OS provides support for full-screen video playback through the Media Player framework (MediaPlayer.framework). This framework supports the playback of movie files with the .mov, .mp4, .m4v, and .3gp filename extensions and using the following compression standards:
H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
H.264 video, up to 768 Kbps, 320 by 240 pixels, 30 frames per second, Baseline Profile up to Level 1.3 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
Numerous audio formats, including the ones listed in “Audio Technologies”
For information about the classes of the Media Player framework, see Media Player Framework Reference.
The short answer is the iPhone supports H.264 video, High profile and AAC audio, in container formats .mov, .mp4, or MPEG Segment .ts. MPEG Segment files are used for HTTP Live Streaming.
For maximum compatibility with Android and desktop browsers, use H.264 + AAC in an .mp4 container.
For extended length videos longer than 10 minutes you must use HTTP Live Streaming, which is H.264 + AAC in a series of small .ts container files (see App Store Review Guidelines rule 2.5.7).
Video
On the iPhone, H.264 is the only game in town. [1]
There are several different feature tiers or "profiles" available in H.264. All modern iPhones (3GS and above) support the High profile. These profiles are basically three different levels of algorithm "tricks" used to compress the video. More tricks give better compression, but require more CPU or dedicated hardware to decode. This is a table that lists the differences between the different profiles.
[1] Interestingly, Apple's own Facetime uses the newer H.265 (HEVC) video codec. However right now (August 2017) there is no Apple-provided library that gives access to a HEVC codec to developers. This is expected to change at some point.
In talking about what video format the iPhone supports, a distinction should be made between what the hardware can support, and what the (much lower) limits are for playback when streaming over a network.
The only data given about hardware video support by Apple about the current generation of iPhones (SE, 6S, 6S Plus, 7, 7 Plus) is that they support
4K [3840x2160] video recording at 30 fps
1080p [1920x1080] HD video recording at 30 fps or 60 fps.
Obviously the phone can play back what it can record, so we can guess that 3840x2160 at 30 fps and 1920x1080 at 60 fps represent design limits of the phone. In addition, the screen size on the 6S Plus and 7 Plus is 1920x1080. So if you're interested in playback on the phone, it doesn't make sense to send over more pixels then the screen can draw.
However, streaming video is a different matter. Since networks are slow and video is huge, it's typical to use lower resolutions, bitrates, and frame rates than the device's theoretical maximum.
The most detailed document giving recommendations for streaming is TN2224 Best Practices for Creating and Deploying HTTP Live Streaming Media for Apple Devices. Figure 3 in that document gives a table of recommended streaming parameters:
This table is from May 2016.
As you can see, Apple recommends the relatively low resolution of 768x432 as the highest recommended resolution for streaming over a cellular network. Of course this is just a recommendation and YMMV.
Audio
The question is about video, but that video generally has one or more audio tracks with it. The iPhone supports a few audio formats, but the most modern and by far most widely used is AAC. The iPhone 7 / 7 Plus, 6S Plus / 6S, SE all support AAC bitrates of 8 to 320 Kbps.
Container
The audio and video tracks go inside a container. The purpose of the container is to combine (interleave) the different tracks together, to store metadata, and to support seeking. The iPhone supports
QuickTime .mov,
MP4, and
MPEG-TS.
The .mov and .mp4 file formats are closely related (.mp4 is in fact based on .mov), however .mp4 is an ISO standard that has much wider support.
As noted above, you have to use MPEG-TS for videos longer than 10 minutes.
Short answer: H.264 MPEG (MP4)
Long answer from Apple.com:
Video formats supported: H.264 video,
up to 1.5 Mbps, 640 by 480 pixels, 30
frames per second,
Low-Complexity
version of the H.264 Baseline Profile
with AAC-LC audio up to 160 Kbps,
48kHz, stereo audio in .m4v, .mp4, and
.mov file formats; H.264 video, up to
2.5 Mbps, 640 by 480 pixels, 30 frames per second,
Baseline Profile up to
Level 3.0 with AAC-LC audio up to 160
Kbps, 48kHz, stereo audio in .m4v,
.mp4, and .mov file formats; MPEG-4
video, up to 2.5 Mbps, 640 by 480
pixels, 30 frames per second,
Simple
Profile with AAC-LC audio up to 160
Kbps, 48kHz, stereo audio in .m4v,
.mp4, and .mov file formats
http://www.apple.com/iphone/specs.html