VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Oct 2006
    Location
    Norway
    Search Comp PM
    Hi

    I have a vb6 program that controls winamp for playback and now I would like to extend this program to also handle the work of cutting out a clips from mpeg-2 video files. Today I do this manually by opening the files in TMPGEnc and cut out the part I want there.

    What I'm looking for is a program that supports either API or commandline so that I can pass a starttime and stoptime to that program and have it create a new mpeg-2 clip for me.

    Anyone who could guide me in the correct directions?

    </Morten>
    Quote Quote  
  2. A while back I wrote simple command-line-based programs in C that could read and write uncompressed video files. Of course MPEG will be tougher but not out of the question I wouldn't think. The specifications for MPEG files would be the starting point. Once you can read/write MPEG files it would be a simple matter to build on top of that programs that can manipulate the video in straightforward ways, such as trimming between a start and stop frame/time. I could do that for uncompressed video in less than an hour now that I have the read/write capability. Of course for MPEG it will have to limit the cut points to key frames (between GOPs).

    EDIT: Just saw Mats' post, looks like that will get you there sooner!
    Quote Quote  
  3. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    There's a newer MPGTX in the following Zip file:

    http://www.kaashoek.com/comskip/files/comclean_0_0_6.zip
    Quote Quote  
  4. You can also try Mpeg2Cut2. It's more stable as mpgtx. But actually it depends on what you want to do with the cut file. Proper cutting is a rather complicated task for mpeg files.
    Quote Quote  
  5. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    I love using Mpg2cut2, but I don't think it can cut via command line - can it ?
    Quote Quote  
  6. Changelog / Version history:
    Latest Revision:-__ 17 SEPT 2006 _- Build 6917
    ...
    _ Option to pass FROM and TO selection points via parameter.

    I haven't tried it yet, but it sounds like a commandline cut option...

    EDIT:
    I just had a short look in the help file:
    IGCUTTER

    At this stage the parameter interface for IGCutter
    is very basic and limited, for experimental use only.

    Because the new parameter format is not 100% backwards compatible,
    the new mode must first be enabled via the Mpg2Cut2 menu.
    MENU - MISC - EXPERIMENTAL - Parm With Time Codes.

    File names with imbeeded spaces MUST now b enclosed in quotes.
    EG "C:\My Documents\FRED.MPG"

    At this stage, proper functioning is limited to Mpeg2 files that
    fall within the following restrictions :-

    - Only 1 input file at a time.
    - Mpeg-2 format only, NOT Mpeg-1.
    - Progam Stream only. NO Transport Streams, No Elementary Streams.
    - PTS must be locked to SCR at SEQ/GOP boundaries,
    as is normal for DVD format.
    This means some DTV captures may NOT be acceptable.
    - SCR must not reset within the file.
    IE It must always increase, never decrease.
    This meams PANASONIC DVD recordings are NOT acceptable at this time.


    MPG2CUT2 does NOT check that the restrictons are being adhered to,
    as the interface is still very experimental.

    Parameter format :-

    "input-file-name" FROM-hh:mms.ff TO=hh:mms.ff O="output-file-name" xxx

    All parameters are optional, except for the input-file-name,
    which MUST be the FIRST parameter.

    FROM= defaults to start of file
    TO= defaults to end of file

    The user will be presented with a File-SaveAs dialog,
    which allows the output name to be overriden.

    xxx = Time Code Style
    ABS = Absolute
    REL = Relative (default)

    Time codes can omit the hour, minute and frame numbers,
    where they are zero. Seconds MUST be pesent, even when zero.

    EG FROM=30 is the same as FROM=00:00:30.00 (30 seconds)

    Please note the the frame number portion is preceeded
    with a DOT, not a Colon, as it specifies a fraction of a second.
    BUT is it NOT a decimal fraction - it is a frame number.

    EG: 30.5 = 30.05 = 30 seconds plus 5 frames.

    Time Codes are by default expected to be RELATIVE SCR values,
    a common convention in players that show time codes.

    EG FROM=30 means 30 seconds from the start of the file,
    even if the first SCR on the file is NOT ZERO.

    If you want to eliminate the conversion to relative time,
    specify the keyword parameter ABS (Absoloute).
    Time codes must then match the actual SCR time stamps.
    Quote Quote  
  7. Member
    Join Date
    Oct 2006
    Location
    Norway
    Search Comp PM
    Originally Posted by mats.hogberg
    CLI tool: mpgtx

    /Mats
    Excellent! Now I'm cutting and slicing all over...

    Thanks!
    Quote Quote  
  8. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Thanks for the info, Borax
    Quote Quote  



Similar Threads

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