0% found this document useful (0 votes)
24 views2 pages

Tutorial6 Video Coding FFMPEG

This tutorial provides instructions for encoding and assessing video quality using FFMPEG. Users are guided to download a raw video, install necessary codecs, and execute commands for encoding in H264 and H265 formats. Additionally, it covers measuring video quality through PSNR and SSIM metrics, with results saved in log files.

Uploaded by

Minh Đức
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Tutorial6 Video Coding FFMPEG

This tutorial provides instructions for encoding and assessing video quality using FFMPEG. Users are guided to download a raw video, install necessary codecs, and execute commands for encoding in H264 and H265 formats. Additionally, it covers measuring video quality through PSNR and SSIM metrics, with results saved in log files.

Uploaded by

Minh Đức
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TUTORIAL 6 – VIDEO CODING WITH FFMPEG

Objectives:

1. To consolidate your video coding and compression knowledge and practice skill;
2. To learn how to encode video with the well-known open-source tool FFMPEG;
3. To assess video quality

Preparation:

At home you are asked to:

1. Download a raw yuv video from https://hlevkin.com/hlevkin/14testvideos.htm


2. Install FFMPEG and codecs:

$sudo apt update


$sudo apt install ffmpeg libx264-dev libx265-dev

I. Encoding video

Issue the following command to encode the raw video into H264:

$ffmpeg -f rawvideo -pix_fmt yuv420p -s 352x288 -r 30 -i foreman.yuv -c:v libx264 -crf 28 -preset
slow output_avc.mp4

For H265:

II. Assessing video quality


The quality can be measured by estimating PSNR and SSIM. For the former, issue the command:

$ ffmpeg -video_size 352x288 -i foreman.yuv -i foreman.mp4 -lavfi psnr=stats_file=psnr_logfile.txt -f


null -

Similarly, to measure SSIM, type:


$ ffmpeg -video_size 352x288 -i foreman.yuv -i foreman.mp4 -lavfi ssim=stats_file=ssim_logfile.txt -f
null -

The text files respectively hold measurement statistics.

III. Compiling FFMPEG

FFMPEG is an open-source project, you may download and compile it from


https://ffmpeg.org/download.html#get-sources

You might also like