Hi,
I have an MP4 file with Video encoded in H.264/MPEG-4 AVC and audio in mp4a: MPEG-4 AAC LC as reported by GSpot
I need to replace some intial frames and keep the audio.
My workflow is:
1) extract the audio track with mp4box
2) cut the video with avidemux or ffmpeg:
2.1) part1 from initial I-frmae to next I-frame: 13 frames
2.2) part2, the rest (strating from second I-frame)
3) ffmpeg to extract all frames of part1 into images (PNG)
4) replace 6 initial frames by hand
5) Now I need to encode back in H.264 the 13 frames so that I can join the new part1 with original part2. Then create the mp4 with original audio and new video stream
How I can do it?
I tried to use ffmpeg or avidemux to code the 13 PNG files into a mp4 but they both produce a video NOT starting with I-frame, then I have trouble joining it with part2.
I was able to encode images and video with avidemux into XVid.
But I don't want to encode the entire file again: I want to encode the first 13 frames then append the original part2 without re-encoding.
Any suggestion?
Thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
Ok, convert PNGs to BMPs, open/edit in virtualdub, save as uncompressed AVI, convert to MP4 with another app if Avidemux fails to do so and then join the 2 clips, with MP4Box if Avidemux fails.
-
If you use x264 encoder to encode h264 , it should always begin the sequence with an IDR frame (as should any sequence using commonly used formats like xvid, mpeg2, etc..). The problems joining are probably from audio not matching (e.g. sample rate), or video specs not matching (e.g. frame rate), and not because lack of an I-frame. Use mediainfo or avinaptic for more information
I don't think this is the cause of you problem, but you can also specify exact frame types (e.g. I,B,P) with a qpfile. Some of the GUI's do not support this, so you find one that does (e.g. megui), or use commandline. -
Thank you so much for your replies!
The problem I mentioned in joining the two parts is caused by the "badly" converted part 1.
From the 13 images Avidemux produces an MP4 file starting with a P-frame followed by an I-frame.
I don't know why, I was expecting to have I-frame as first!
Anyhow I'll try with BMP->VirtualDub->Mp4Box
Bye -
Would you mind uploading the sequence ("badly" converted part 1) and listing what version of avidemux you are using? It might be a bug in that avidemux version.
If the conversion failed, all conversions using the software you mentioned should act the same, because they are all based x264 (unless it's specific to that libx264 build of that avidemux version)
Similar Threads
-
Replacing part of a DVD with black frames?
By Killer3737 in forum EditingReplies: 2Last Post: 26th Dec 2011, 22:19 -
MP4 with H264,AAC cutting and replacing frames
By eymerich in forum EditingReplies: 18Last Post: 14th Dec 2009, 12:36 -
Cutting 20 ms audio frames
By TrupsT in forum AudioReplies: 1Last Post: 31st Aug 2008, 23:21 -
cutting a few frames from an avi
By tommid in forum Newbie / General discussionsReplies: 7Last Post: 17th Oct 2007, 18:52 -
Cutting bad frames with VirtualDubMod
By lazaruz in forum EditingReplies: 2Last Post: 18th Sep 2007, 03:39