VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Jul 2009
    Location
    Italy
    Search Comp PM
    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
    Quote Quote  
  2. Banned
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  3. 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.
    Quote Quote  
  4. Member
    Join Date
    Jul 2009
    Location
    Italy
    Search Comp PM
    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
    Quote Quote  
  5. 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)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!