VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 69
Thread
  1. I have been beta testing the new and soon to be open source Lightworks NLE and trying to find a way of helping people to convert from AVCHD MTS to a format that it can handle. Lightworks can currently handle AVCHD in QuickTime containers but not MTS. I found a way of re-wrapping MTS to mp4 using Mediacoder but it doesn't work consistently so I am looking for a more reliable method.

    But even if users do succeed in re-wrapping their files, they don't always play back smoothly in Lightworks except on the most powerful PCs (although long GOP performance is on the developers' roadmap). Intra-frame codecs like MPEG I-frame HD are much easier to work with. Lightworks uses the Matrox VfW codecs and can transcode to MPEG I-frame HD on import. So what some people have been doing is re-wrapping MTS to mp4 and then transcoding to MPEG I-frame on import into Lightworks

    I am looking for a way to

    a) re-wrap from mts to mp4 or mov.

    b) transcode from mts to MPEG I-frame HD in an AVI container.

    I have been searching the forum for a way of doing the latter and I found various threads dealing with conversion from MTS to other formats. I found this thread on converting from MTS to MPEG I-frame but in an m2v container. I tried changing mkv to avi in the MPEG I-frame bat file and it did indeed create an avi file. However, when I imported it into Lightworks, the video was black.

    I would grateful for any suggestions.
    Last edited by shaunthesheep; 26th May 2011 at 12:35.
    Quote Quote  
  2. MPEG in AVI is very unusual but: VirtualDub + ffdshow
    Also look at AviDemux.
    Last edited by jagabo; 26th May 2011 at 12:35.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    MPEG in AVI is very unusual but: VirtualDub + ffdshow
    Also look at AviDemux.
    As I understand it, Virtualdub is a Video for Windows app and can't open MTS files. Correct me if I am wrong. How exactly does ffdshow fit in?

    Lightworks at the moment has a limited range of supported codec/container combinations. It just so happens that it supports MPEG I-frame SD and HD in an AVI container (using the Video for Windows Matrox codecs).

    Lightworks is scheduled to become open source in the summer 2011. It isn't OS yet and until it is, common GPL style licensed toolkits and libraries are not an option. At the same time proprietary libraries have to be removed/replaced before it is Open Sourced. Which leaves the current chain of beta releases with a very small choice of external libraries.
    Last edited by shaunthesheep; 26th May 2011 at 12:48.
    Quote Quote  
  4. if lightworks accepts avchd re-wrapped in mov, then you can use ffmpeg (you don't need ffmbc)

    ffmpeg -i input.m2ts -vcodec copy -acodec copy output.mov

    do some quick tests, if this works for lightworks, you can write a batch script


    matrox vfw codecs are free, you can access it through vdub or any NLE based on vfw framework
    http://www.matrox.com/video/en/support/windows/vfw_software_codecs/downloads/softwares/version1.0/

    to load avchd into vdub, you can use avisynth to frameserve
    Quote Quote  
  5. The MTS files I am dealing with have ac3 audio which needs to be transcoded to aac. Only the video is re-wrapped. Sorry, should have made that clear. We have come across a long standing bug in FFMPEG which has created problems doing this.

    See this thread in the Lightworks forum.
    Last edited by shaunthesheep; 26th May 2011 at 13:44.
    Quote Quote  
  6. why is aac required or even preferred ? it's lossy format

    or is this a lightworks issue ?

    why not uncompressed ?



    if you're copying the avc video stream, you're still going to have performance issues (I doubt lightworks is optimized for decoding/performance of avc streams)

    why not something like dnxhd ?
    Quote Quote  
  7. Not sure. Just guessing but isn't AC3 proprietary (Dolby)? Lightworks is currently being stripped of proprietary code and libraries prior to being released as open source.

    As I said earlier, Lightworks long GOP performance improvement is on the development roadmap. My quad core PC struggles to play back AVCHD in Lightworks (though it plays OK in VLC). MPEG I-frame HD plays much better with little loss in quality.

    So what I have been doing is re-wrapping MTS video to mp4 and transcoding ac3 to aac, Then transcode to MPEG I-frame HD on import into Lightworks.
    Last edited by shaunthesheep; 26th May 2011 at 14:03.
    Quote Quote  
  8. Yes AC3 is Dolby, but DEcoding AC3 is not a problem for GPL or opensource , free software. Even ENcoding AC3 is free and legal with aften without a license

    But AAC audio has licensing issues, and ffmpeg cannot be distributed with it. (If you compile it yourself from the sources, it's ok). ffmpeg's AAC audio encoder is very low quality compared to nero's or even FAAC, so you probably wouldn't want to use it anyway


    I would use uncompressed audio

    ffmpeg -i input.mts -vcodec copy -acodec pcm_s16le output.mov



    If you still get performance scrubbing issues for the video, try something like DNxHD. (you can encode through ffmpeg as well, there are links and instructions in that thread you linked to in the 1st post)


    If you still have problems, then use the matrox mpeg2 i-frame suggested earlier through vdub and avisynth.
    Quote Quote  
  9. The FFMPEG string produces a mov file of only 121 kB that obviously won't play.
    Quote Quote  
  10. I just tried it on an AVCHD clip and it worked for me . It even opens in quicktime

    upload a sample clip from your camera (what model) . If it's <30MB you can upload directly here, otherwise use a free hosting site e.g. mediafire.com, sendspace.com etc...


    So what I have been doing is re-wrapping MTS video to mp4 and transcoding ac3 to aac, Then transcode to MPEG I-frame HD on import into Lightworks.
    If you end up taking this route - you don't need these intermediate formats, you can go directly to MPEG2 I-frame with avisynth/vdub


    Presumably, once you settle on a format and workflow, you would want to batch everything (E.g. convert all the videos in a folder), not sit and wait to convert things 1 by 1. FFMPEG is easy to setup batch scripts because it work with command line. There are avisynth and vdub batch workflows as well , but they take extra steps
    Quote Quote  
  11. Many thanks for your help. I really do appreciate it.

    Still no joy. I tried it with another AVCHD file from another camera with exactly the same result

    Let me just check that I am doing the right thing.

    I have an AVCHD file named tom.mts in a folder with ffmpeg.exe. I create the following string in a text file in the same folder:

    ffmpeg -i tom.mts -vcodec copy -acodec pcm_s16le tom.mov

    I save the text file with this string and rename the file extension to .bat.

    Click on the bat file and a mov file is created named tom.mov but it is only 161.kB in size.

    I am used to using Virtualdub but AVISynth (which I have on my system) and frameserving remains a mystery to me (I have a vague idea what it is but that is all). I am just reading about it now elsewhwere on the site to re-fresh my memory. I think it is absence of a GUI that is the problem with AviSynth.

    Here is one of the AVCHD files at Sendspace.
    Last edited by shaunthesheep; 27th May 2011 at 03:36.
    Quote Quote  
  12. Here are MediaInfo results for the two AVCHD files.

    General
    ID : 0 (0x0)
    Complete name : C:\Users\username\Desktop\avchd_conversion_batchfi les\tom.mts
    Format : BDAV
    Format/Info : Blu-ray Video
    File size : 326 MiB
    Duration : 2mn 37s
    Overall bit rate : 17.3 Mbps
    Maximum Overall bit rate : 18.0 Mbps

    Video
    ID : 4113 (0x1011)
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Format settings, GOP : M=1, N=26
    Codec ID : 27
    Duration : 2mn 38s
    Bit rate mode : Variable
    Bit rate : 16.2 Mbps
    Maximum bit rate : 16.0 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Bits/(Pixel*Frame) : 0.312
    Stream size : 305 MiB (93%)

    Audio
    ID : 4352 (0x1100)
    Menu ID : 1 (0x1)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Codec ID : 129
    Duration : 2mn 38s
    Bit rate mode : Constant
    Bit rate : 448 Kbps
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Side: L R, LFE
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Delay relative to video : -80ms
    Stream size : 8.44 MiB (3%)



    General
    ID : 1 (0x1)
    Complete name : C:\Users\username\Desktop\Lightworks\Video samples\Stefan MTS\00076.MTS
    Format : BDAV
    Format/Info : Blu-ray Video
    File size : 75.0 MiB
    Duration : 39s 786ms
    Overall bit rate : 15.8 Mbps
    Maximum Overall bit rate : 18.0 Mbps

    Video
    ID : 4113 (0x1011)
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Format settings, GOP : M=1, N=24
    Codec ID : 27
    Duration : 39s 760ms
    Bit rate mode : Variable
    Bit rate : 14.9 Mbps
    Maximum bit rate : 16.8 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Bits/(Pixel*Frame) : 0.288
    Stream size : 70.7 MiB (94%)

    Audio
    ID : 4352 (0x1100)
    Menu ID : 1 (0x1)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Codec ID : 129
    Duration : 39s 872ms
    Bit rate mode : Constant
    Bit rate : 256 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Delay relative to video : -80ms
    Stream size : 1.22 MiB (2%)

    Text
    ID : 4608 (0x1200)
    Menu ID : 1 (0x1)
    Format : PGS
    Codec ID : 144
    Duration : 39s 296ms
    Delay relative to video : -80ms
    Quote Quote  
  13. I tried using the Windows command prompt to run the FFMPEG string to see if it shed any light on why it was not working. I navigated to the directory where the files were and this is the result (see below).

    Several people at the LIghtworks forum have tried using FFMPEG commands to convert mts files to mp4 or mov (see link in earlier post for an example) and they always get this same error: [mov @ 018355e0] Application provided invalid, non monotonically increasing dts
    to muxer in stream 0: 1 >= 1


    One of the Lightworks forum users looked into it and apparently it is down to a long standing bug in FFMPEG.


    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\user>cd desktop

    C:\Users\user\Desktop>cd avchd_conversion_batchfiles

    C:\Users\user\Desktop\avchd_conversion_batchfiles> ffmpeg -i tom.mts -vcodec cop
    y -acodec pcm_s16le tom.mov
    ffmpeg version git-N-30172-g3c20c0e-Sherpya, Copyright (c) 2000-2011 the FFmpeg
    developers
    built on May 24 2011 03:24:39 with gcc 4.2.5 20090330 (prerelease) [Sherpya]
    libavutil 51. 2. 1 / 51. 2. 1
    libavcodec 53. 6. 0 / 53. 6. 0
    libavformat 53. 2. 0 / 53. 2. 0
    libavdevice 53. 0. 0 / 53. 0. 0
    libavfilter 2. 10. 0 / 2. 10. 0
    libswscale 0. 14. 0 / 0. 14. 0
    libpostproc 51. 2. 0 / 51. 2. 0

    Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1)
    -> 50.00 (50/1)
    Input #0, mpegts, from 'tom.mts':
    Duration: 00:02:38.08, start: 1.000033, bitrate: 17306 kb/s
    Program 1
    Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:
    9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.2[0x1200]: Subtitle: pgssub
    Output #0, mov, to 'tom.mov':
    Metadata:
    encoder : Lavf53.2.0
    Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31,
    25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Press [q] to stop, [?] for help
    [mov @ 018355e0] Application provided invalid, non monotonically increasing dts
    to muxer in stream 0: 1 >= 1

    av_interleaved_write_frame(): Invalid argument

    C:\Users\user\Desktop\avchd_conversion_batchfiles>
    Last edited by shaunthesheep; 27th May 2011 at 06:26.
    Quote Quote  
  14. Well, the "normal" prebuilt ffmpeg binaries can convert AVCHD from other cameras, but they seem to have problems with your clip. It just might be that particular snapshot/date. Certain versions might work better than others

    ffmbc works on it however

    it you want to make a batch file (I would test 1 or 2 clips in lightworks before converting a whole bunch)

    for %%a in ("*.mts") do ffmbc -i %%a -vcodec copy -acodec pcm_s16le %%~na.mov
    pause


    But I'm willing to bet editing performance in lightworks is going to be slow, even worse so if it's using quicktime API to decode these
    Quote Quote  
  15. The error has been present with several AVCHD MTS files from different cameras that we have tried to convert. It is a known FFMPEG bug. See here and here.

    This is what one of the Lightworks forum users says about it:
    "I investigated this error a bit and found there is a long lasting bug in FFMpeg itself. Any command which contains '-vcodec copy' or '-acodec copy', executed on a file coded with H.264/AC-3 ends up with 'non monotone timestamp' error message. It's well documented in the Web and officially reported as a pending bug. It's pending since years, so I guess it's a very low priority for FFMpeg devs. So any converter based on FFMpeg is unsuitable here."
    Given that for the time being at least AVCHD is not going to play back to well in Lightworks unless you have a top of the range CPU, I think it would make more sense to convert to MPEG I-frame HD.

    Is there an FFMBC binary for Windows? The one I cam across appears to be for Linux and needed compiling.

    EDIT

    I have found the FFMBC for Windows.
    Last edited by shaunthesheep; 27th May 2011 at 10:29.
    Quote Quote  
  16. Well it definitely works with ffmbc on your test clip, even QT opens it up , and the "normal" ffmpeg definitely works on several AVCHD clips from other cameras I tested (mostly Canons)

    Did you test it ? Some NLE's have optimized AVCHD playback and support (e.g. Edius) , and even on "average" hardware AVCHD plays back smoothly. Maybe it's in the development schedule for lightworks ?

    Another option might be a proxy workflow, to edit at lower res, then swap back in the high quality version on final render. If those mov wrapped videos are accepted, that could be your online version. FFMPEG could be used to generate batch proxies as well. Most NLE's have some form of offline workflow where you just right click and they swap back in the high quality version
    Quote Quote  
  17. To generate batch scripts or batch proxies, "Khaver" has made some GUI's that do this. I think v1.6 is the latest if you scroll down the page in the link below

    There are included pdf instructions, screenshots in the zip file

    http://www.hv20.com/showthread.php?25044-Batch-Intermediate-Creation-Utilities/page4


    So you might use batch avs creator to generate your avs scripts then vdub to batch encode your Matrox AVI files. There are several tools and tutorials to help batch work in vdub as well, search for "virtualdub batch" on google
    Quote Quote  
  18. I have just downloaded FFMBC and managed to get convert a mov file that plays OK in VLC. Just testing with Lightworks...

    EDIT

    The converted mov imports into Lightworks but there is no sound. Visual playback is a still image. I transcoded to MPEG I-frame HD on import and the video plays OK but with no sound.

    I am just wondering if QuickTime for Windows can handle PCM audio? I don't even know if it can handle AC3--that was why we converted to aac with Mediacoder. The original audio in the file I am testing is 5.1 surround sound. The converted mov is stereo audio. Is there a command to keep the 5.1 audio in the converted file?
    Last edited by shaunthesheep; 27th May 2011 at 11:05.
    Quote Quote  
  19. It works in Quicktime for Windows here, audio & video

    Your file you uploaded was stereo, and the converted file is stereo

    I am using ffmbc 0.6rc6



    Do you know how lightworks parses mov ? Does it use the quicktime framework or libav ?

    "pcm_s16le" gives you PCM little endian or "SOWT" . This is completely compatible with quicktime

    There are other types of uncompressed audio that you could try, but some of them are not compatible with QT


    EDIT:
    I just tested AVCHD 5.1 clip from a Sony camera, and it works with 5.1 PCM audio as well. QT sees 6 channels
    Last edited by poisondeathray; 27th May 2011 at 11:11.
    Quote Quote  
  20. I pointed out VirtualDub and ffdshow earlier because VirtaulDub can open most files with the right source plugin. You can also use AviSynth to open any file with the right plugins. VirtualDub can save as AVI as you requested. ffdshow can encode for VirtualDub and has the ability to save as MPEG 2 with all I frames (in AVI). Short GOPs and IP frames only might be better though.
    Quote Quote  
  21. I don't know how Lightworks parses mov. I will ask the devs on the Lightworks forum and report back.
    Quote Quote  
  22. Well some NLE's have moved away from quicktime (because it's horrible software and full of bugs) - the newest versions of Premiere and Vegas no longer use QT API to decode .mov , and are much more stable because of it

    If lightworks is moving to opensource, then chances are it will use libav like blender, and it should be able to import other formats (it should be essentially ffmpeg based)

    I tested one of the early releases of lightworks... and it was just a mess. Definitely should not have been released as beta for public. I might test it again once it gets developed a bit more.

    Another format you should try is DNxHD


    I don't know how picky you are, but my concern about Matrox MPEG2 AVI is there is an intermediate RGB conversion. This causes clipping of superbrights/superdarks Y" <16, Y' >235 as the RGB conversion adheres to Rec601/709. The control panel allows some options, but you cannot encode through vdub keeping Y'CbCr (there is an error). If you don't "fix" the levels or adjust them to "legal range" before your conversion, you lose that data . And I couldn't find a CLI interface or any other way to encode without that incurring that intermediate conversion. It's the same thing if you use it through an NLE like vegas or premiere. Even when functioning in Y'CbCr mode, there is evidence that exported file has undergone an intermediate RGB conversion
    Last edited by poisondeathray; 27th May 2011 at 11:29.
    Quote Quote  
  23. Lightworks is in a transitional state as I mentioned earlier. It is being stripped of proprietary code but because it is not yet open source it cannot use GPL libraries either.
    Quote Quote  
  24. I have just installed the FFDshow plugin for Virtualdub but it still does not open mts files.
    Quote Quote  
  25. you need haali splitter, and the vdub directshow input driver

    use preferred filter tweaker on win7 to use ffdshow

    to activate the driver, you need to select it from the drop down menu with the open as dialog box

    more reliable way is avisynth
    Quote Quote  
  26. Originally Posted by shaunthesheep View Post
    I have just installed the FFDshow plugin for Virtualdub but it still does not open mts files.
    Install the Directshow source filter. Or use an AviSynth script to open the file for VirtualDub.
    Quote Quote  
  27. Mediainfo reports that the converted mov file has 6 audio channels yet when I import it into Lightworks it has only 2. There is some audio "noise" when I play it back in but it is just occasional and faint--nothing like the actual audio,
    Quote Quote  
  28. Could you give me a link for the Directshow source filter please--I can't locate it on the web.
    Quote Quote  
  29. Short sample of MPEG2 in AVI from MTS source. Via Haali + VirtualDub (DS source plugin) + ffdshow.
    Image Attached Files
    Quote Quote  



Similar Threads