VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Looking for a suitable and reliable video editor that joins video clips together with their associated audio content.

    I have several clips encoded via h265 and saved as MP4 container.

    I'm basically rebuilding a video to be identical in length to the original video.

    As an experiment, I tried using Virtualdub2 by using "Appending video segment" option. This procedure using Virtualdub2 only joins the video content and doesn't add the audio content from the clips. Also, it appears that one or more frames from each of the clips are dropped when adding clips to the previous clip!? So by the time I've added all clips, the total number of dropped frames for the finished video is around 20 or more frames!?

    I quickly tried Movavi editor, but it doesn't seem to recognize the clips format!?

    So, I'm looking for a video editor that doesn't drop frames, that allows inclusion of the clips audio content, and the editor should ideally show clip length via a frame counter as well.

    Suggested suitable video editors, please?
    Quote Quote  
  2. If the video and audio codecs are the same for all mp4, then you could try clever Ffmpeg-GUI.
    load the first mp4, click main, click join, drag & drop all other mp4 i one go and click join.
    Done.
    Quote Quote  
  3. Thanks for this useful tip for using the suggested application and for the procedure in using it!

    Unfortunately, it appears a few video clips have a different audio codec used with respect to the remaining majority of video clips. Because of this difference in (audio) codecs I can't add all of the clips to form a completed video.

    Here are the screenshots of the two different audio parts of the video clips as scanned by using MediaInfo.

    For most of the video clips -
    Image
    [Attachment 77385 - Click to enlarge]


    For the few other video clips -
    Image
    [Attachment 77386 - Click to enlarge]


    Not sure how or why there are two different audio codecs used as all of the clips were processed in a fairly similar manner.

    Anyway, it seems some of the video clips will have to have their audio content re-encoded in order to match the remaining video clips audio codec.

    So, how do I go about re-encoding the video clips audio with a different codec?
    Quote Quote  
  4. You may need to normalize your sources (means all using the same encoder and same frame size for video and same encoder for audio) before joining, using a commandline like

    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1280:h=720:force_original_aspect_ratio=decrease,pad=1280/sar:720:-1:-1:color=black" "%~1_normalized.mp4"
    Quote Quote  
  5. Thanks for the information.

    This ffmpeg command looks to me to be a bit difficult to use, as I'm not really familiar with ffmpeg commands at this time. I'll look at this in detail a bit later.

    I've had a look at the "problem" clips with the different audio codecs as well as the principal clips audio codecs.

    The 'problem' clips were cut from the original video using Virtualdub2 and saved in lossless compression avi format. Audio codec used was pcm_f32le format. These cut clips were then processed again via Virtualdub2 and AviSynth to remove noise (using SMDegrain) and the resulting post processed clips were saved again in lossless compression avi format. But now the audio codec has changed to pcm_s16le for some reason!?

    The principle clips were cut from the original video again using Virtualdub2 and again saved in lossless compression avi format. Audio codec used was again pcm_f32le format. Further processing on these principle clips was carried out by other (semi)professional software and the audio codec used remained as pcm_f32le. So no issue here.

    So the different audio codec issue appears to be with the AviSynth degraining process and for some reason saving the processed clips with audio pcm_s16le codec instead of retaining the pcm_f32le codec!?

    This is the (basic) degraining script used -

    Code:
    AviSource("test.avi")
    ConvertToYV12(interlaced=false, matrix="Rec601")
    
    SMDegrain(thsad=5000, tr=6, PreFilter=3, plane=3)
    
    PreFetch(4)
    
    Return last
    Maybe some other command or parameter needs to be added to the degraining script to retain the same audio codec (pcm_f32le)?
    Quote Quote  
  6. You may also be able to do this with clever FFmpeg-GUI.
    Which audio codec is displayed in the source screen when you load a pcm_f32le mp4?
    Post a pic here.
    Last edited by ProWo; 3rd Mar 2024 at 01:47.
    Quote Quote  
  7. I think the audio codec was fpcm as shown in the first attached image in my post #3.

    But I ran ffmpeg -i on a sample clip with pcm_f32le with the following result -

    Image
    [Attachment 77392 - Click to enlarge]
    Quote Quote  
  8. After a lot of trial and error, I finally managed to get the audio corrected on the suspect video clips by typing in a command window -

    Code:
    ffmpeg -i test.mp4 -c:v copy -c:a pcm_f32le test_corrected.mp4
    So the suspect clips now are all audio encoded with pcm_f32le to match the pcm_f32le for the remaining clips!

    However! There is now a problem with some of the clips (not the 'suspect' clips) where the audio is a bit out of synchronization with the video!

    I can correct that synchronization issue by using Avidemux. However (again!). Avidemux fails to play back the sound from these clips, probably because Avidemux doesn't seem to recognize/decode the pcm_f32le audio coding for these clips. So I can't edit the synchronization using Avidemux. Now looking for an alternative editor similar in function to Avidemux as I don't really want to re-encode the audio for all of the video clips (again)!
    Quote Quote  
  9. Use ffmpeg - itsoffset for this.
    Quote Quote  
  10. Thanks for that tip!

    On looking at individual video clips before assembly into the final video clip, there doesn't appear to be any synchronization issue between the audio and the imagery. The slight de-synchronization seems to only occur on some scenes/clips when the clips have been joined into the final video clip!?

    Maybe there is some issue with clever FFmpeg-GUI (which was used to join all the clips into the final video clip) causing this slight audio/imagery synchronization issue?

    EDIT: I noticed that the audio was progressively getting out of sync with the imagery. I searched on the internet for a solution and ultimately discovered that the audio length was 46:40.953, while the video length was 46:41.799. So the audio was slightly slower with a lag of 0.846 s.

    Using Audacity with the ffmpeg plugin, I "extracted" the video audio content and slowed it down a little by -0.0301948855 % in Audacity. Saved the adjusted audio clip in wav format. Then using ffmpeg I added/overwrote the audio content in the video with the adjusted audio clip.

    On playback of the processed video, it appears the audio is now in synchronization with the imagery!! At last!!
    Last edited by meeshu; 3rd Mar 2024 at 10:15.
    Quote Quote  



Similar Threads

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