View Full Version : Cutting and Splicing MPEG Video
makoto916
7th May 2004, 01:45
In a nutshell, what I'm trying to do is fade in and out an MPEG-2 video source by only reencoding the part of the video being modified thereby preserving the majority of the video quality.
I've got an elementary stream of mpeg video that I've extracted using vStrip. I split the first and last 90 seconds of video using MPEGtx leaving me with three chunks of video.
I then create an AVISynth script to fade the video in using the first 90 frame chunk, then another script to fade out using the last 90 frame chunk.
The problem comes when I try to convert the scripts back to MPEG and splice the three chunks back togther. Despite the fact that QuENC has the same bitrate settings as the unmodified video chunk, MPEGtx complains that the video is incompatiable. If I force it to join anyway the final video has nasty anomalies at the splice point.
Obivously I can get around this by just reencoding the entire file, but I'd perfer not do that. Is there a way to encode MPEG using the specs from an existing MPEG file? Or am I tring to do the impossible?
you can try a easy way with womble mpeg vcr
http://www.womble.com/vcr-text.htm
take a look:
MPEG-VCR
The Womble MPEG-VCR is a software video editor that performs all editing on MPEG data with frame accuracy. It supports all MPEG-1 and MPEG-2 bit streams, including MPEG-2 Transport streams for HDTV. Its major features are list below.
Frame accurate editing: step forward and backward through your video, frame-by-frame, to find exactly the scene you want, or to cut out the ones you don't.
Fastest scrubbing of any MPEG2 editor: Scroll through your entire movie as fast as your mouse can drag the slider. Quickly find the scenes you want to keep, or the ones you want to cut.
Fastest frame stepping of any MPEG2 Editor. Move through your video frame-by-frame at the click of your mouse, or the press of a key. Makes it super easy to zero-in on exactly the desired frame to be edited.
No re-encoding when editing DVD-compliant MPEG2 captures from the latest USB/DVD capture boxes. When using these sources to create a movie for DVD burning, you will not have to wait for many hours while your movie is re-encoded. Instead, your edited video will be written back to disk as fast as any disk-to-disk copy operation.
maybe it help you...welcome in forum makoto916. :)
makoto916
7th May 2004, 04:07
you can try a easy way with womble mpeg vcr
In a word, wow. A very nice product. I tend to gloss over the GUI stuff and go right for the command line so this product was completely off my radar. It does precisely what I need, albiet I can't use my batch files which makes me sad, but I'll get over it. :D
The first file I attempted worked great with only an increase of around 300k in filesize. But for some reason WMP gets 5 seconds into the file and locks. Strange but I'm sure I'll figure out why and work around it.
Thanks for the information!
welcome in forum makoto916.
Thanks for the welcome!
only my personal taste: i like too much of Gabest Media Player Classic:
http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358
Gabest MPC is small and precise,...the normal(normal?)wmp always give me problems! :)
makoto916
7th May 2004, 06:16
only my personal taste: i like too much of Gabest Media Player Classic:
I completely agree... unfortunately others in my company need to view this media and, despite my best intentions, I could never wrestle WMP from them. ^_^
One thing that perplexes me is how this program is treating the video. If I do a fade-in and tell it to export, it causes WPM to bomb yet it plays perfectly to TV on my Netstream 2000 board. If I demultiplex the file first - either using the built-in demultiplxing tool or via BBDMux - apply the fade-in and export, it works fine in WMP but causes crazy anomalizes when played on the Netstream 2000. But yet, if I remultiplex the audio back in the file now causes WMP to bomb.
Very odd indeed. I have to believe its some kind of header problem but this program doesn't let me tweak very much in order to troubleshoot the issue.
I'll keep digging.
EDIT: I figured out how to work around the anomalies inroduced by this program to achieve what I needed. So here's what I did in case anyone else runs into this issue.
First, I demultiplexed the file into elementary streams.
Then, I cut the video file into three seperate chunks and exported them seperately.
Following that, I added the fade-in filter to the first chunk, exported, then did the same with the fade-out filter for the last chunk.
Finally, I joined them all together, exported again and the multiplexed the origional audio with the final video.
By not doing that preciesly it would cause the Cyberlink MPEG-2 Decoder (bundled with PowerDVD) to freeze WMP 5 seconds into the file. It would also cause random MPEG anomalies when played back on the Sigma Designs Netstream 2000. Fortunately, by following that exact procedure, it produced a file that works.
Sweet. ^_^
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.