Page 1 of 3 123 LastLast
Results 1 to 10 of 30

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

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

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

    EDITED FOR LATEST INFO

    I just tried this again on a new install, 9.10 64-bit.

    1.
    Code:
    sudo apt-get install build-essential subversion zlib1g-dev
    2.
    Code:
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
    cd mplayer
    ./configure
    make
    sudo make install
    Then, just do it (this command does not downscale the picture)
    Code:
    mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1920:1080
    There's also another variation, a bit higher quality but about 3 or 4 times larger file size.. There's no point, actually, but anyway (if someone knows how to make video quality ALMOST identical but with smaller file size, let us know...)
    Code:
    mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2 -fps 50 -vf scale=1920:1080
    This script just works, just follow the commands above and you should be good with it!

    And then converting the whole directory:

    Code:
    sudo apt-get install csh
    Make a file, name it convert and place it in /bin -folder. Then open the convert-file and put the stuff in it:
    Code:
    #!/bin/csh
    
    # For NTSC change -fps 50 tp -fps 60000/1001 below
    
    foreach f ($*)
       mencoder $f -o ${f:r}.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1920:1080
    end
    Allow the file to execute as a program. Now, just go to your .MTS-folder and write
    Code:
    convert *.MTS
    See all your files converting...

    ORIGINAL POST

    You probably don't need the codecs, but here they are anyway. Try first without them
    http://www.mplayerhq.hu/design7/dload.html

    Next
    Code:
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
    ./configure
    make
    make install
    Then
    Code:
    mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1280:720
    This did change a .MTS-file, made with Sony DCR that outputs 1920x1080p-video, to 1280x720- AVI-video. I appears in your home folder. Nice and easy, and FAST! I had a 3,1gig MTS-video that lasted about 30 minutes. Transform took 60 minutes and resulted video was 1gig.

    No more hazzles, this just works.
    Last edited by uhappo; January 27th, 2010 at 12:41 PM. Reason: Typo
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

  2. #2
    Join Date
    Dec 2005
    Location
    Atlanta, GA. USA
    Beans
    56
    Distro
    Ubuntu 9.04 Jaunty Jackalope

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

    This is something that I have been looking for, thank you. Worked like a champ!


  3. #3
    Join Date
    Dec 2005
    Location
    Atlanta, GA. USA
    Beans
    56
    Distro
    Ubuntu 9.04 Jaunty Jackalope

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

    uhappo:

    I am ahving an issue with the audio / video sync:

    I have .mts files I'm converting frm my AVCHD JVC Everio cam.

    Original files are like 1920

    Your stuff is working, but the audio sync is just off, the audio is ahead from the video, is there an easy way to tweak that?

  4. #4
    Join Date
    Nov 2007
    Beans
    210

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

    Quote Originally Posted by TVMA View Post
    Your stuff is working, but the audio sync is just off, the audio is ahead from the video, is there an easy way to tweak that?
    A guess here: uhappo has -fps 50, since you appear to be in the US, you probably have a NTSC camera with a real frame rate of 29.97 (30000/1001), so you should use -fps 60000/1001. (Omitting the fps altogether is equivalent to specifying 25 or 50).

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

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

    Hello!

    Sorry for late reply, I was on the road..

    So, about your problem. First, I had no idea how to help you, but this came to my mind:

    I live in Europa, you in USA. Europa = PAL, USA = NTSC.

    So, we have different frame per second-rates, PAL 25 and NTSC 30. Could be possible that PAL is 50 and NTSC 60 fps, I'm not that good with this, but anyway.

    So, my bet is just change the script a bit
    Code:
    mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 60 -vf scale=1280:720
    That should do it!
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

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

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

    Quote Originally Posted by jtappin View Post
    A guess here: uhappo has -fps 50, since you appear to be in the US, you probably have a NTSC camera with a real frame rate of 29.97 (30000/1001), so you should use -fps 60000/1001. (Omitting the fps altogether is equivalent to specifying 25 or 50).
    Haha, you were a bit faster, and a bit more precise.
    Code:
    mencoder 00001.MTS -o 1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 60000/1001 -vf scale=1280:720
    Should be the ticket
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

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

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

    By the way, what would be the best way to mod this script so it could convert all .MTS-files in that folder, in the same process? So I could just leave it on and it takes care of the whole package?
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

  8. #8
    Join Date
    Nov 2007
    Beans
    210

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

    Quote Originally Posted by uhappo View Post
    By the way, what would be the best way to mod this script so it could convert all .MTS-files in that folder, in the same process? So I could just leave it on and it takes care of the whole package?
    How about:
    Code:
    #!/bin/csh
    
    # For NTSC change -fps 50 tp -fps 60000/1001 below
    
    foreach f ($*)
       mencoder $f -o ${f:r}.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=10000 -fps 50 -vf scale=1280:720
    end
    In bash it would be a little harder as it doesn't have the :r modifier. Then if you've saved it as avc_conv you could use:
    Code:
    avc_conv *.MTS
    Or any other appropriate glob.

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

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

    Wuhuu!!!

    Thanks, jtappin!
    My PC
    Ubuntu user from 18.2.2008
    Oh, my studio and my band

  10. #10
    Join Date
    May 2007
    Beans
    55

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

    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
    CPU: Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz (Family: 6, Model: 15, Stepping: 6)
    CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.
    success: format: 0  data: 0x0 - 0x12b8800
    TS file format detected.
    VIDEO H264(pid=4113) AUDIO A52(pid=4352) NO SUBS (yet)!  PROGRAM N. 1
    [V] filefmt:29  fourcc:0x10000005  size:0x0  fps: 0.00  ftime:=0.0000
    Input fps will be interpreted as 50.00 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: 1
    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)
    [h264 @ 0xe28200]PAFF interlacing is not implemented
    [h264 @ 0xe28200]concealing 3060 DC, 3060 AC, 3060 MV errors
    VDec: vo config request - 1440 x 1080 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 7 -> 6
    SwScaler: reducing / aligning filtersize 7 -> 6
    [swscaler @ 0xe20930]SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX2
    [swscaler @ 0xe20930]SwScaler: using 8-tap MMX scaler for horizontal luminance scaling
    [swscaler @ 0xe20930]SwScaler: using 8-tap MMX scaler for horizontal chrominance scaling
    [swscaler @ 0xe20930]SwScaler: using n-tap MMX scaler for vertical scaling (YV12 like)
    [swscaler @ 0xe20930]SwScaler: 1440x1080 -> 1280x720
    videocodec: libavcodec (1280x720 fourcc=34504d46 [FMP4])
    Selected font is fixed-width.
    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.
    [h264 @ 0xe28200]PAFF interlacing is not implementedb  A-V:0.000 [0:0]
    [h264 @ 0xe28200]top block unavailable for requested intra mode at 14 1
    [h264 @ 0xe28200]error while decoding MB 14 1, bytestream (29439)
    [h264 @ 0xe28200]illegal short term buffer state detected
    [h264 @ 0xe28200]concealing 6120 DC, 6120 AC, 6120 MV errors
    [h264 @ 0xe28200]PAFF interlacing is not implementedb  A-V:0.002 [0:0]
    [h264 @ 0xe28200]concealing 3060 DC, 3060 AC, 3060 MV errors
    [h264 @ 0xe28200]PAFF interlacing is not implementedb  A-V:0.004 [0:0]
    [h264 @ 0xe28200]concealing 6010 DC, 6010 AC, 6010 MV errors
    
    1 duplicate frame(s)!
    [h264 @ 0xe28200]PAFF interlacing is not implementedb  A-V:0.006 [0:0]
    Segmentation fault
    user@mycomputer:~/Videos$
    Any advice on the seg fault?

Page 1 of 3 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
  •