M: I need to concatenate two MP4s with ffmpeg
G: To concatenate two MP4 files
with ffmpeg, follow these steps:
If they aren't identical in codec, resolution, or framerate, you'll need to re-encode them for a smooth concatenation.
ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" \
-map "[outv]" -map "[outa]" output.mp4This command works even if the videos differ slightly, as it re-encodes the output.
If both MP4s share the same codec, framerate, and encoding:
Create a text file listing the inputs:
echo "file 'input1.mp4'" > file-list.txt
echo "file 'input2.mp4'" >> file-list.txtRun the ffmpeg command:
ffmpeg -f concat -safe 0 -i file-list.txt -c copy output.mp4This method avoids re-encoding, making it faster and lossless.
M: Thank you… Do you know if fedora linux supports any type of link or shortcut file type? You know, something that only takes up a few bites and points to a file at another location in a way that can be accessed by programs, like windows seven had?
G: Yes, Fedora Linux (and most Linux distributions) supports symbolic links and hard links, which function similarly to shortcuts on Windows. Here's a brief overview:
Command to create a symbolic link:
ln -s /path/to/target /path/to/link_nameExample:
ln -s /home/user/Documents/file.txt /home/user/Desktop/file_shortcutCommand to create a hard link:
ln /path/to/target /path/to/link_nameExample:
ln /home/user/Documents/file.txt /home/user/Desktop/file_linkBoth of these options are lightweight, taking only a few bytes, and can be accessed by programs just like the original files.