0

I have a single intro video. I want to add the intro using ffmpeg or a similar program in the beggining of the users uploaded video (and yes I do need to merge them in one file, so it would be possible to download it later) I`ve been searching internet and it suggests to convert both (intro and the other video) in to .mpg format.

OK, so far so good, but now when I try to join them together I get

[mpeg4 @ 0x5547c60]Invalid and inefficient vfw-avi packed B frames detected

So I`m guessing it is because of something being different in both videos, like frame rate or size. The worst thing is users are allowed to upload videos in almost any formats, also 240p-720p quality, so there is not one default size to convert the intro video into.

How could this be done?

Tmz Litz
  • 3
  • 2

2 Answers2

0

Your intro video should match the resolution of the user videos, you should have as many intro-videos in as many resolutions as the user videos. Or convert all the user videos to a single resolution to match that of the intro video.Are you doing intro.mpg + user.mpg to combine the videos? Is this giving the above error?

d33pika
  • 1,997
  • 14
  • 24
  • Alternatively, he can convert his intro video to a resolution matching the users' video as a first step, adding padding if necessary. That way he handles every possible resolution. He can then cache the result to speed things up for subsequent videos of the same resolution. – sashoalm Jul 18 '12 at 12:16
  • but how can I determine to what I need to convert the video? The videos will be uploaded using php and then exec() will run the ffmpeg commands. – Tmz Litz Jul 18 '12 at 17:00
  • After the videos are uploaded, run ffprobe and parse the result to get the width and height of the video. – d33pika Jul 19 '12 at 05:50
0

Use ffmpeg:

ffmpeg -i 'concat:input1|input2' -codec copy output

or

ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex '[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] concat=n=3:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' output.mkv

or

$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

$ ffmpeg -f concat -i mylist.txt -c copy output

Source: Concatenate two mp4 files using ffmpeg

Community
  • 1
  • 1
Dylan
  • 45
  • 10