Skip to content

Instantly share code, notes, and snippets.

@frozer
Last active February 5, 2024 01:07
Show Gist options
  • Save frozer/48bbe0a239548d969c53fb7295dd2c3d to your computer and use it in GitHub Desktop.
Save frozer/48bbe0a239548d969c53fb7295dd2c3d to your computer and use it in GitHub Desktop.
FFMPEG tips&tricks

How can I reduce a video's size with ffmpeg?

ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

Note that lower CRF values correspond to higher bitrates, and hence produce higher quality videos.

How Can I Edit a Video File's "Comments" Field?

ffmpeg -i input.mp4 -c copy -metadata title="Your Title" -metadata artist="spaceman" -metadata comment="Comments go here" output.mp4

By default, FFmpeg supports the limited number of iTunes tags in the MP4 format. These are listed below. But custom tags can be written if -movflags use_metadata_tags is added. This applies both for adding new tags or carrying over custom global tags from the input.

iTunes tags supported in MP4:

"title"    
"artist"   
"album_artist"
"composer" 
"album"    
"date"     
"encoding_tool"
"comment"  
"genre"    
"copyright"
"grouping" 
"lyrics"   
"description"
"synopsis" 
"show"     
"episode_id"
"network"  
"episode_sort"
"season_number"
"media_type"
"hd_video"
"gapless_playback"
"compilation"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment