{"id":13905418,"url":"https://github.com/Jocker666z/ffmes","last_synced_at":"2025-07-18T02:33:33.914Z","repository":{"id":164742633,"uuid":"241449635","full_name":"Jocker666z/ffmes","owner":"Jocker666z","description":"FFmpeg Media Encode Script * Simple bash tool for audio/video manipulation","archived":false,"fork":false,"pushed_at":"2024-11-19T18:13:46.000Z","size":20919,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-19T19:28:09.721Z","etag":null,"topics":["audio-processing","bash-script","batch","blu-ray","dvdrip","ffmpeg","ffmpeg-script","video-processing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jocker666z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-18T19:32:58.000Z","updated_at":"2024-11-19T18:13:49.000Z","dependencies_parsed_at":"2023-12-25T19:57:42.789Z","dependency_job_id":"98efff5d-b7d4-41b4-9f18-3619d61ed7cf","html_url":"https://github.com/Jocker666z/ffmes","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocker666z%2Fffmes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocker666z%2Fffmes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocker666z%2Fffmes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocker666z%2Fffmes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jocker666z","download_url":"https://codeload.github.com/Jocker666z/ffmes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226336516,"owners_count":17608852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-processing","bash-script","batch","blu-ray","dvdrip","ffmpeg","ffmpeg-script","video-processing"],"created_at":"2024-08-06T23:01:15.416Z","updated_at":"2024-11-25T13:31:14.567Z","avatar_url":"https://github.com/Jocker666z.png","language":"Shell","readme":"# ffmes - ffmpeg media encode script \n\nBash tool handling media files, DVD \u0026 Blu-ray. Mainly with ffmpeg. In batch or single file.\n\nSource media files, supported extension:\n* Video in 3gp, avi, bik, flv, m2ts, m4v, mkv, mp4, mov, mpeg, mts, ogv, rm, rmvb, ts, vob, vp9, webm, wmv\n* Audio in 8svx, aac, ac3, aif, aiff, amb, ape, aptx, aud, caf, dff, dsf, dts, eac3, flac, m4a, mka, mlp, mod, mp2, mp3, mqa, mpc, mpg, oga, ogg, ops, opus, ra, ram, sbc, shn, spx, tak, thd, tta, w64, wav, wma, wv\n* Subtitle in ass, idx/sub, srt, ssa, sup\n\n--------------------------------------------------------------------------------------------------\n## Install \u0026 update\n`curl https://raw.githubusercontent.com/Jocker666z/ffmes/master/ffmes.sh \u003e /home/$USER/.local/bin/ffmes \u0026\u0026 chmod +rx /home/$USER/.local/bin/ffmes`\n\n## Dependencies\n### Essential \n`ffmpeg ffprobe jq mkvtoolnix uchardet coreutils findutils bc`\n### Optional\n* `fd`: faster than GNU find\n* `gojq`: faster than jq\n* `mediainfo`: faster than ffmpeg \u0026 ffprobe\n### CUE Splitting\n`cuetools flac shntool`\n### DVD rip\n`dvdbackup lsdvd ogmtools setcd pv`\n### DVD Subtitle\n`ogmrip tesseract-ocr tesseract-ocr-all wget`\n### Blu-Ray rip\n`bluray_copy bluray_info`\n### Audio tag\n* Essential: `atomicparsley flac monkeys-audio python-mutagen vorbis-tools wavpack`\n* Optional: `monkeys-audio`\n\n\n## Use\n```\nUsage:\n  Select all currents: ffmes\n  Select file:         ffmes -i [INPUTFILE]\n  Select directory:    ffmes -i [INPUTDIR]\n\nIn batch:\n  Video batch, processes one subdirectories.\n  Audio batch, processes five subdirectories.\n\nOptions:\n                          Without option treat current directory.\n  -ca|--compare_audio     Compare current audio files stats.\n  -i|--input \u003cfile\u003e       Treat one file.\n  -i|--input \u003cdirectory\u003e  Treat in batch a specific directory.\n  -h|--help               Display this help.\n  -j|--videojobs \u003cnumber\u003e Number of video encoding in same time.\n                          Default: 1\n  -kc|--keep_cover        Keep embed image in audio files.\n  --novaapi               No use vaapi.\n  -s|--select \u003cnumber\u003e    Preselect option (by-passing main menu).\n  -pk|--peaknorm \u003cnumber\u003e Peak db normalization.\n                          Positive input used as negative.\n                          Default: 1 (-1 db)\n  -v|--verbose            Display ffmpeg log level as info.\n  -vv|--fullverbose       Display ffmpeg log level as debug.\n```\nExamples:\n* `ffmes` with audio/video in directory\n* `ffmes -i DIRECTORY-TO.EDIT` for directory\n* `ffmes -i FILE-TO.EDIT` for single video, audio, or subtitle\n* `ffmes -vv -i FILE-TO.EDIT` for single video or audio, with ffmpeg in log level as debug\n* `ffmes -s 1 -i FILE-TO.EDIT` for single video, select option 1 by-passing the main menu\n\n## Test\nffmes is tested, under Debian unstable almost every day.\nIf you encounter bugs or have proposals, I'm open to discussion.\n\n--------------------------------------------------------------------------------------------------\n## Documentations\n\n### Main menu options\n* Video:\n\t* 0, DVD \u0026 Blu-ray rip\n\t* 1, video encoding with custom options\n\t* 2, copy stream to mkv with map option\n\t* 3, one audio stream encoding\n* Video tools:\n\t* 10, add audio stream or subtitle in video file\n\t* 11, concatenate video files\n\t* 12, extract stream(s) of video file\n\t* 13, split or cut video file by time\n\t* 14, split mkv by chapter\n\t* 15, change color of DVD subtitle (idx/sub)\n\t* 16, convert DVD subtitle (idx/sub) to srt\n\t* 17, view video files stats\n* Audio:\n\t* 20, CUE splitter to flac\n\t* 21, audio to wav (PCM)\n\t* 22, audio to flac\n\t* 23, audio to wavpack\n\t* 24, audio to mp3 (libmp3lame)\n\t* 25, audio to vorbis (libvorbis)\n\t* 26, audio to opus (libopus)\n\t* 27, audio to aac\n* Audio tools:\n\t* 30, audio tag editor\n\t* 31, compare audio files stats\n\t* 32, generate png image of audio spectrum\n\t* 33, concatenate audio files \n\t* 34, split or cut audio file by time\n\t* 35, audio file tester\n\n--------------------------------------------------------------------------------------------------\n### Video options\n\n#### Option 0 details - DVD \u0026 Blu-ray rip\n##### DVD:\n* Rip DVD, include ISO and VIDEO_TS VOB\n* Choose title\n* Remux all stream in mkv\n* Chapters integration\n* launch option 1 (optional)\n\n##### Blu-ray:\n* Rip ISO \u0026 disc directory\n* Choose one title or all\n* Remux all stream in mkv\n* Subtitles metadata integration\n* Chapters integration\n* https://github.com/beandog/bluray_info must be installed (see install help bellow)\n\n#### Option 1 details - video encoding, custom options\n* Video:\n\t* Stream copy or encoding\n\t* Encoding options:\n\t\t* desinterlace\n\t\t* change resolution\n\t\t* rotate video (except hevc_vaapi)\n\t\t* HDR to SDR (except hevc_vaapi \u0026 mpeg4)\n\t\t* codecs:\n\t\t\t* libx264: profile, tune, preset \u0026 bitrate (video stream total size, crf \u0026 cbr)\n\t\t\t* libx265: profile, tune, preset, bitrate (video stream total size, crf \u0026 cbr), 1 or 2 pass encoding (not in batch)\n\t\t\t* hevc_vaapi: profile, bitrate (video stream total size, qp \u0026 cbr); need ffmpeg --enable-vaapi \u0026 proper system configuration; note at same bitrate low quality than libx265 but the encoding speed is much faster\n\t\t\t* AV1:\n\t\t\t\t* libaom-av1: cpu-used (preset), bitrate (video stream total size, crf \u0026 cbr)\n\t\t\t\t* libsvtav1: preset, bitrate (video stream total size, crf \u0026 cbr); need ffmpeg --enable-libsvtav1\n\t\t\t* mpeg4 (xvid): bitrate (qscale \u0026 cbr)\n* Audio:\n\t* All stream copy or encoding\n\t* Encoding options (apply to all streams):\n\t\t* codecs:\n\t\t\t* ac3 (ac3): bitrate (vbr \u0026 cbr)\n\t\t\t* opus (libopus): bitrate (vbr)\n\t\t\t* vorbis (libvorbis): bitrate (vbr \u0026 cbr)\n\t\t\t* flac (libflac): compression\n\t\t* Channels layout for ac3, flac, vorbis: 1.0, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.1\n\t\t* Channels layout for opus: 1.0, 2.0, 3.0, 5.1\n* Container:\n\t* mkv \u0026 mp4 support\n* Map streams selection\n\n#### Option 2 details - copy stream to mkv with map option\nCopy stream in mkv file, with streams selection if source have more than 2 streams.\n\n#### Option 3 details - add audio stream with night normalization\nAdd stream with night mode normalization (the amplitude of sound between heavy and weak sounds will decrease).\nThe new stream is in opus, stereo, 320kb. The final will be a mkv\n\n#### Option 4 details - encode one audio stream only\nEncode the selected audio stream of a video file, with the same settings as option 1. The final will be a mkv.\n\n#### Option 13 details - split or cut video file by time\nCut or split one video by time. Examples of input:\n\n* [s.20]        \u003e remove video after 20 second\n* [e.01:11:20]  \u003e remove video before 1 hour 11 minutes 20 second\n* [p.00:02:00]  \u003e split video in parts of 2 minutes\n\n#### Option 14 details - split mkv by chapter\nCut one matroska video per chapter, mkvtoolnix package must be installed.\n\n#### Option 15 details - change color of DVD subtitle (idx/sub)\nYou must run the option in a directory containing one or more pairs of idx/sub files with the same filename.\n\nColors palette available:\n* white font / black border\n* black font / white border\n* yellow font / black border\n* yellow font / white border\n\n#### Option 16 details - convert DVD subtitle (idx/sub) to srt\nYou must have installed tesseract-ocr, and ogmrip package (includes subp2tiff and subptools binaries).\n\nSupport :\n* Language: english, french, deutsch, spanish, portuguese, italian, japanese, chinese simplified, arabic, korean, russian.\n* multi index idx/sub\n\nTesseract engine available:\n* By recognizing character patterns, fast but not reliable\n* By recognizing character patterns + neural net (LSTM), slow but reliable (default)\n\n--------------------------------------------------------------------------------------------------\n### Audio options\n\n#### Option 21 details - PCM encoding\n* Encoding options:\n\t* Quality:\n\t\t* unsigned 8-bit\n\t\t* signed 8-bit\n\t\t* signed 16-bit little-endian\n\t\t* signed 24-bit little-endian\n\t\t* signed 32-bit little-endian\n\t\t* Sample rate: 44kHz, 48kHz, or auto (use libsoxr resampler if possible)\n\t* Channels layout 1.0 to 5.1\n\t* False stereo files detection (if a channels configuration not selected)\n\t* -1db peak normalization (only files that have a value less than) (if a channels configuration not selected)\n\t* After encoding, option for remove all source files, if not for remove created files\n\n#### Option 22 details - FLAC encoding\n* Encoding options:\n\t* Quality:\n\t\t* Compression level: 0 (fastest) \u0026 12 (slowest)\n\t\t* Sample rate: 44kHz, 48kHz, or auto (384kHz max) (use libsoxr resampler if possible)\n\t\t* Bit depth: 16, 24 bits, or auto\n\t* Channels layout 1.0 to 5.1\n\t* False stereo files detection (if a channels configuration not selected)\n\t* -1db peak normalization (only files that have a value less than) (if a channels configuration not selected)\n\t* After encoding, option for remove all source files, if not for remove created files\n\n#### Option 23 details - WavPack encoding\n* Encoding options:\n\t* Quality:\n\t\t* Compression level: 0 (fastest) \u0026 3 (slowest)\n\t\t* Sample rate: 44kHz, 48kHz, or auto (384kHz max) (use libsoxr resampler if possible)\n\t\t* Bit depth: 16, 24/32 bits, or auto\n\t* Channels layout 1.0 to 5.1\n\t* False stereo files detection (if a channels configuration not selected)\n\t* -1db peak normalization (only files that have a value less than) (if a channels configuration not selected)\n\t* After encoding, option for remove all source files, if not for remove created files\n\n#### Option 26 details - Opus encoding\n* Encoding options:\n\t* Bitrate\n\t\t* vbr, 64kb to 510kb\n\t\t* OR mode \"auto adapted bitrate from source\", particularly useful for processing very large batches of files\n\t* Channels layout 1.0, 2.0, 3.0, 5.1\n\t* After encoding, option for remove all source files, if not for remove created files\n\n#### Option 27 details - AAC encoding\n* Codec used: if the libfdk_aac codec is available (present in non-free configuration), it will be chosen by default. Otherwise it is the aac codec which will be chosen (present in the free configuration).\n* Encoding options:\n\t* Bitrate\n\t\t* vbr 1 to 5\n\t\t* cbr 64kb to 560kb\n\t* Channels layout 1.0 to 5.1\n\t* After encoding, option for remove all source files, if not for remove created files\n\n#### Option 30 details - tag editor\nTag for ape, flac, m4a, mp3, ogg, opus, wv files.\n\nOptions:\n* Change or add tag disc number\n* Rename files in \"Track - Title\"\n* Rename files in \"Track - Artist - Title\"\n* Rename files in \"Disc-Track - Title\"\n* Rename files in \"Disc-Track - Artist - Title\"\n* Change or add tag track, by alphabetic sorting\n* Change or add tag album\n* Change or add tag disc number\n* Change or add tag artist\n* Change tag artist by \"unknown\"\n* Change or add tag date\n* Change tag title for filename\n* Change tag title for \"untitled\"\n* Remove N character at begin in tag title\n* Remove N character at end in tag title\n* Remove text pattern in tag title.\n\nRestriction:\n* Max depth directory 2\n* Asian character not supported (display degrading)\n\n#### Option 35 details - split or cut audio file by time\nCut or split one audio by time. Examples of input:\n\n* [s.20]        \u003e remove audio after 20 second\n* [e.01:11:20]  \u003e remove audio before 1 hour 11 minutes 20 second\n* [p.00:02:00]  \u003e split audio in parts of 2 minutes\n\n--------------------------------------------------------------------------------------------------\n## In script options (variables)\n### Various\n* FFMPEG_CUSTOM_BIN: used for everything except video encoding; change default ffmpeg system bin for other location\n* FFPROBE_CUSTOM_BIN: change default ffprobe system bin for other location\n### Video\n* NVENC (default=0)\n\t* Description: number of video encoding in same time, the countdown starts at 0 (0=1;1=2...)\n### Audio\n* ExtractCover (default=0)\n\t* Description: action performed during encoding\n\t* 0=extract cover from source and remove in output\n\t* 1=keep cover from source in output\n\t* empty=remove cover in output\n* RemoveM3U (default=0)\n\t* Description: action performed after encoding at \"Remove source audio?\" question\n\t* 0=no remove\n\t* 1=remove\n* PeakNormDB (default=1)\n\t* Description: Peak db normalization option, this value is written as positive but is used in negative (e.g. 4 = -4)\n\n--------------------------------------------------------------------------------------------------\n## Dependencies installation\n### bluray_info \u0026 bluray_copy\nDependencies: `libbluray-dev libaacs-dev`\n\n```\ngit clone https://github.com/beandog/bluray_info \u0026\u0026 cd bluray_info\nautoreconf -fi \u0026\u0026 ./configure\nmake\nsu -c \"make install\" -m \"root\"\n```\n\n--------------------------------------------------------------------------------------------------\n## Known errors / unsupported\n* ffmpeg output error with CIFS mount solutions:\n\t* in your `/etc/fstab`, add option `cache=none`.\n\t* or use NFS instead samba.\n* CUE split fail with 24bits audio (shnsplit bug).\n* Encoding from Dolby Vision not supported for now.\n\n--------------------------------------------------------------------------------------------------\n## Holy reading\n* Video:\n\t* https://github.com/leandromoreira/digital_video_introduction#how-does-a-video-codec-work\n\t* https://slhck.info/video/2017/03/01/rate-control.html\n\t* x264:\n\t\t* https://trac.ffmpeg.org/wiki/Encode/H.264\n\t\t* https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping\n\t\t* http://www.chaneru.com/Roku/HLS/X264_Settings.htm\n\t\t* http://filthypants.blogspot.fr/2008/07/comparison-of-x264h264-advanced-options.html\n\t* x265:\n\t\t* https://x265.readthedocs.io/en/default/\n\t\t* https://trac.ffmpeg.org/wiki/Encode/H.265\n\t\t* https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding#Profiles\n\t\t* https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding_tiers_and_levels\n\t\t* https://x265.readthedocs.io/en/default/presets.html\n\t* SVT-AV1:\n\t\t* https://gitlab.com/AOMediaCodec/SVT-AV1/-/tree/master/Docs\n* Audio:\n\t* https://wiki.hydrogenaud.io/index.php?title=Lossless_comparison\n\t* https://wiki.hydrogenaud.io/index.php/LAME\n\t* https://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/\n* Tags:\n\t* https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html\n\n### FFmpeg static\n* https://github.com/BtbN/FFmpeg-Builds/wiki/Latest#latest-autobuilds\n\t* pro: compiled\n\t* pro: lgpl compliant (include vaapi \u0026 more)\n\t* con: without non-free codec\n* https://johnvansickle.com/ffmpeg/\n\t* pro: compiled\n\t* pro: official\n\t* con: without non-free codec\n* https://github.com/markus-perl/ffmpeg-build-script\n\t* pro: with non-free codec\n\t* con: not compiled\n\n--------------------------------------------------------------------------------------------------\n## Holy tools\n* Subtitle:\n\t* https://github.com/smacke/ffsubsync\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJocker666z%2Fffmes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJocker666z%2Fffmes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJocker666z%2Fffmes/lists"}