[Info] ffmpeg encoding

Post tutorials, HOWTO's and other useful resources here.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Info] ffmpeg encoding

Post#16 by Rava » 13 Aug 2021, 08:47

Since it took me a while to figure that out I share it with you.

You can concat files into one large file via a .txt file that holds the file names. The issue started when the source files hold whitespace or a simple ' - you need to use the "-safe 0" option since ffmpeg considers filenames with whitespace "unsafe".

Lets say you downloaded a playlist of music via youtube-dl, e.g. with

Code: Select all

youtube-dl -if 251 "https://www.youtube.com/playlist?list=WhAt-EvEr"
and then put the resulting files into your concat.txt file.
Each line holds one filename, starting with "file " - e.g. like so:

Code: Select all

file 'filename.mp4'
file 'filename 2.mp4'
And here is the tip:
Image
(Found it here: https://stackoverflow.com/questions/227 ... whitespace)

E.g. when a file is named

Code: Select all

Names' Confession.webm
you have to convert that into

Code: Select all

file 'Names'\'' Confession.webm'
to work (when the file is in the current folder, that is.)

Then just start the concat with this command:

Code: Select all

ffmpeg -f concat -safe 0 -i concat.txt -c copy "Playlist name.webm"
Cheers!
Yours Rava

Post Reply