Skip to Content

What is the video limit for Facebook API?

What is the video limit for Facebook API?

Facebook’s API allows developers to upload and share videos on Facebook. However, there are limits to the size and length of videos that can be uploaded via the API. Understanding these limits is important for developers building video-sharing apps or tools integrated with Facebook.

What is the file size limit for video uploads?

The maximum file size for video uploads via the Facebook API is 4GB. Any videos larger than 4GB will be rejected during the upload process. The 4GB limit applies to the raw video file before any compression or encoding by Facebook.

Developers should be mindful of this limit when selecting and encoding video files for upload. High-resolution, long-duration video files can easily surpass 4GB. Encoding videos at lower resolutions or bitrates may be necessary to accommodate the 4GB cap.

It’s also important to note that 4GB is the absolute maximum. For stable API video uploads, it’s recommended to keep videos under 1GB if possible. Upload success rates tend to decline for larger file sizes approaching the 4GB cutoff.

What are the video length limits?

In addition to file size, the Facebook API also imposes limits on video length or duration:

  • Maximum video length is 240 minutes (4 hours).
  • Minimum video length is 1 second.

Any videos longer than 240 minutes will be rejected by the API. Developers will need to split longer videos into segments or clips under 240 minutes to upload them.

At the lower end, extremely short videos under 1 second may not be allowed either. A minimum duration helps ensure meaningful, shareable videos.

How much video can be uploaded per day?

Apps using the Facebook API are subject to daily video upload limits based on the app’s posting volume and audience. Higher limits are granted for apps with more active users and video engagement.

As a baseline, most apps can upload at least:

  • 750 MB of video per day
  • 200 videos per day

Apps with high volumes and established audiences may qualify for increased daily limits. However, exact upload quotas are determined on a per-app basis.

It’s important for developers to be mindful of these limits during their app testing and launch phases. Exceeding the allotted daily quotas will lead to upload failures and limit future posting abilities.

How are video formats and codecs restricted?

The Facebook API only allows uploading videos in specific file formats, codecs, and containers. Supported formats include:

Format Codecs Containers
MP4 H.264, H.265 MP4
QuickTime H.264 MOV
AVI MJPG AVI
MPEG MPEG-2 MPG, MPEG

Videos not meeting these format, codec and container requirements will fail during upload.

The API only supports the H.264 codec in MP4 and QuickTime formats, and MJPEG for AVI files. Other common codecs like DivX and Xvid are not allowed.

MP4 is the recommended format for API uploads given its widespread compatibility. H.264 compression provides high quality at lower file sizes that fit under the 4GB limit.

What are the recommended video encoding settings?

To maximize quality and compatibility for API-uploaded videos, Facebook recommends:

  • MP4 container
  • H.264 video codec
  • AAC audio codec at 128kbps
  • 30 FPS frame rate
  • 16:9 aspect ratio
  • 1080p resolution or lower

Videos encoded with these specs balance quality, file size, and upload stability. Resolution can be adjusted as needed based on length and desired file size.

Variable bitrate encoding optimized for online streaming is also recommended. 2-pass encoding can help achieve better quality for a given target file size.

Is there a limit on video aspect ratios?

Yes, the Facebook API only supports uploading landscape and square videos. Portrait videos with a taller height than width are not allowed.

Horizontal landscape orientation is preferred. Squares are also acceptable as long as they meet the minimum dimension requirements.

The minimum dimensions for landscape videos are 600×315 (1.9:1 ratio). For squares, minimum size is 600×600.

Smaller or vertical videos not meeting these minimums will be rejected. Developers should transform portrait videos to landscape before uploading.

Are there limits on live streaming video?

The Facebook Live API has its own set of limits separate from the general video upload API:

  • Maximum live stream duration: 4 hours
  • Minimum live stream duration: 10 minutes
  • 720p minimum resolution
  • Landscape aspect ratio only

So while regular video uploads can be as short as 1 second, live streams have a higher 10 minute minimum. This aims to reduce very short test streams.

Live streaming only supports landscape orientation like regular video. Bitrates up to 6Mbps are recommended by Facebook for 1080p streams.

Can you upload and replace videos?

Yes, the Facebook API supports uploading videos multiple times to replace an existing video. When re-uploading, the same video ID should be specified in the API call.

This allows updating videos after editing fixes or adding higher quality versions. The new upload will replace the old video while maintaining the same URL and metadata.

There are rate limits in place for video replacements. Apps cannot re-upload videos more than 5 times in a 30 minute window, or more than 20 times in a 24 hour period.

