0

I started by using the suggestions found at this link:

How to join video files from terminal?

It worked for the first 6 times that I tried to merge a group of small .avi files into one larger file. However, since then it appears to go through the motions in the terminal, but the output file is only between 632-648 bytes. I've tried restarting, but nothing changed. Here is a detailed summary of steps that I have taken:

$ sudo apt-get install mencoder libxvidcore4 libmp3lame0
Reading package
lists... Done Building dependency tree        Reading state
information... Done libmp3lame0 is already the newest version.
libxvidcore4 is already the newest version. mencoder is already the
newest version. 0 upgraded, 0 newly installed, 0 to remove and 55 not
upgraded.

Everything seemed to be up to date, so I did the following:

mencoder -ovc copy -oac mp3lame VID00303.AVI VID00304.AVI VID00305.AVI VID00306.AVI VID00307.AVI -o joined-video.avi

This is the command that worked the first six times to produce perfectly synced and merged video files. It's not working now. Here is a copy of what I get in the terminal when I run this command:

MEncoder 1.1-4.8 (C) 2000-2012 MPlayer Team success: format: 0  data:
0x0 - 0x38c2466 libavformat version 54.20.4 (external) Mismatching
header version 54.20.3 AVI file format detected. [aviheader] Video
stream found, -vid 0 [aviheader] Audio stream found, -aid 1 VIDEO: 
[H264]  1280x720  24bpp  30.000 fps  8304.7 kbps (1013.8 kbyte/s) [V]
filefmt:3  fourcc:0x34363248  size:1280x720  fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.35.0 (external) AUDIO: 44100 Hz, 1 ch, s16le,
177.4 kbit/25.15% (ratio: 22179->88200) Selected audio codec: [ffadpcmms] afm: ffmpeg (FFmpeg MS ADPCM audio)
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248) MP3 audio
selected. Writing header... ODML: Aspect information not (yet?)
available or unspecified, not writing vprp header. Writing header...
ODML: Aspect information not (yet?) available or unspecified, not
writing vprp header. Pos:   0.7s     23f ( 2%)  0.00fps Trem:   0min  
0mb  A-V:0.068 [0:132]

Skipping frame! Pos:   1.2s     38f ( 3%)  0.00fps Trem:   0min   0mb 
A-V:0.068 [8737:135]

Skipping frame! Pos:  56.0s   1682f (100%) 316.17fps Trem:   0min  
0mb  A-V:0.011 [8312:130] success: format: 0  data: 0x0 - 0x286ce54
AVI file format detected. [aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1 VIDEO:  [H264]  1280x720  24bpp
30.000 fps  8297.5 kbps (1012.9 kbyte/s) [V] filefmt:3  fourcc:0x34363248  size:1280x720  fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 1 ch, s16le, 177.4 kbit/25.15% (ratio: 22179->88200)
Selected audio codec: [ffadpcmms] afm: ffmpeg (FFmpeg MS ADPCM audio)
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248) Pos:  95.9s  
2881f (100%) 326.20fps Trem:   0min   0mb  A-V:0.023 [8306:132]
success: format: 0  data: 0x0 - 0x2759266 AVI file format detected.
[aviheader] Video stream found, -vid 0 [aviheader] Audio stream found,
-aid 1 VIDEO:  [H264]  1280x720  24bpp  30.000 fps  8305.0 kbps (1013.8 kbyte/s) [V] filefmt:3  fourcc:0x34363248  size:1280x720 
fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 1 ch, s16le, 177.4 kbit/25.15% (ratio: 22179->88200)
Selected audio codec: [ffadpcmms] afm: ffmpeg (FFmpeg MS ADPCM audio)
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248) Pos:  96.5s  
2898f ( 3%) 324.52fps Trem:   4min   0mb  A-V:0.070 [8308:132]

Skipping frame! Pos: 134.8s   4047f (100%) 330.26fps Trem:   0min  
0mb  A-V:0.022 [8306:133] success: format: 0  data: 0x0 - 0xd5549a AVI
file format detected. [aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1 VIDEO:  [H264]  1280x720  24bpp
30.000 fps  8307.1 kbps (1014.0 kbyte/s) [V] filefmt:3  fourcc:0x34363248  size:1280x720  fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 1 ch, s16le, 177.4 kbit/25.15% (ratio: 22179->88200)
Selected audio codec: [ffadpcmms] afm: ffmpeg (FFmpeg MS ADPCM audio)
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248) Pos: 147.9s  
4442f (100%) 327.29fps Trem:   0min   0mb  A-V:0.028 [8306:134]
success: format: 0  data: 0x0 - 0x18e672a AVI file format detected.
[aviheader] Video stream found, -vid 0 [aviheader] Audio stream found,
-aid 1 VIDEO:  [H264]  1280x720  24bpp  30.000 fps  8292.1 kbps (1012.2 kbyte/s) [V] filefmt:3  fourcc:0x34363248  size:1280x720 
fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 1 ch, s16le, 177.4 kbit/25.15% (ratio: 22179->88200)
Selected audio codec: [ffadpcmms] afm: ffmpeg (FFmpeg MS ADPCM audio)
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248) Pos: 148.9s  
4472f ( 6%) 325.90fps Trem:   3min   0mb  A-V:0.068 [8306:134]

Skipping frame! Pos: 172.5s   5181f (100%) 330.72fps Trem:   0min  
0mb  A-V:-0.011 [8301:134] Writing index... Writing header... ODML:
Aspect information not (yet?) available or unspecified, not writing
vprp header.

Video stream: 8299.826 kbit/s  (1037478 B/s)  size: 179034171 bytes 
172.567 secs  5181 frames

Audio stream:  134.242 kbit/s  (16780 B/s)  size: 2895679 bytes 
172.565 secs

I've tried several different alternatives. I tried -oac copy and -oac faac, but achieved the same result each time.

Any advice?

  • Do you want to concatenate them without re-encoding them, or do you want to output to a different format, possibly perform some filtering, or modify it in any way? – llogan Sep 25 '14 at 18:49
  • I'm just trying to concatenate without re-encoding. Until now I'm just doing .avi to .avi, but if it's easier to do by re-encoding then I'd be willing to do that. My ultimate goal is to make a DVD video of all the short video clips we took when my daughter was a baby, but I run into the 61 file limit for DVD menus when I try this on DeVeDe. Since 61 short clips only fills a fraction of the DVD's volume capability, I'm trying to concatenate them so I can use the disc's full potential. Any format that I can convert into an .iso in DeVeDe would be fine. – Saptamani Sep 26 '14 at 14:39

1 Answers1

1

1. Get ffmpeg

Download a static build of ffmpeg or compile ffmpeg. The version in the repo is a fake (removed in 14.04) and does not have the concat demuxer.

2. Make a text file listing inputs

Assuming all .AVI inputs are in the current directory. All files must have the same streams (same codecs, same time base, etc.).

printf "file '%s'\n" ./*.AVI > mylist.txt

3. Run ffmpeg

./ffmpeg -f concat -i mylist.txt -c copy output.avi

If you're using the static build don't forget to use ./ffmpeg as in the example above, or use the full path to your new ffmpeg or the system version will be used instead.

More info

llogan
  • 11,868