VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Hi,
    I have edited some video files in VirtualDub and saved them using external encoders. Those are MP4 files with identical CONSTANT frame rate, resolution, encoded with crf 20 and around 20 minutes long. I tried joining the videos using FFMpeg. The output video came out with VARIABLE frame rate the reason for which is not known to me. I also tried avidemux, MP4box and I get the same variable frame rate video. But, I get constant frame rate when I join them using MKVToolnix. Again, I need to convert them to MP4 due to compatibility issues with the players. Can anyone suggest methods to get constant frame rate after joining!.
    Image Attached Thumbnails Click image for larger version

Name:	VIDEO-1.jpg
Views:	513
Size:	38.3 KB
ID:	34339  

    Click image for larger version

Name:	JOINED VIDEO.jpg
Views:	433
Size:	39.6 KB
ID:	34340  

    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    What happens if you remux the mkv to mp4 with ffmpeg?

    Code:
    ffmpeg -i video.mkv -c copy new.mp4
    Quote Quote  
  3. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by Baldrick View Post
    What happens if you remux the mkv to mp4 with ffmpeg?

    Code:
    ffmpeg -i video.mkv -c copy new.mp4
    The CONSTANT frame rate becomes VARIABLE frame rate as shown in the jpg file attached in the #1
    Quote Quote  
  4. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    Originally Posted by shans View Post
    The CONSTANT frame rate becomes VARIABLE frame rate as shown in the jpg file attached in the #1
    What he ment was that you should join the files into a MKV with MKVToolnix, as you said this will create constant framerate. From here you can take the joined, constant framerate MKV and remux it to a MP4 with the command given. You might want to define a codec for audio:

    Code:
    ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  5. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by TorBru View Post
    Originally Posted by shans View Post
    The CONSTANT frame rate becomes VARIABLE frame rate as shown in the jpg file attached in the #1
    What he ment was that you should join the files into a MKV with MKVToolnix, as you said this will create constant framerate. From here you can take the joined, constant framerate MKV and remux it to a MP4 with the command given. You might want to define a codec for audio:

    Code:
    ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
    I followed what he meant and the video joined using mkvtoolnix i.e mkv file came with constant frame rate. This when remuxed to MP4 using the command given resulted in variable frame rate that is what is shown in the jpg file.
    Quote Quote  
  6. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    My experience has been that FFMpeg does not join MP4 files well due to the container (Atoms) format. The only way I have had it work is to list the files in a filelist and then use the concat method of ffmpeg. Even this will sometimes cause variable audio rate as it aligns the audio to the different segments.
    Quote Quote  
  7. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by Budman1 View Post
    My experience has been that FFMpeg does not join MP4 files well due to the container (Atoms) format. The only way I have had it work is to list the files in a filelist and then use the concat method of ffmpeg. Even this will sometimes cause variable audio rate as it aligns the audio to the different segments.
    Thanks Budman1 - I also tried in the same way as you have mentioned, prepared a filelist and then used the concat method of FFMpeg. It joined well but with variable video frame rate.
    Quote Quote  
  8. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    But do you experience any playback problems with the mp4? Sync issues?
    Quote Quote  
  9. Member NiGHT-WiNG's Avatar
    Join Date
    May 2015
    Location
    Some sort of cave with bats flying around
    Search PM
    Can you please give a full mediainfo output of both before and after mux/join so this can be solved thank you
    Quote Quote  
  10. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Most of my MP4 are shorter videos so it is hard to tell visually but if I graph them out there doesn't seem to be or very slight. It's hard to tell if I am looking at the same frame generation but I'd say if my program is working correctly, audio is delayed maybe .002 ms in 4 minutes. This is based on .041 ms per frame (23.976 fps) and difference shows approximately 20 pixels out of 375 shift or .002 ms delayed

    Click image for larger version

Name:	ScreenHunter_179 Nov. 06 10.47.jpg
Views:	730
Size:	75.1 KB
ID:	34350Click image for larger version

Name:	ScreenHunter_180 Nov. 06 10.47.jpg
Views:	685
Size:	79.7 KB
ID:	34351
    Quote Quote  
  11. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by NiGHT-WiNG View Post
    Can you please give a full mediainfo output of both before and after mux/join so this can be solved thank you
    I have attached the media info text file 1) MP4 file before joining 2) MP4 files joined in FFMpeg 3) MP4 files muxed as MKV and then changed to MP4 using FFMpeg. Thank you.
    Image Attached Files
    Quote Quote  
  12. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by Baldrick View Post
    But do you experience any playback problems with the mp4? Sync issues?
    No problem when played in desktop computer and no sync issues. However, I have not played them in tv.
    Quote Quote  



Similar Threads

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