Cut, (partial) delete and lossless export of MP4 videos ALWAYS possible?
An enhanced version of the original VirtualDub
Brought to you by:
shekhjkl
Assume I load a *.mp4 video , then delete some parts out of it (with cut points at keyframes).
Then at last I export the remaining video as "Stream Copy".
Is this saved video somehow re-encoded or always lossless saved?
Or does it depend from the video/codec audio used in the MP4 container?
What about videos in deatil with H.264 AVC video codec and MP3 audioo codec?
Anonymous
Direct stream copy doesn't work on Caching Input driver which is necessary to open non AVI files. So you won't be able to preserve original compression file. (Actually caching input can direct copy some ALL-I codecs like Lagarith and uncompressed WAV). You can try using MP4Cam2AVI which will losslessly transform your MP4 to AVI and then open the AVI with AudioVideoInterlace Driver which will allow you to Direct Stream Copy both audio and video, although seeking is not always exact on h264 with that driver.
Maybe Avidemux is able to directly do it without converting the MP4.
Ok, thank you.
However I am still confused.
I tried to find an answer by trying it out.
So I load a *bigger .mp4 video file with H.264 AVC and MP3 codecs then cut (=deleted) 2 tiny intervals from the middle . Finally I exported the remaining 98% of the video with StreamCopy.:
It took approx. 1 to 2 seconds.
1 or 2 seconds?
If I would really re-encode the whole video it would last 20 minutes!
So export as StreamCopy must be (almost) lossless.
Or how would you explain this short export time otherwise?
Please check your output video to see what happened.
An mp4 is always loaded with caching input driver (because traditional VD AVIdriver can't open non AVI files). Caching Input doesn't do DSC for h264/mp3. If you don't select a compression codec, output will be uncompressed video and audio. That can be very fast if you use an SSD hard drive, file size will be BIG though. I prefer lossless Lagarith for intermediate stages which is fast and 1/4 of the uncompressed size. Freeware MP4Cam2AVI will let you open your video with AVIdriver which will allow DSC it.
Last edit: isidroco 2020-05-05
Hi, see the description https://sourceforge.net/p/vdfiltermod/wiki/direct_copy/
export->stream copy is lossless (except it does not preserve all SEI VUI and other metadata) bu it has limitations, cant apply timeline edits.