Location>code7788 >text

FFmpeg in Game Video Recording: A Comprehensive Comparison of Picture Quality and File Size

Popularity:855 ℃/2024-08-03 20:57:35

Our in-game video recording currently only supports avi fixed bitrate, at the player meetup there was feedback from players that they would like to improve the recording quality, I've recently been researching some of the content regarding video quality and have done some stats.

Recorded Video Size Comparison

First of all in the game engine to add support for recording mp4 format, and the use of h246 encoding can be played directly on the web page can not do transcoding!

Test scenarios: video size fixed size: 1904x1002, avi using mpeg4, mp4 using h264, bit rate (bit rate / bit rate) 20Mb / s, recorded out of the video file size

video format 30fps/30s 30fps/60s 60fps/60s 60fps/180s
avi video size 70.2 143.07 144.03 429.44
mp4 video size 68.4 139.66 140.59 430.7

Experiment 2: Adjust the bitrate to 10Mb/s, same fps and video duration, file size halved, not recorded in the table here.

Why are the file sizes of mp4 and avi close to each other? doesn't fps affect the file size?

Different fps for the same bitrate doesn't affect the picture quality, fps only affects the smoothness of the video

Simply put, the decoding rate is the amount of data allocated to each frame, the more it is divided, the clearer the picture quality and the larger the file size.

Bitrate table for different picture quality

Now our game provides players with avi format, bit rate 20Mb/s, fps range between 10~30.

The engine has added new interfaces and the hidden treasure recording client is already using the new interfaces, hopefully more settings can be opened up to players!

Customized formats: avi and mp4

Custom bitrate: used to increase the image quality, such as 720p, 1080p, 2k, 4k, make a slider or drop-down list to select different image quality

Open higher frame rate, 60FPS

Attachment: Bitrate table corresponding to different picture quality

picture quality 720p 1080p 2k 4k
bitrate 1mbps~4mpbs 3mbps~8mbps 5mbps~20mpbs 20mbps~50mbps

Recorded video standards

Refer to NetEase's mainstream mobile game standards as follows:

Size: are similar 1920 * 1080

Code rate: around 10000kpbs, about 10Mbps

Frame rate: around 50 fps

Size: 20~40MB on average (length around 20 seconds in size)

Video bit rates are usually measured in kbps (kilobits per second) or Mbps (megabits per second), where 1Mbps equals 1000kbps. Where 1Mbps is equal to 1000kbps. mbps is used to describe higher bit rates and kbps is used to describe lower bit rates.

Sky 3 is now the default bit rate: 20000000, recording 20 seconds of 50fps video file size of 46.23MB, changed to the code rate required by the Hidden Treasures, 20 seconds of video 50FPS file size down to 24MB

Picture Quality Comparison

Why is there not much difference in the picture quality of videos recorded in avi and mp4 formats?

This is because AVI and MP4 are both container formats and they do not affect the picture quality of the video by themselves. In fact, the picture quality of a video depends on factors such as encoder and bitrate. If the same encoder and bitrate are used, then the picture quality of videos in AVI and MP4 formats should be the same. However, since the MP4 format usually uses a more advanced video encoder, videos in MP4 format may be sharper at the same bitrate.

What kind of image quality is clearer, h264 or mpeg4?

H.264 and MPEG-4 are both video coding standards and they both provide high quality video compression. At the same bit rate, the file sizes of H.264 and MPEG-4 should be about the same, however, H.264 usually provides better picture quality than MPEG-4 because it uses more advanced compression techniques to provide higher quality video at the same bit rate. In addition, H.264 supports higher resolutions and frame rates, making it more common in HD video and streaming applications.

The effect of fps on video?

FPS determines the smoothness and sharpness of the video. If there are fast moving objects or fast changing scenes in the recorded video, you need to use a higher FPS value to capture more details, otherwise the video may appear blurred or distorted.