cmd:GOPchop 

Basic Info 

Usage 

Info 

gopchop - MPEG2 GOP-accurate editor

Description 

This tool is used for people wanting to take sections out of MPEG2-PS files without re-encoding the resulting frames. The idea is to write specific "Group of Pictures" (GOP) sections to a new MPEG2-PS file. These GOPs will decode correctly (in theory), and the gaps won't be noticed.

Comments 

I wrote this tool to edit commercials out of MPEG2 files produced by my KFir MPEG2 capture card. Using this tool for anything else is really beyond the scope of its design.

This is a *LOSSY* process on MPEGs that have open GOPs. To close a GOP, I must toss B-Frames at the start of a GOP. If you were to mark each frame in an MPEG for splicing in gopchop, you would end up with fewer frames than you started with. To "close" an open GOP, I must toss those B-Frames. To stop this behavior, uncheck the "Drop Orphaned Frames" option in the "Preferences" window.

Help 

Using gopchop 

The basic way to use gopchop is like so:

  1. Run gopchop.
  2. Select an MPEG2 with "File / Open".
  3. Drag the slider to the first GOP you want to have in a clip. (You can disable "Edit / Preferences… / Auto Refresh" to seek faster, and then click "Refresh" to see where you are in the file.)
  4. Click "Start Mark".
  5. Drag the slider to the last GOP you want in the clip.
  6. Click "End Mark". (If you drag the slider somewhere before the first mark, "End Mark" will not do anything.)
  7. Repeat steps 3 through 6 to select all the clips you want saved.
  8. Drag clips up and down to reorder them in the Clip List window.
  9. To delete unwanted clips, select it, and hit Del or Backspace.
  10. Save the clips to a new MPEG2 with "File / Export".

If you want to save different clips, select "Edit / Clear" and start over at step 3. If you want to use a different source MPEG2, select "File / Close" and start over at step 1.

How it works 

I scan the MPEG2 for a full list of System packets, then examine the Program Element Stream packets they contain. In the video PES, I look for GOP headers (and Picture headers). Each GOP is then mapped back to the System packets that contain it (a full GOP can span multiple VES packets, and multiple System packets). When a GOP is saved to a new file, the entire System packet list for that GOP is written as a byte-for-byte copy from the source MPEG2. In theory, this will take any audio streams along for the ride. So far, so good. :)

In the "Info" box, the "Offset" column shows the system packet offset (for GOPs) and the video packet offset (for Pictures). The "Bytes" column lists the bytes contained by all the system packets (for the GOP), and all the video packets in a Picture. You'll notice that the Offset plus the Bytes don't add up to the next Picture's Offset. This is because there is stuff between the video packets. :) The GOP "Bytes" and "Offset", however, should add up to the next GOP's "Offset" value.

The settings under the "Preferences" window are automatically saved to ".gopchop/options" in your home directory.

Version 1.1.7 

Installation 

dpkg -i /linux/linux_bin/deb-pkgs/gopchop_1.1.7-1_i386.deb; debfoster

converting mpeg to mpeg for DVD 

http://www.videohelp.com/forum/archive/t281705.html

> Back in Linux, I use gopchop to edit out the commercials. GOP-level editors
> are nice in that you don't need to reencode your edits. I save each segment
> to a separate mpeg, because I found if I combined them, I'd get sync issues
> later on. These separate files will simply become "chapters" on the dvd.

dvbcut is very good at chopping pieces out of .mpg files AND retaining audio-video sync. It can also splice between key frames. It is a very simple interface/gui. While what it does is limited - what it does do, it does extremely well.

oldcpu posted 2006 Aug 18

converting mpeg to mpeg for DVD 

> Can it save the segments without reencoding the video? That's the main
> reason I'm using gopchop. The video wil get resized and reencoded in
> mplayer, so I want to avoid transcoding more often than necessary

yes.

oldcpu posted 2006 Aug 22