Combine/split mpeg2 files

Randy Pratt rpratt1950 at
Sun Jun 15 18:58:04 PDT 2003

I'm probably approaching this wrong or using the wrong tools for the
job.  Maybe someone could nudge me in the right direction.

My objective is to recombine and resplit some mpeg2 files to fit on 
700M CDR's.  Typically, the original files would look like this:

	file-part1.mpg	799M
	file-part2.mpg	500M

I've tried two approaches.  The best result from a viewing standpoint
was obtained with the second trial.

First Trial:
mpgtx -j file-part1.mpg [0:00.0-] file-part2.mpg [0:00.0-] -o joined.mpg

When playing the joined.mpg, there is a "green flash" in the video at
the joining point and these messages appear on the console:

  @@@ libmpeg2 returned from sig11... (bad file?) @@@  79% 46% 15.0% 1010 0 0%
  @@@ libmpeg2 returned from sig11... (bad file?) @@@
  @@@ libmpeg2 returned from sig11... (bad file?) @@@
  A:2584.6 V:2559.3 A-V: 25.349 ct:  4.534  1764/1761  81% 46% 15.5% 1050 0 0

The timer (OSD seek mode) correctly displays the position in the
video at any point.

When trying to split the joined.mpg, messages like these start 
appearing on the console:

  39.17%  PACK: TS <0, corrected to 0, movie will have problems playing!

Of course, these messages correspond to the point where the two 
original files were combined but the split segments play fine (with 
the exception of the annoying "green flash" at the original joining

How would I remove the annoying "green flash"?

Second Trial:
I used "cat" to combine the two files.

  cat file-part1.mpg > joined.mpg
  cat file-part2.mpg >> joined.mpg

This joined.mpg played very well with no "green flash" or console
errors.  The timer/position displays the correct total time, but
it "resets" to 0:00:00/01:11:09 when it reaches the joining point.

I suspect this is what causes the console messages when trying to
split the joined.mpg file.

  mpgtx -s joined.mpg {675M}

At the point were the two original files were joined, tons of 
these messages display until the splitting is completed:

  PES01: TS <0, corrected to 0, movie will have problems playing!
  PACK: TS <0, corrected to 0, movie will have problems playing!

However, the movie plays fine and the timer/position will display
correctly unless I try to jump forward or backwards which causes
the timer/position to reset to 00:00:00.0/00:33.42 .

Is there any way to correct the indexing?

Any other approaches or suggestions would be most appreciated.



More information about the freebsd-multimedia mailing list