21
April
2026
Batch convert HEVC video files to AVC
12:42

Batch convert HEVC video files to AVC

21 April 2026 12:42

How to convert video from HEVC (H.265) to AVC (H.264).

Introduction

Videos made by Apple and Samsung smartphones or modern video editors are not recognized by many set-top boxes and video players, since the modern HEVC video codec (H.265) is not played by them. The solution is to transcode HEVC to MPEG4 AVC.

Practice shows that for video to be compatible with the player you need to have:
*video format AVC(H.264)

  • sound format AC3. As a rule, there are no problems with sound.

An MP4 container can contain various video formats:
*MPEG4 Visual*(Advanced Simple@L1), also known as MPEG-4 Part 2 or ISO/IEC 14496-2, is a video codec from 1999. 100% of devices are recognized. MPEG-4 Part 2 is compatible with the H.263 video conferencing format and belongs to the DivX/Xvid family of codecs.
AVC or Advanced Video Coding**, aka H.264 or MPEG-4 Part 10 or ISO/IEC 14496-15 standard - has existed since 2010 (updated in 2014). 100% of devices are perceived.
*H.265, aka HEVC(High Efficiency Video Coding), standard ISO/IEC 23008-2:2023 - High efficiency MPEG-H. Some players can't play it, since it is mathematically more complex and requires a modern microprocessor with hardware support for H.265 video decoding.

You can find out the video file format using the MediaInfo console program or the Mediainfo-GUI graphical utility. Which can be installed with the command sudo apt install mediainfo mediainfo-gui.

Solutions to video playback problems:
1) purchase of a newer player with support for H.265 (HEVC), for example, the domestic TV set-top box Selenga HD-980.
2) or transcoding from HEVC to AVC (H.264).

Quote from support response:

Selenga HD980. Hello! Video formats: AVI, VOB, MOV, MKV, TS, MPG, MP4, as well as H.264 and the latest H.265/HEVC, and for audio formats like MP3, WMA. Main supported formats: Video: Containers: AVI, VOB, MOV, MKV, TS, MPG, MP4. Codecs: H.264, H.265/HEVC (for viewing modern channels). Audio: MP3, WMA.

Older models of set-top boxes do not support the HEVC video codec either on TV or when playing from a USB storage device (flash drive)!

Commands for video transcoding using FFmpeg

where:
CBR - constant bit rate (better suited for videos with scenes where there is little movement in the frame),
VBR - variable bit rate (better suited for fast-paced videos, movies and presentations).

In terms of video encoding:
MPEG4 Visual- outdated standard (but allows fast video encoding on weak hardware),
MP4 AVC- relatively new standard (average encoding speed)
HEVC- the most modern format (lowest encoding speed).

Terminal commands for transcoding video files

From where and where CBR VBR
HEVC to MPEG4 Visual
one file
ffmpeg -i input.mp4 -b:v 8M -c:v mpeg4 -c:a copy -filter:v fps=fps=30 output.mp4 ffmpeg -i input.mp4 -crf 20 -c:v mpeg4 -c:a copy -filter:v fps=fps=30 output.mp4
HEVC to MPEG4 Visual
several files in the current directory
IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -b:v 8M -c:v mpeg4 -c:a copy -filter:v fps=fps=30 './out/'$f ; done IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -crf 20 -c:v mpeg4 -c:a copy -filter:v fps=fps=30 './out/'$f ; done
HEVC to AVC
one file
ffmpeg -i input.mp4 -b:v 8M -c:v libx264 -c:a copy -filter:v fps=fps=30 output.mp4 ffmpeg -i input.mp4 -crf 20 -c:v libx264 -c:a copy -filter:v fps=fps=30 output.mp4
HEVC to AVC
several files in the current
IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -b:v 8M 20 -c:v libx264 -c:a copy -filter:v fps=fps=30 './out/'$f ; done IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -crf 20 -c:v libx264 -c:a copy -filter:v fps=fps=30 './out/'$f ; done
MP4 to HEVC
one file
ffmpeg -i input.mp4 -b:v 8M -c:v libx265 -c:a copy -filter:v fps=fps=30 output.mp4 ffmpeg -i input.mp4 -crf 20 -c:v libx265 -c:a copy -filter:v fps=fps=30 output.mp4
MP4 to HEVC
several files
IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -b:v 8M -c:v libx265 -c:a copy -filter:v fps=fps=30 './out/'$f ; done IFS=$'\n' && mkdir out && for f in $(find . -iname '*.mp4' -maxdepth 1 -execdir basename {} .po ';') ; do echo $f && ffmpeg -i $f -crf 20 -c:v libx265 -c:a copy -filter:v fps=fps=30 './out/'$f ; done

Comparison of video encoding speed and output file size

Source file input.mp4 size 16 MB with a resolution of 1920x1080 (Full HD), 30 frames per second.

Coding Encoding speed CBR-b:v 8M, frames per second Encoding speed VBR-crf 23, fps File size "output.mp4",CBR-b:v 8M File size "output.mp4" VBR-crf 23
AVC to HEVC 3.25 fps 2.39 fps 8.7 MB 16.4 MB
HEVC to AVC 7.3 fps 7.9 fps 8.7 MB 9.4 MB
HEVC to MPEG4 Part 2 50 fps 50 fps 8.2 MB 4.6 MB

Video quality at the same bit rate: MPEG4 << AVC << HEVC. Therefore, for HEVC, you can reduce the quality (which is not noticeable to the eye), from "-crf 23" to "-crf 28" to reduce the size of the output file.

A note about frames per second

There are videos of 30 frames per second and 29.97 frames per second.

To distinguish one from the other:

ffprobe -show_format -show_streams -loglevel quiet input.mp4 | grep "avg_frame_rate" 
mediainfo input.mp4 | grep "Frame rate" 

The first number will indicate the frame rate for the video.
The commands should use the actual number of frames per second.

You can be sure that smartphone videos have a frame rate of 30 or 60 frames per second. These videos have progressive scan. That is, 1920*1080 at 30 fps means 1920*1080p, or 1080p for short.
The same applies to 4K videos, they also have a frame rate that is a multiple of 30.

The 29.97 frames per second rate is used for interlaced videos such as television broadcasts filmed in the United States. The same frequency can be provided by video editor programs from Apple.

You can read more about the use of video formats in article.



Related publications