VideoHelp Forum
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. Hi, I just received my new Cam Panasonic HDC-SD700. Nice picture, easy to use, etc..
    But once I try to merge (join) some MTS file to one, I detect a audio delay INCREASING with the number of files merged, in the resulting file . I am using the tool TsMuxeR (1.10.6).
    I use this tool for my Pana DMC-TZ7, Sony CX11, with NO problem ! Resulting file is nice !
    After trying many posibility: de-mux, re-mux,.. and many tools: emic MTS converter, mpeg edit ultimate, multiAVCHD, SUPER, TSDemux,...
    I finaly suspect that the Panasonic MTS file is NOT correct : audio stream is longuer than the video stream (video is N frame, audio is N+1 frame)
    So I get around 40ms delay increasing for each MTS file joined (for 10 files, I get 400ms delay !!!!!)

    I would like to avoid converting to other format (keep quality AND 5.1 sound). I do some test with Vegas 9, Corel XP, AVS, converting time is looooonnnnggg and 5.1 sound is lost or not working !

    Any body have a solution or idee with this Pana MTS bugy files ??

    Thanks to all
    Marc
    Quote Quote  
  2. Thanks Baldrick!
    I will try this afternoon!
    I will also try avidemux, mkvtoolnix and elecard AVCHD.

    Regards
    Quote Quote  
  3. Hooops !
    To the videohelp moderator or administrator: the title is ....SD700... (not 70)
    Thanks
    Quote Quote  
  4. I try Elecard AVCHD editor and it seem to work fine with MTS files of Panasonic SD700 !
    http://www.elecard.com/products/products-pc/consumer/avchd-editor/

    This editior is very simple and do juste what I need : merging (joining) MTS files.
    But !
    I try with 8 MTS files (5min video, 500mb), time: 20 min to join
    I try with 20 MTS files (50 min video, 4.5gb), time: 24h and is not finished !!!
    Also, you have to manualy drag and drop each MTS file in the editor to get correct order ! else files are mixed.
    So, still need some improvement for this software!

    I keep you informed..
    Marc
    Quote Quote  
  5. I have an SD60...and same problem...audio is longer than video by 2-3 frames. I've spent a month trying to find a solution for simple joining...Here is what I do...

    Join and remux to mkv...1st using tsdemux to join and generate the timecode file (I use excel to prepare the sequence and run the command line)...then dump everything to mkvmerge which uses the timecodes to sync...and play in wdtvlive without problem...this is my work flow for viewing at home. For simple joining, I found no other way with free tools...

    However, FFMPEG doesn't like this MKV...so if I want to do a DVD...I batch convert the MTS files first using FFMPEG...I demux the MTS then encode with FFMPEG using the "-shortest" param to cut short the audio...then join the MPEG using tsmuxer...again using excel to prepare the sequence...however, the new mpeg file still has minor out of sync...so I have to demux it and run the AC3 through audacity to shrink the audio...and then remux the new AC3 back...slightly convoluted but ti works...

    If you want to keep to the mts...you can use xport to get info on frame count...use the frame info to calc the duration...use tsmuxer to trim...then use tsmuxer again to join...then demux using tsmuxer and get the frame count...then shrink the AC3 as above and remux it back...

    NLE editors that uses the video timecode and smart-rendering should work for quick join without problem...editors that snap to longest stream will get you 2 blank frames on every join...

    Hope these helps.
    Last edited by dwRK; 27th Jul 2010 at 05:41.
    Quote Quote  
  6. Whaou !
    Thanks alot for this help !
    I will try it ASAP

    Up to now I was using Sony Vegas 9 to assemble... but to long and re-converting !

    Best regards
    Quote Quote  
  7. glad to help.

    my latest preference...keep the mts/m2ts...since ffmpeg accepts this...so...xport->excel->tsmuxer(trim)->tsmuxer(join)...I just joined 160+ files with perfect sync...

    also i use batch files and macro to simplify tasks...

    fyi...no need to demux, shrink ac3 and remux...for some reason the trim now works...probably user error before...


    p/s...i saw somewhere that sony and others got this problem also...so is not a panasonic only issue...
    Last edited by dwRK; 3rd Aug 2010 at 03:27.
    Quote Quote  
  8. Thanks again for your help

    I am litle confused concerning each step !

    1) use FFmpeg to xport ?
    2) excel ?
    3) tsmuxer (command line, not GUI ?) with trim option
    4) tsmuxer with join option

    Do you have short exemple of your batch(s) file(s)

    Regards
    Marc
    Quote Quote  
  9. sorry for the confusion. what i meant to say is that joining the files using this 3rd method...the resulting mts/m2ts files can be encoded using ffmpeg...

    i have hundreds of files to do, so i use batch files and command lines instead of gui. you can use gui for a few files...here you go for the batch files...


    step 1. use xport to get number of frames. 1st "for" command dumps xport output to info1.txt. 2nd "for" command cleans up and dump the file name and number of frames/fields to info2.txt. 3rd "for" displays it in the console for checking. i run this .bat file in the same directory with the .mts. it can take some time to run if you have lots of files or files are long...try with a few short ones...

    Code:
     
    @echo off
    del info1.txt
    del info2.txt
    for %%a in (*.mts) do for /f "usebackq skip=27 delims=," %%s in (`c:\apps\av\xport\xport -phs %%a 1 1 1`) do echo %%a %%s >> info1.txt
    for /f "usebackq skip=2 tokens=1-5" %%f in (`find "coded pictures = " info1.txt`) do echo %%f %%j >> info2.txt
    for /f "tokens=1-2" %%g in (info2.txt) do echo %%g %%h
    pause

    step 2. open info2.txt and copy the filename and frame/field info into excel cell A17 and then text-to-column. i use excel macro to generate the meta files for tsmuxer. it also generates the batch file for cutting. you can work backwards from the macro what goes where in the excel sheel. note that the directory must include "\" at the end. also I use the cells for debugging...hence the codes are a bit sloppy...also there are extra bits not normally used...sorry...


    Code:
     
    Sub dw_cut()
    Dim progdir, metadir, metaname, sourcedir, outputdir, batname As String, starttime, endtime, retval As Integer
     
    Sheets("cut").Select 
    Range("A17").Select
     
    progdir = Range("B3").Value 'e.g., c:\apps\av\tsmuxer\tsmuxer.exe
    metadir = Range("B4").Value 'e.g., c:\apps\dwvid\temp\
    sourcedir = Range("B5").Value
    outputdir = Range("B6").Value
     
    Application.ScreenUpdating = False
     
        Do Until Selection.Offset(0, 0).Value = ""
     
            Selection.Offset(0, 2).Value = Selection.Offset(0, 1).Value / 2 'convert fields to frames
            Selection.Offset(0, 3).Value = Selection.Offset(0, 2).Value * 40 'convert to miliseconds
     
            If Selection.Offset(0, 4).Value > 0 Then
                starttime = Selection.Offset(0, 4).Value
            Else
                starttime = 0
            End If
     
            If Selection.Offset(0, 5).Value > 0 Then
                endtime = Selection.Offset(0, 5).Value
            Else
                endtime = Selection.Offset(0, 3).Value
            End If
     
            Range("c8").Value = "MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --cut-start=" & starttime & "ms " & "--cut-end=" & endtime & "ms --vbv-len=500"
            Range("c9").Value = "V_MPEG4/ISO/AVC, " & """" & sourcedir & Selection.Offset(0, 0) & """, fps=25, insertSEI, contSPS, track=4113"
            Range("c10").Value = "A_AC3, " & """" & sourcedir & Selection.Offset(0, 0) & """, timeshift=0ms, track=4352"
            Range("c11").Value = "S_HDMV/PGS, " & """" & sourcedir & Selection.Offset(0, 0) & """,bottom-offset=24,font-border=2,text-align=center,video-width=1920,video-height=1080,fps=25, track=4608"
     
            metaname = "" & metadir & Selection.Offset(0, 0) & ".meta"
     
            Open metaname For Output As #1
                Print #1, Range("c8").Value
                If Range("B9").Value = 1 Then Print #1, Range("c9").Value
                If Range("B10").Value = 1 Then Print #1, Range("c10").Value
                If Range("B11").Value = 1 Then Print #1, Range("c11").Value
            Close #1
     
            Selection.Offset(1, 0).Select
     
        Loop
     
     
            batname = "" & metadir & "runcut.bat"
     
            Range("c13").Value = "for %%a in (*.meta) do " & """" & progdir & """ """ & metadir & "%%a""" & " """ & outputdir & "%%~na.m2ts"""
     
            Open batname For Output As #1
                Print #1, Range("c13").Value
            Close #1
     
            If Range("J4") = 1 Then
                retval = Shell(batname, 1)
            End If
     
    End Sub

    Step 3. run runcut.bat to trim the files...i use a batch file instead of running tsmuxer directly in excel because i want it run one by one...

    Step 4. run fixname.bat to fix the files names...i was lazy to code it properly in excel...so i use this .bat file to fix/revert to the original names...

    Code:
    @echo off"
    for %%a in (*.m2ts) do for /f ""tokens=1-4 delims=."" %%b in (""%%a"") do if %%c == MTS rename %%a %%b.%%c"
    hope these helps...
    Last edited by dwRK; 4th Aug 2010 at 02:27.
    Quote Quote  
  10. Great job !
    I do all. I test with 6 files and I get new files litle smaler.
    I join the new files in a test file for my WDTV box.
    I did not yet test (saterday yes) ...but it sems well gone !

    I just have one issue , I test with 6 files (0038 to 0043), i get only 5 new files (0040 was missing)
    This is the info2:
    00038.MTS 744
    00039.MTS 336
    00041.MTS 2496
    00042.MTS 96
    00043.MTS 264

    and this is the info1:
    00038.MTS coded pictures = 744
    00038.MTS Ending audio to video PTS difference = 2880 ticks
    00039.MTS coded pictures = 336
    00039.MTS Ending audio to video PTS difference = 2880 ticks
    00040.MTS Ending audio to video PTS difference = 2880 ticks
    00041.MTS coded pictures = 2496
    00041.MTS Ending audio to video PTS difference = 2880 ticks
    00042.MTS coded pictures = 96
    00042.MTS Ending audio to video PTS difference = 2880 ticks
    00043.MTS coded pictures = 264
    00043.MTS Ending audio to video PTS difference = 2880 ticks

    is there a problem or bug or other ?

    Thanks again for your help
    Marc
    Quote Quote  
  11. yes...a "bug" on my part...

    if you can use xport to just check your 00040.mts on the cmd line...you should get the coded picture count.

    the error is on "skip=27" in the batch file...try 26 or 25...i wanted to limit the amount of info to capture...so most likely the xport report for 00040.mts has 1 line less and so the info was skipped and not captured in info1...
    Quote Quote  
  12. Member
    Join Date
    Jul 2008
    Location
    Estonia
    Search Comp PM
    Hi dwRK,

    Is there any way to fight that audio delay using tsMuxerGUI, please ? Any possibility to edit meta file etc.

    thanks
    Quote Quote  
  13. Yes...you can trim it in the gui...

    I don't believe it is an audio delay...I think it is just a bit longer...
    Quote Quote  
  14. Member
    Join Date
    Jul 2008
    Location
    Estonia
    Search Comp PM
    Thank you. For me it's to complicated not to use GUI. Do I need to go to DOS PROMPT ?

    PS. AUNSOFT releases FINAL MATE which claim to join .mts file not loosing quality. Gonna try it
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!