VideoHelp Forum
+ Reply to Thread
Results 1 to 30 of 30
Thread
  1. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Hello all!

    I am cutting up bits of m2ts videos (AVCHD Lite: H264, 1280x720, 50.0FPS) shot on a Lumix DMC-TZ10 point 'n' shoot camera using Avidemux 2.6.8 (x64). Using default settings, all I do is set point A and B on the timeline. I am then saving the output as 'copy' both video and audio format - the decoder is 'lavcodec', the output format AVI muxer. My understanding is that no recoding takes place and a new AVI container is provided.

    I use WMP12 for playback and it turns out that the new AVIs generated are sped up somewhat (say 1.2x even though both input and output is 50fps). Why would this be?

    NB: no filters, such as 'change FPS' were used..

    Many thanks for any help!
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Might be because AVCHD lite isn't really 720p50 , it's 720p25 with a frame repeat flag. WMP might be getting confused

    Did you try another player? like MPCHC, or VLC, or Potplayer ?

    Did you try another container in avidemux, like MKV or MP4 ?
    Quote Quote  
  3. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Hi Poisondeathray

    Just installed MPCHC and it turn out that input is fine, output is still sped up. So its either the input file or Videoremux...

    Am reading up about AVCHD Lite and 'frame repeat flag' (thanks!)..

    Is it possible that Avidemux does not handle these files too well? Hopefully there's a workaround..
    Quote Quote  
  4. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    ps: trying other containers.
    Quote Quote  
  5. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    yes , avidemux can be a bit buggy, it might be having problems with avchd lite. Make sure you're cutting on keyframes (use the "<<" and ">>" buttons in the GUI to navigate before marking in/out)

    you can also try tsmuxer, but it cuts by timecodes (no preview), but it should preserve the frame repeat flag
    Quote Quote  
  6. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    ok, other containers are not applicable or do not save correctly. Transcoding seems ok (tried mpeg4 avcx264), but of course editing now takes time. Hmmm..
    Quote Quote  
  7. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    avidemux can be very buggy at times. I was just playing with an avchd lite sample and it seems to mangle it. I guess you can't complain too much with freeware.

    Re-encoding isn't ideal, because you incur quality loss unless you use a lossless codec (huge filesizes), and you lose quality again when re-encoding to the final lossy format. Conversely, stream copying is faster, no quality loss

    ffmpeg seems to be able to copy segments out fine, but it's commandline usage only , no preview

    Note none of these free tools are frame accurate - they only cut on I-frame boundaries. If you're looking at something precise you need a smart editor that re-encodes the few frames around a cutsite if it's no on an I-frame boundary eg. videoredo, solveigmm video splitter . If it's something you're going to be doing frequently you might want to have a look at one of the trials
    Quote Quote  
  8. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Have just tried tsMuxeR and unfortunately it gives me the same problem. At least this tells me the input file's to blame. Any idea how I could tackle cutting Panasonic AVCHDLite video without transcoding?

    Many thanks for your help ans suggestions!
    Quote Quote  
  9. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    ^ ok, cross-posts! Thanks for your ideas!
    Quote Quote  
  10. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    hmmm tsmuxer worked ok on a sample from a Lumix TZ7, it was a "60p" sample (30p with frame repeat flag) .

    ffmpeg worked ok here too. To use ffmpeg you need to specify a start time -ss and duration -t . e.g. copy a segment from 1min to 1min30sec for a duration of 30sec

    Code:
    ffmpeg -i input.mts -c:v copy -c:a copy -ss 00:01:00 -t 00:00:30 output.ts

    But maybe something else is peculiar about your camera or files ?
    Last edited by poisondeathray; 28th Jul 2014 at 17:13.
    Quote Quote  
  11. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    By the way, I used the "old" stable tsmuxer 1.10.6. The newer version pops up with error messages

    You can find old versions archived here
    http://www.videohelp.com/tools/tsMuxeR/old-versions#download
    Quote Quote  
  12. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Did you experience a 'sped up output' with Avidemux?

    Just looking into the paid software you mentioned and reading up about key and i-frames... Will try ffmpeg tomorrow GMT.

    edit: .. and try the older tsmuxer version instead of 2.6.12 too
    Quote Quote  
  13. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by skylla2014 View Post
    Did you experience a 'sped up output' with Avidemux?
    It was choppy/glitchy and audio was cutting in/out . It wasn't "sped up" per se . But the sample I tested was from another camera, and "NTSC" spec (60Hz) not "PAL" spec (50Hz)

    Your initial description made me think that your player was ignoring the frame repeat flag. That means it plays back at 50fps, but with only "25FPS" worth of frames. But if that were the case it would play at exactly 2x speed, not 1.2x speed
    Quote Quote  
  14. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    btw, what is the best way to extract information from a video file? i.e. whether it has 'repeat frame flags', fps, ratio, audio tyoe, AVCHDLite or other HD format etc?
    Quote Quote  
  15. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    mediainfo (view=>text) can give you some of the information, but it's not always 100% accurate
    Quote Quote  
  16. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    In regards to the new fps of the output file, I played back at 0.5x using MPC-HC. Video is indeed fine (confirming ignoring 'repeat flag' in AVCHDLite might indeed be the issue) - of course audio is now dreadfull!
    Quote Quote  
  17. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    ok, will post back tomorrow. G'day!
    Quote Quote  
  18. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Did the original, uncut ,native files play ok in MPCHC on your system ?



    Without a doubt, "AVCHD Lite" is only 25p (or 30p) with the frame repeat flag. Thats is 100% certain because that's in the specs. The marketing "geniuses" call it 720p50 or 720p60 because it sounds better and might sell more cameras

    That 0.5x speed is suspicious number, and it suggests that the frame repeat flag might have something to do with it. If the software completely ignores the flag, and plays back at the proper framerate of 25 fps, then everything is ok. But if it ignores the flag, and "thinks" it's a 50p file, then you get the double speed playback

    If you check in mediainfo, it will call it "frame doubling" in the frame mode entry

    Code:
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.0
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 1 frame
    Frame mode                               : Frame doubling
    Last edited by poisondeathray; 28th Jul 2014 at 17:51.
    Quote Quote  
  19. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Sorry for my absence; work took over!

    * The original uncut files play ok in MPCHC and other videoplayers.

    * I have not been able to try VideoRedo or Solveigmm as trial versions that I installed over a year ago have expired.

    * Media Info of input file (Pana AVCHDLite):
    Code:
    Format                                   : BDAV
    Format/Info                              : Blu-ray Video
    File size                                : 154 MiB
    Duration                                 : 1mn 33s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 13.9 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                   : No
    Format settings, ReFrames                : 1 frame
    Frame mode                               : Frame doubling
    Format settings, GOP                     : M=1, N=13
    Codec ID                                 : 27
    Duration                                 : 1mn 33s
    Bit rate mode                            : Variable
    Bit rate                                 : 13.1 Mbps
    Maximum bit rate                         : 16.6 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.570
    Stream size                              : 146 MiB (95%)
    * Media Info of clipped output file (Avidemux default settings):
    Code:
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    File size                                : 36.0 MiB
    Duration                                 : 11s 460ms
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 26.4 Mbps
    
    Video
    ID                                       : 0
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.0
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 1 frame
    Frame mode                               : Frame doubling
    Format settings, GOP                     : M=1, N=13
    Codec ID                                 : H264
    Duration                                 : 11s 460ms
    Bit rate mode                            : Variable
    Bit rate                                 : 25.9 Mbps
    Maximum bit rate                         : 16.6 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 50.000 fps
    Original frame rate                      : 25.000 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.563
    Stream size                              : 35.4 MiB (98%)
    So, the two things I notice are:

    * both videos are in NTSC format [would this really matter?]

    * the 'double frame rate' flag has NOT disappeared in the output file but the FPS is now 50 (25 in original).


    I'll mull this over and see what else I can find out.
    Quote Quote  
  20. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Note - Mediainfo isn't always correct - it often misreports (it should say "PAL", but it's not really "PAL" either, as that more appropriately applies to SD)

    Avidemux is probably reading the field rate, not the frame rate, you would need to force it to 25 fps . That didn't occur with the 29.97p "AVCHD Lite" (or fake 59.94) sample I cut - it didn't become 59.94 so it wasn't sped up - but it botched other things like the audio. I used avidemux 2.6.4. I see there is a 2.6.8 version I see now it might work better or worse. Avidemux can be very flaky/buggy. Certain versions work ok others crap out

    If the cut file is otherwise fine, you can force the framerate in something like mkvtoolnix if you don't mind mkv container (it's better for h.264 anyway)
    Quote Quote  
  21. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Dear Poisondeathray. Thanks for the suggestion of the MKVtoolnix. I can indeed change the FPS to 25 of the avidemux output file, but (as yet) am not sure the audio stretch of 2 has the desired (i.e normal) result I'm after.

    BTW if I rewrap my avchd input to an MKV container I can no longer use Avidemux to clip these files (it is impossible to set A and B, or scroll fwd etc).


    As I'm trying to keep my work flow as simple as possible (there are A LOT of AVCHDLite files to go through!), I was wondering whether to rewrap or correct (if that's the word) all my panasonic avchd input files in batch manner - that's before I start clipping with Avidemux. Is there such a tool that could do that - ffmpeg for instance?

    Once again, many thanks for your help.
    Quote Quote  
  22. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    You don't have to change the audio in mkvtoolnix , you can change the framerate of the video only

    It should be possible to edit MKV in avidemux , it might be something buggy with that version

    What did you want to batch re-wrap to ? MP4? MKV ?

    From the commandline as a batch command
    Code:
    for %a in ("*.mts") do ffmpeg -i %a -c:v copy -c:v copy %~na.mkv
    pause

    If you want to do it as a batch file, you need to replace each "%" with "%%"

    If you want MP4, change the MKV extension to MP4
    Quote Quote  
  23. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    hmmm, I had to stretch the audio, because the audio stopped exactly halfway playback of the mkv file (it's difficult to check whether the audio is ok or not as it's just windnoise in my test file - I don't have my other avchd files at hand here on my work computer).

    Will report back over the coming week.
    Quote Quote  
  24. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    So, a few things I have found out over the last days:

    ** Avidemux is pretty amazing when it comes to quickly cropping home videos on I-frames without recoding.

    ** Forcing the framerate to 25 fps should solve the problem (but haven't found out how to do this for the original file without rewrapping).

    But why is this so?

    What I have found out from wrapping the AVCHDLite m2ts files to the MKV container (using MKVtoolNix), cutting in avidemux and back to m2ts file (using tsMuxer) for cropping in Avidemux...

    ... is that the AVCHDLite file should have the framerate in the wrapper set at 12.5 fps for cropping and outputting in AVI (or other formats) in Avidemux to work! This indicates that information in the wrapper is incorrect or incorrectly read by Avidemux (and other software) resulting in not doubling of the fps, but quadrupling of the fps during playback..

    Not too sure if that makes sense!
    Quote Quote  
  25. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Another one you can try is xmediarecode . It has a GUI that can preview & cut . It worked ok on some AVCHD Lite clips I tested . Set the format to m2ts and extension to .ts , and set video & audio to "copy" .
    Quote Quote  
  26. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    proof:

    INPUT:

    Code:
    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.0
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 1 frame
    Frame mode                               : Frame doubling
    Format settings, GOP                     : M=1, N=13
    Codec ID                                 : 27
    Duration                                 : 31s 180ms
    Bit rate mode                            : Variable
    Bit rate                                 : 13.2 Mbps
    Maximum bit rate                         : 16.6 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.571
    Stream size                              : 49.0 MiB (94%)
    > convert to mkv
    > crop
    > convert back to m2ts


    OUTPUT:

    Code:
    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.0
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 1 frame
    Frame mode                               : Frame doubling
    Format settings, GOP                     : M=1, N=13
    Codec ID                                 : 27
    Duration                                 : 14s 760ms
    Bit rate mode                            : Variable
    Bit rate                                 : 13.2 Mbps
    Maximum bit rate                         : 16.6 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 12.500 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 1.147
    Stream size                              : 23.3 MiB (95%)
    Recap:

    ** Both input and output play fine in WMP and MPC-HC

    ** Only output file and not the input file can be cropped in Avidemux without changing playback fps of the final output!
    Quote Quote  
  27. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    avidemux has had problems with h264 & transport streams for the longest time. Sometimes it doubles the frame rate by reading the field rate instead of the frame rate

    Give xmediarecode a try, it worked ok cutting some sample AVCHDLite clips from a TZ7 - you have a slightly different model, but they are both from Panasonic so there might be some hope

    BTW - "cropping" in the video world usually refers to cutting in from the sides , ie. the peripheral borders of the video (left, top, right, bottom) - not making edits , like trimming clips with in/out points
    Quote Quote  
  28. Member
    Join Date: Jul 2014
    Location: Edinburgh
    Search Comp PM
    Hi Poisondeathray

    Thanks for keeping up with this and the many suggestions. I'm learning whilst moving along!

    -Avidemux is not the only software I have had the problem with, so it could be both the container and executing software I guess.

    -The filters for the input in Avidemux only work when something is selected from the dropdown unfortunately. Otherwise I could enforce 25fps (which works, but recoding takes place..)

    -Just installed Xmedia and it looks great! Many options indeed. Unfortunately the playback does not show in the window. This looks like a graphics card (i have two on this laptop) incompatibility with the software.

    -Trying a trim (thanks for pointing out the correct terminology) without visual clues... works! output plays at expected fps, amazing.

    Is there a way to cut at an I frame as in Avidemux?

    Thanks!
    Quote Quote  
  29. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    This is actually my 1st time using it - I was testing it out for another thread

    With the video selected, isn't there any preview in the filters/preview tab ?

    It displays the frame type at the bottom, but you cannot navigate by keyframes with push of a button, only frame by frame.

    If all you need is rough cuts, it doesn't matter where you cut, because it will automatically jump to the nearest keyframe anyways. For AVCHD lite , that is about 1/2 sec accuracy


    EDIT: Make sure you close all other video applications before starting the program. Sometimes a video won't display if another app is using some resources like a shared renderer
    Quote Quote  
  30. Member
    Join Date: Nov 2002
    Location: United States
    Search Comp PM
    You might try Free Video Editor but you'll need to be careful when installing it because it will install adware if you let it. Earlier versions of this software were very buggy but the latest version works much better with more options. I have had it cut videos that VideoReDo TV Suite had trouble with. The newest version allows you to make multiple cuts where earlier versions would crash if you tried to make more than one cut.
    Quote Quote