Skip to content

ffmpeg fails when COMMENT metadata contains newline #259

Description

@MB901

Hi,

When using ytarchive with --add-metadata, if the video description contains a newline (\n), this gets passed into the COMMENT metadata in the ffmpeg command.

With the latest version of ffmpeg, this causes muxing to fail with exit code -1 when outputting to MP4 with -c copy.

Example generated command (from --write-mux-file):

-metadata 'COMMENT=https://www.youtube.com/watch?v=xxxxxx
Second line of comment text'

Workaround:
Removing the newline from the COMMENT value allows ffmpeg to complete successfully.

Suggested fix:
Sanitize metadata values before passing them to ffmpeg, remove or escape newline characters from the description text used in COMMENT.

This issue is also discussed here: #jim60105/docker-ytarchive#1

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions