Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: AVCHD-video (.MTS) to AVI, fast and easy way

  1. #11
    Join Date
    Feb 2008
    Beans
    157
    Distro
    Ubuntu Development Release

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Huh, now that seems tricky one!
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

  2. #12
    Join Date
    May 2009
    Beans
    2

    Talking Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Just wanted to say THANK YOU so much for posting this. I was using another program (mts2avi or something like that). I should've been using mencoder all along.

    I had the same sync problem and this post solved it.... this is great!

    Also, for bash users you can go through a directory with the following:

    #!/bin/bash
    for file in *.MTS
    do
    outfile=${file%.MTS}.avi
    echo $file " " $outfile
    mencoder $file -o $outfile -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 60000/1001 -vf scale=1280:720
    done
    You can do more I suppose... make a processed directory and put the MTS files there and an output folder to put the .avi files with something like this after the mencoder command:

    mv $file processed
    mv $outfile avi
    Thanks again!

  3. #13
    Join Date
    May 2009
    Location
    Finland
    Beans
    9
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    I've recently been trying to play with AVCHD video on Linux out of my Sony HDR-SR7 camera.
    I also tried that mts2avi script, without much success. Using mencoder directly seems to work much better.

    Quote Originally Posted by citybird View Post
    gave this a go under 64 bit Ubuntu 8.10:

    Code:
    user@mycomputer:~/Videos$ mencoder 00009.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1280:720
    MEncoder 2:1.0~rc2-0ubuntu17+medibuntu1 (C) 2000-2007 MPlayer Team
    
    [ ... snip snip, extra stuff removed ... ]
    
    [h264 @ 0xe28200]PAFF interlacing is not implementedb  A-V:0.006 [0:0]
    Segmentation fault
    user@mycomputer:~/Videos$
    Any advice on the seg fault?
    I ran into the same issue, more or less. I found out I had to manually download and compile mplayer (& mencoder which comes with it), apparently the current mediubuntu-provided version does not work.
    The version of mencoder from svn that I've compiled and which works is SVN-r29289-4.3.3.

    See the first post of this thread for how to compile mplayer... You will need at least the build-essential and subversion packages installed (maybe others too). Also, it's not absolutely necessary, but probably a good idea to remove the mplayer package before doing the compile.

    I also had issues with mencoder giving errors of "Too many video packets in the buffer:" and audio getting out of sync, these were solved by adding "-demuxer lavf" to the mencoder line.

    Hope this helps!
    Last edited by Wizzu; May 11th, 2009 at 06:07 AM.

  4. #14
    Join Date
    Sep 2007
    Location
    Cergy, France
    Beans
    6
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    I am facing a different problem - compilation issue.

    When I checkout the latest version of mplayer. ./configure works fine, but when I run make, I get the errors below after about 10 minutes of compilation (I have build-essential installed).

    Can asomeone please tell me what I'm doing wrong here? (Incidentally I'm running a 32 bit version of Ubuntu 9.04)

    Error dump:

    Code:
    cc -DHAVE_AV_CONFIG_H -I.. -I.. -Wundef -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I.  -D_REENTRANT    -c -o lcldec.o lcldec.c
    lcldec.c:50:18: error: zlib.h: No such file or directory
    lcldec.c:70: error: expected specifier-qualifier-list before 'z_stream'
    lcldec.c: In function 'zlib_decomp':
    lcldec.c:131: warning: implicit declaration of function 'inflateReset'
    lcldec.c:131: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:132: error: 'Z_OK' undeclared (first use in this function)
    lcldec.c:132: error: (Each undeclared identifier is reported only once
    lcldec.c:132: error: for each function it appears in.)
    lcldec.c:136: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:137: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:138: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:139: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:140: warning: implicit declaration of function 'inflate'
    lcldec.c:140: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:140: error: 'Z_FINISH' undeclared (first use in this function)
    lcldec.c:141: error: 'Z_STREAM_END' undeclared (first use in this function)
    lcldec.c:145: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:147: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:150: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c: In function 'decode_init':
    lcldec.c:544: error: 'Z_NO_COMPRESSION' undeclared (first use in this function)
    lcldec.c:544: error: 'Z_BEST_COMPRESSION' undeclared (first use in this function)
    lcldec.c:580: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:580: error: 'Z_NULL' undeclared (first use in this function)
    lcldec.c:581: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:582: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:583: warning: implicit declaration of function 'inflateInit'
    lcldec.c:583: error: 'LclDecContext' has no member named 'zstream'
    lcldec.c:584: error: 'Z_OK' undeclared (first use in this function)
    lcldec.c: In function 'decode_end':
    lcldec.c:609: warning: implicit declaration of function 'inflateEnd'
    lcldec.c:609: error: 'LclDecContext' has no member named 'zstream'
    make[1]: *** [lcldec.o] Error 1
    make[1]: Leaving directory `/home/akash/mplayer/libavcodec'
    make: *** [libavcodec/libavcodec.a] Error 2
    akash@lenovo:~/mplayer$

  5. #15
    Join Date
    May 2009
    Location
    Finland
    Beans
    9
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Quote Originally Posted by akashiii View Post
    Can asomeone please tell me what I'm doing wrong here? (Incidentally I'm running a 32 bit version of Ubuntu 9.04)

    Error dump:

    Code:
    cc -DHAVE_AV_CONFIG_H -I.. -I.. -Wundef -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I.  -D_REENTRANT    -c -o lcldec.o lcldec.c
    lcldec.c:50:18: error: zlib.h: No such file or directory
    .....
    Looks like you're missing zlib headers (at least). Check to see if you have the zlib1g-dev (or zlib1-dev) package installed, as well as zlib1g (or zlib1). You might be missing other -dev packages too that mplayer requires to compile, this being just the first of such error that you run into. If that's the case, check the mplayer documentation for a list of required packages (software) to build. build-essential is not enough in itself for mplayer, it just means you can build software in general.

    I would imagine configure is meant to handle this stuff and complain if something required is missing, strange that it doesn't.

  6. #16
    Join Date
    Sep 2007
    Location
    Cergy, France
    Beans
    6
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Thanks a lot, Wizzu. As configure went smoothly without complaining, I was wondering if I had messed up somewhere. Anyway, including zlib1g-dev did the trick.

    For the benefit of those who might run into this, you will need build-essential, subversion and zlib1g-dev for compilation to succeed (on a clean Ubuntu Jaunty install).

    Code:
    sudo apt-get install build-essential subversion zlib1g-dev
    Cheers!

  7. #17
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Thank you all for the great solution! I found using m2ts2avi a bit strange and never got the results I wanted. Basically the sound was gone/deformed and the picture was totally mashed. With this everything is in sync and well done Thanks!

  8. #18
    Join Date
    Feb 2009
    Location
    UK
    Beans
    83
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    I think I have been trying to solve the same problem using ffmpeg - without much success - you can read about my efforts here

    Have tried the mencoder commands and am getting the same segmentation error.

    Code:
    [h264 @ 0xe271a0]MBAFF + spatial direct mode is not implemented
    [h264 @ 0xe271a0]concealing 3060 DC, 3060 AC, 3060 MV errors
    Pos:  20.2s   1013f (100%) 14.92fps Trem:   0min  25mb  A-V:0.020 [10002:448]
    Flushing video frames.
    Writing index...
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
    
    Video stream: 10002.628 kbit/s  (1250328 B/s)  size: 25281643 bytes  20.220 secs  1013 frames
    
    Audio stream:  448.000 kbit/s  (56000 B/s)  size: 1134336 bytes  20.256 secs
    Segmentation fault
    I am using MEncoder 2:1.0~rc2-0ubuntu19 on 64bit Ubuntu 9.04

    I have tried to follow uhappo's instructions to install mplayer & mendocer from svn and build from source. But I haven't built software form source before and I can't seem to get this to work.

    Could someone jot down an idiots step by step guide to doing this - or point me in the right direction. Do I need to remove the installed mplayer first? Where should I make and install the new version on my system - my home directory? Where do I put the codecs uhappo linked to (http://www.mplayerhq.hu/design7/dload.html)?

    Thanks!

  9. #19
    Join Date
    Apr 2009
    Beans
    11

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    I am getting the same errors as mashedbear:

    [h264 @ 0xe271a0]MBAFF + spatial direct mode is not implemented
    [h264 @ 0xe271a0]concealing 3060 DC, 3060 AC, 3060 MV errors

    Any help would be much appreciated!

  10. #20
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: AVCHD-video (.MTS) to AVI, fast and easy way

    Can someone here explain to me these "duplicate frame(s)!" errors? I googled the error messages, but I lack the technical knowledge and I can't understand them.

    Thank you.

    Code:
    zombie@ubuntu:~/Videos$ mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1280:720
    MEncoder SVN-r29851-4.4.1 (C) 2000-2009 MPlayer Team
    success: format: 0  data: 0x0 - 0x26adc800
    TS file format detected.
    VIDEO H264(pid=4113) AUDIO A52(pid=4352) NO SUBS (yet)!  PROGRAM N. 1
    FPS seems to be: 29.970030
    [V] filefmt:29  fourcc:0x10000005  size:0x0  fps:29.970  ftime:=0.0334
    Input fps will be interpreted as 50.000 instead.
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    Using SSE optimized IMDCT transform
    Using MMX optimized resampler
    AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
    Selected audio codec: [a52] afm: liba52 (AC3-liba52)
    ==========================================================================
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 0
    Opening video filter: [scale w=1280 h=720]
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
    ==========================================================================
    audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=32000 sample-1)
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect..000 [0:0]
    [swscaler @ 0xa280310]BICUBIC scaler, from yuv420p to yuv420p using MMX2
    videocodec: libavcodec (1280x720 fourcc=34504d46 [FMP4])
    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.0s      3f ( 0%)  0.00fps Trem:   4min  77mb  A-V:0.004 [0:0]
    1 duplicate frame(s)!
    Pos:   0.0s      4f ( 0%)  0.00fps Trem:   4min  77mb  A-V:0.006 [0:0]
    1 duplicate frame(s)!
    Pos:   0.1s      5f ( 0%)  0.00fps Trem:   4min  77mb  A-V:0.008 [0:0]
    1 duplicate frame(s)!
    Pos:   0.1s      6f ( 0%)  0.00fps Trem:   4min  77mb  A-V:0.006 [0:0]
    1 duplicate frame(s)!
    Pos:   0.1s      7f ( 0%)  0.00fps Trem:   5min  77mb  A-V:0.006 [0:0]
    1 duplicate frame(s)!
    Pos:   0.1s      8f ( 0%)  0.00fps Trem:   5min  77mb  A-V:0.008 [0:0]
    1 duplicate frame(s)!
    Pos:   0.1s      9f ( 0%)  0.00fps Trem:   6min  77mb  A-V:0.010 [0:0]
    1 duplicate frame(s)!
    Pos:   0.2s     11f ( 0%)  0.00fps Trem:   7min  91mb  A-V:0.014 [0:0]
    1 duplicate frame(s)!
    [h264 @ 0xa27f8a0]left block unavailable for requested intra mode at 0 16
    [h264 @ 0xa27f8a0]error while decoding MB 0 16, bytestream (24406)

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •