3

I've downloaded a set of Youtube Videos that are part of the same episode. Currently I've tried converting them into mp4 using ffmpeg and then joining with MP4Box.

for f in *.flv; do ffmpeg -i "$f" -vcodec copy -acodec copy "${f%.flv}.mp4"; done
MP4Box -cat part0.mp4 -cat part1.mp4 -cat part2.mp4 -cat part3.mp4 -cat part4.mp4 -new  video.mp4

However, upon joining with MP4Box opening the video in VLC does strange things. It seems create a video that has 3 different videos playing at the same time. Upon inspection, the videos have different bitrates and framerates, is this causing the problem?

Therefore, I'd like to re-encode the videos so that they are all the same and then joining them. Or is there a better way of accomplishing what I want?

Edit: I should have mentioned, I'd like to do this on the command line, as I want to semi-automate this process. Thanks!

Edit2: Seems like people are having similar problems as me with MP4Box. Sources:1 and 2. Then I tried avidemux, and it will merge them correctly but the audio is accelerated which is also cited here.

Final Edit and Solution: I followed the advice in this thread and converted the videos to mkv first, and then joined using mkvmerge, which worked great! Thanks!

6 Answers6

1

I followed the advice in this thread and converted the videos to mkv first, and then joined using mkvmerge, which worked great! Plus it's faster than the aforementioned software.

0

You can use the ffmpeg concat filter to concatenate multiple video files.

-filter_complex concat=n=%2:a=1

For example

ffmpeg -i vid1.flv -i vid2.flv -filter_complex concat=n=2:a=1 out.mp4

Note that the n parameter specifies the number of video files in this case.

Kissaki
  • 773
0

Did you give openshot a try? It's a free (as in speech) video editor for Linux.

OpenShot Video Editor is a free, open-source video editor for Linux licensed under the GPL version 3.0.

OpenShot can take your videos, photos, and music files and help you create the film you have always dreamed of. Easily add sub-titles, transitions, and effects, and then export your film to DVD, YouTube, Vimeo, Xbox 360, and many other common formats.

So if you're using ubuntu for example, it can join the videos for you easily.

lisa17
  • 1,329
0

I'd recommend the bare-bones video editors of most operating systems. In Ubuntu, Pitivi (the most basic of functionality); in Windows, Windows movie maker; in OSX, iMovie. You can open a project, import and join whichever clips you want, and export it to your desired format.

Yitzchak
  • 4,474
  • 7
  • 28
  • 44
0

I would try Avidemux - it also has CMD interface, but I never used it. However, Avidemux always had good results as I needed it. :-)

Juhele
  • 2,388
0

The ffmpeg faq describes how to join video files. I don't know if this will solve the problem for you, but you may find it useful: How to join video files

matzahboy
  • 321