[MEncoder-users] How to join avi files with x264 streams?

Grozdan neutrino8 at gmail.com
Sat May 8 21:57:58 CEST 2010


On Sat, May 8, 2010 at 8:06 PM, Josef Wolf <jw at raven.inka.de> wrote:
> On Sat, May 08, 2010 at 05:06:44PM +0200, Grozdan wrote:
>> On Sat, May 8, 2010 at 4:50 PM, Josef Wolf <jw at raven.inka.de> wrote:
>> > On Sat, May 08, 2010 at 03:31:53PM +0200, Grozdan wrote:
>> >> On Sat, May 8, 2010 at 3:29 PM, Josef Wolf <jw at raven.inka.de> wrote:
>> >> > On Sat, May 08, 2010 at 01:41:05PM +0200, Grozdan wrote:
>> >> >> On Sat, May 8, 2010 at 11:48 AM, Josef Wolf <jw at raven.inka.de> wrote:
>> >> >> > On Fri, May 07, 2010 at 10:29:31AM -0500, Laine Lee wrote:
>> >> >> >> On 5/7/10 1:00 AM, "Josef Wolf" <jw at raven.inka.de> wrote:
>> >> >> >> > I have captured my old VHS recordings with mencoder and created x264 avi's
>> >> >> >> > using two-pass with those options:
>> >> >> >> >
>> >> >> >> >   -ovc x264 -x264encopts
>> >> >> >> > bitrate=800:pass=2:subq=7:frameref=15:subq=6:frameref=15:me=umh:partitions=all
>> >> >> >> > :8x8dct:direct_pred=auto:me_range=64:trellis=2:bframes=5:b_pyramid:weight_b:th
>> >> >> >> > reads=auto:nr=1000
>> >> >> >> >
>> >> >> >> > In the next step, I want to join some of those files. I tried:
>> >> >> >> >
>> >> >> >> >   mencoder -ovc copy -oac copy -o outfile.avi file1.avi file2.avi
>> >> >> >> >
>> >> >> >> > But the resulting file has some strange artefacts in the first ten seconds
>> >> >> >> > after the join position (that is, in the first ten seconds of file2.avi)
>> >> >> >> > which are _not_ present in the original file2.avi.
>> >> >> >> >
>> >> >> >> > Why does "-ovc copy" do any manipulations on the stream?
>> >> >> >> >
>> >> >> >> > Any ideas?
>> >> >> >>
>> >> >> >> Can you use "MP4Box -cat"?
>> >> >> >>
>> >> >> >> http://gpac.sourceforge.net/doc_mp4box.php
>> >> >> >
>> >> >> > jw at ubuntu:MP4Box -cat 01.avi -cat 02.avi t.avi
>> >> >> > H264/AVC Video format not supported in AVI - please extract to raw format
>> >> >> > first
>> >> >> > Error appending 01.avi: Feature Not Supported
>> >> >> >
>> >> >> > Do I have to re-encode into another format first? But then I would loose
>> >> >> > quality?
>> >> >>
>> >> >> No, you have to do exactly as it says above. Extract the video from
>> >> >> the avi container. Done like this
>> >> >>
>> >> >> MP4Box -aviraw video yourfile.avi
>> >> >
>> >> > Yeah, this seems to work. But now I loose A/V-sync again =:-(
>> >> >
>> >> > This is what I do:
>> >> >
>> >> >  MP4Box -aviraw video file1.avi
>> >> >  MP4Box -aviraw video file2.avi
>> >> >
>> >> >  MP4Box -aviraw audio file1.avi
>> >> >  MP4Box -aviraw audio file2.avi
>> >> >
>> >> >  MP4Box -cat file1_video.h264 -cat file2_video.h264 out.h264
>> >> >  MP4Box -cat file1_audio.mp3  -cat file2_audio.mp3  out.mp3
>> >> >
>> >> >  MP4Box -add out.mp3 -add out.h264 out.mpg
>> >> >
>> >> > What am I doing wrong?
>> >>
>> >> You need to pass the correct -fps value to MP4Box, which by default uses 25fps
>> >
>> > Umm, the recordings _are_ 25fps...
>>
>> And I'm supposed to know that how?
>
> Oh, sorry ;-)
>
>> There must be some other problem..
>>
>> What kind of sync problem? Does it start right away or does it
>> gradually build up over time?
>
> At the start is is OK, but after a while it gets out of sync. Then sync
> gets better again, then worse again, and so forth.
>
>> If this doesn't work, you can always try it with ffmpeg instead of
>> mencoder. Just use multiple -i option, eg
>> ffmpeg -i file1.avi -i file2.avi ...
>>
>> and copy audio and video with -acodec copy -vcodec copy
>
> So now I tried
>
>  ffmpeg -acodec copy -vcodec copy -i file1.avi -i file2.avi out.avi
>
> but here I get only the first file, the second seems to be ignored.

That's because the -i option must always come first! ;)

>
> Seems to be a really hard to join avi files :-(
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>


More information about the MEncoder-users mailing list