How are videos compressed after uploading?

After a video is uploaded via the API, Facebook will perform additional compression and encoding to optimize delivery across platforms and network conditions.

This can result in the filesize decreasing significantly compared to the original upload. The amount of compression applied depends on the video resolution and bitrate:

Original Resolution Compressed Resolution
1080p 720p
720p 540p
360p No change

Higher resolution videos see more aggressive compression. 360p videos will not be altered since they are already optimized for delivery at low bitrates.

This compression means developers don’t need to upload multiple quality versions of the same video. Facebook will transcode the original high quality upload into variants tailored for each viewing environment.

What are the audio requirements?

Any audio streams in uploaded videos must adhere to these limits:

  • Supported codecs: AAC or MP3
  • Maximum bitrate: 128kbps
  • Maximum channels: stereo

Audio must use AAC or MP3 encoding at 128kbps or lower. This ensures files sizes remain manageable without compromising too much quality.

Only stereo channel configurations are allowed. Audio streams with surround sound mixing will need to be downmixed to stereo before uploading.

Can you schedule video uploads?

Yes, videos can be scheduled for future posting via the Facebook API. A publish_time parameter is available in the upload API call to specify a date and time for the video to go live.

Videos can be scheduled up to 4 months in advance. The publish_time must be between 10 minutes and 4 months after the time of the API request.

Scheduled videos will be processed immediately but not visible publicly until the requested publish time. This allows preparing videos in advance and timing their release.

Can you upload videos to Facebook Pages?

Uploading videos directly to Facebook Pages is possible through the API using a Page access token. The token grants posting access to the target Page.

When initializing the API client, the Page access token should be specified instead of a normal user access token. Video uploads will then be posted to that Page rather than the user timeline.

Page roles like Admin and Editor have access tokens that allow posting. Tokens can be generated for social media management tools to handle Page video uploads.

What privacy options are available?

Videos can be uploaded with different privacy settings via the API:

  • Public – Anyone can view, default option
  • Friends – Only the user’s friends can view
  • Friends except acquaintances – Friends but not acquatinances
  • Specific friends – Only visible to a custom list of friends
  • Only me – Private videos only the user can see

The default is public, but private and friend-only options are available. Custom friend lists can be defined for granular access control.

Private videos still occupy upload quota but are not counted in video view metrics. Private videos can later be made public if desired.

Is there an API upload limit per user?

Yes, the Facebook API imposes the following limits per user:

  • 50,000 API calls per day
  • 3,600 uploads per hour
  • 250 videos uploaded per batch

Exceeding these quotas will lead to API errors preventing additional uploads. Staggering uploads over time is recommended to stay within limits.

Uploading videos in batches instead of individually can maximize throughput. Batches support up to 250 videos per call.

How are captions and subtitles handled?

Video captions or subtitles can be uploaded via the API in SRT format. The subtitle file must be uploaded first to obtain an ID.

That ID is then specified in the video upload call to associate the captions with the video.

Captions are then displayed natively by Facebook during video playback. Multiple subtitle tracks can be provided to support different languages.

Can you upload 360 and VR videos?

Yes, 360-degree and VR videos are supported for upload via the Facebook API.

To upload a 360 video, the projection format must be specified in the call parameters. The supported projection types are:

  • equirectangular
  • cubemap
  • equalarea
  • half_equirectangular

Equirectangular is the most common projection for 360 consumer cameras like the Insta360 and GoPro Max.

Specifying the projection enables playback in 360 mode on Facebook rather than standard 2D. VR headsets can also view 360 API videos.

Are there country-specific limits?

Yes, Facebook API video uploads may be subject to additional country-specific limits.

In some countries like India, there are tighter restrictions on video length. Maximum duration may be limited to 15 minutes instead of the normal 4 hours.

Developers should check if any country-level limits apply based on where videos are being uploaded from and viewed.

Conclusion

To summarize the key Facebook API video limits:

  • Max file size is 4GB
  • Max length is 240 minutes
  • Max resolution 1080p
  • Landscape orientation required
  • H.264 codec recommended
  • 50,000 API calls daily per user

Keeping video uploads within these constraints ensures successful API posting. Compression and encoding adjustments may be required to conform large or high resolution files.

Following Facebook’s recommended specs for MP4 encoding, resolution, and audio settings can help streamline the process. Checking for country-specific limits is also advised.

With these limits and best practices in mind, developers can leverage Facebook’s massive global video audience via the Graph API. Proper video optimization unlocks engaging video experiences across the platform.