Skip to content

FFmpeg: Allow selection of specific video and audio streams for transcoding #3284

@lastzero

Description

@lastzero

As a user with videos that contain additional video or audio streams, I want to select which streams to transcode so that the others are ignored and do not cause problems during transcoding.

Updated FFmpeg Config Options

Environment CLI Flag Default Description
PHOTOPRISM_FFMPEG_BIN --ffmpeg-bin ffmpeg FFmpeg COMMAND for video transcoding and thumbnail extraction
PHOTOPRISM_FFMPEG_ENCODER --ffmpeg-encoder libx264 FFmpeg AVC encoder NAMEsponsors only
PHOTOPRISM_FFMPEG_BITRATE --ffmpeg-bitrate 50 maximum FFmpeg encoding BITRATE (Mbit/s)
PHOTOPRISM_FFMPEG_MAP_VIDEO --ffmpeg-map-video 0:v:0 video STREAMS that should be transcoded
PHOTOPRISM_FFMPEG_MAP_AUDIO --ffmpeg-map-audio 0:a:0? audio STREAMS that should be transcoded

Original Feature Request

When I upgraded my phone to the Google Pixel 7, I noticed that the videos it takes have an extra video stream in them for their compressed HVC1 implementation. This means that all software transcoding of that format would result in an unplayable video file, as it was transcoding the wrong video stream (likely a second stream of parity or difference data). This alteration fixed the issue for me, and will likely avoid video files with multiple video streams causing issues in the future.
MEDumont

FFmpeg Documentation

Related Pull Requests

Metadata

Metadata

Assignees

Labels

enhancementEnhancement or improvement of an existing featurereleasedAvailable in the stable releasevideoVideo Formats, Transcoding, FFmpeg, Streaming & Co

Type

No type

Projects

Status

Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions