VideoHelp Forum
+ Reply to Thread
Results 1 to 27 of 27
Thread
  1. I tried a dedicated video splitting app and Avidemux. They both generate a variable frame rate according to MediaInfo. This causes audio sync issues in VLC.
    Quote Quote  
  2. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Not true.

    I just checked a video I extracted in avidemux today. Constant frame rate. Perfect audio sync

    Maybe if you did not split on a i-frame ?
    Quote Quote  
  3. No, it's still resulting in a variable framerate. It doesn't seem to matter which video I choose either.
    Quote Quote  
  4. If I save as AVI then it doesn't have this issue, but it says enclosing H.264 within AVI is a bad idea. MKV is not compatible with some smart TV's, so that's not an option.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    If yoru source is constant FPS and you re-encode the mp4 in Avidemux it is possible, but if you
    leave video as "copy" and don't re-encode, the constant frame rate is maintained.
    Last edited by davexnet; 3rd Oct 2018 at 19:19.
    Quote Quote  
  6. Then why isn't it maintained? You can try it yourself.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by Hypersonic1 View Post
    Then why isn't it maintained? You can try it yourself.
    I tried a couple of samples I had laying around in my PC and it followed the rule I stated above.
    Constant source produced a constant clip and
    VFR source produce a VFR clip - on both occasions I'm using "copy" for video and consequently not re-encoding

    My version of Avidemux 2.70

    Have you looked in Mediainfo's report to see if there are any further clues?
    Quote Quote  
  8. I am also using Avidemux 2.70.

    General
    Complete name : C:\Users\Hypersonic\Videos\before.mp4
    Format : MPEG-4
    Format profile : Base Media / Version 2
    Codec ID : mp42 (mp42/mp41)
    File size : 976 MiB
    Duration : 13 min 30 s
    Overall bit rate mode : Variable
    Overall bit rate : 10.1 Mb/s
    Encoded date : UTC 2017-12-15 22:10:41
    Tagged date : UTC 2017-12-15 22:11:31
    TIM : 00;00;00;00
    TSC : 60000
    TSZ : 1001

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.2
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, RefFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 13 min 30 s
    Bit rate mode : Variable
    Bit rate : 9 783 kb/s
    Maximum bit rate : 10 000 kb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 59.940 (60000/1001) FPS
    Standard : NTSC
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.079
    Stream size : 945 MiB (97%)
    Language : English
    Encoded date : UTC 2017-12-15 22:10:41
    Tagged date : UTC 2017-12-15 22:10:41
    Color range : Limited
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : mp4a-40-2
    Duration : 13 min 30 s
    Source duration : 13 min 30 s
    Bit rate mode : Variable
    Bit rate : 317 kb/s
    Maximum bit rate : 414 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 kHz
    Frame rate : 46.875 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 30.6 MiB (3%)
    Source stream size : 30.6 MiB (3%)
    Language : English
    Encoded date : UTC 2017-12-15 22:10:41
    Tagged date : UTC 2017-12-15 22:10:41
    General
    Complete name : C:\Users\Hypersonic\Videos\after.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 194 MiB
    Duration : 2 min 38 s
    Overall bit rate mode : Variable
    Overall bit rate : 10.3 Mb/s
    Writing application : Lavf57.71.100

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.2
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, RefFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 2 min 38 s
    Bit rate mode : Variable
    Bit rate : 10 000 kb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 59.940 (60000/1001) FPS
    Minimum frame rate : 59.881 FPS
    Maximum frame rate : 60.001 FPS
    Standard : NTSC
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.080
    Stream size : 188 MiB (97%)
    Color range : Limited
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : mp4a-40-2
    Duration : 2 min 38 s
    Bit rate mode : Constant
    Bit rate : 317 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 kHz
    Frame rate : 46.875 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 6.00 MiB (3%)
    Default : Yes
    Alternate group : 1
    Quote Quote  
  9. You mentioned other "dedicated video splitting apps" ; which ones did you try ?

    You can try lossless cut it should preserve CFR , but like avidemux the cut points will only be GOP accurate
    https://www.videohelp.com/software/LosslessCut
    https://github.com/mifi/lossless-cut

    Alternatively, it's possible to "fix" using a second step by editing timecodes . eg. mp4fpsmod. Not as ideal, but it will work .
    Quote Quote  
  10. You mentioned other "dedicated video splitting apps" ; which ones did you try ?
    I tried Boilsoft Video Splitter. It also didn't work for me.

    You can try lossless cut it should preserve CFR , but like avidemux the cut points will only be GOP accurate
    https://www.videohelp.com/software/LosslessCut
    https://github.com/mifi/lossless-cut
    Lossless Cut worked for me. Thanks.
    Quote Quote  
  11. Why does Lossless Cut create files that freeze for a second at the beginning of every clip?
    Quote Quote  
  12. Originally Posted by Hypersonic1 View Post
    Why does Lossless Cut create files that freeze for a second at the beginning of every clip?
    I think it's because it's using an edit list. There is an edts atom , and some players might handle that differently .

    You can ask the developer or post a bug report or enhancement request
    https://github.com/mifi/lossless-cut/issues


    Or you can cut with another method and use the timecode fix method to force cfr
    Quote Quote  
  13. It's because MP4 uses a time base of 1/90000 seconds. Frame rates like 23.976 can't be represented precisely as N/90000 so the muxer alternates between 3753/90000 and 3754/90000 to give an average of 90000/23.976 (~3753.75). PAL frame rates, 25 fps and 50 fps, can be represented exactly as 3600/90000 and 1800/90000 respectively.

    More sensible containers use a time base that's represented with an explicit numerator and denominator. So a frame rate like 24000/1001 can be represented exactly.
    Last edited by jagabo; 24th Oct 2018 at 23:32.
    Quote Quote  
  14. Originally Posted by jagabo View Post
    It's because MP4 uses a time base of 1/90000 seconds. Frame rates like 23.976 can't be represented precisely as N/90000 so the muxer alternates between 3753/90000 and 3754/90000 to give an average of 90000/23.976 (~3753.75). PAL frame rates, 25 fps and 50 fps, can be represented exactly as 3600/90000 and 1800/90000 respectively.

    More sensible containers use a time base that's represented with an explicit numerator and denominator. So a frame rate like 24000/1001 can be represented exactly.

    MP4 supports other timebases. eg. You can use a 1001/24000 timebase, which results in CFR for a "23.976" video . That's one of the ways in which you can fix it - setting the time base

    It's certain muxers, certain programs (e.g. handbrake) that use a default timebase of 1/90000 that cause the problem
    Quote Quote  
  15. Or you can cut with another method and use the timecode fix method to force cfr
    mp4fpsmod doesn't work. I don't know what parameters to use for it. It seems like everything I try results in an unplayable file.
    Quote Quote  
  16. Originally Posted by Hypersonic1 View Post
    Or you can cut with another method and use the timecode fix method to force cfr
    mp4fpsmod doesn't work. I don't know what parameters to use for it. It seems like everything I try results in an unplayable file.
    What do you mean it doesn't work ?

    You just set the fps . Since it's every frame affected you precede it with 0.

    e.g for "23.976" (or really 24000/1001)
    Code:
    mp4fpsmod "INPUT.mp4" --fps 0:24000/1001 -o "OUTPUT.mp4"
    If it was "59.94" as in your example above, you would use --fps 0:60000/1001

    You can do in-place editing (edit the file, without writing another file) by using --inplace . But I wouldn't do that until you're more confortable with it
    Quote Quote  
  17. What do you mean it doesn't work ?

    You just set the fps . Since it's every frame affected you precede it with 0.

    e.g for "23.976" (or really 24000/1001)
    It just plays a gray screen in VLC with the audio skipping or no audio at all. It does this with any VFR mp4 file.
    Last edited by Hypersonic1; 26th Oct 2018 at 16:18.
    Quote Quote  
  18. Originally Posted by Hypersonic1 View Post
    What do you mean it doesn't work ?

    You just set the fps . Since it's every frame affected you precede it with 0.

    e.g for "23.976" (or really 24000/1001)
    It just plays a gray screen in VLC with the audio skipping or no audio at all. It does this with any VFR mp4 file.
    Maybe you didn't cut it correctly ?


    It works here to fix, and in sync, in VLC for all AVC CFR files (that were cut properly on IDR keyframes, and as a result of muxing results in VFR)

    There are other ways to fix it too - you can change the timebase/timescale directly with lsmash timelineeditor . But that only works on VFR files that were the result of incorrect timebase/timescale during muxing . But there are other causes of VFR from cut CFR . mp4fpsmod should work on all of them, it's the most robust method
    Quote Quote  
  19. but it doesn't work. When I cut the video in avidemux, I selected an I-frame as the starting point.
    Quote Quote  
  20. Originally Posted by Hypersonic1 View Post
    but it doesn't work. When I cut the video in avidemux, I selected an I-frame as the starting point.
    Unfortunately , avidemux doesn't distinguish between "i" frames and "I" (aka IDR, true keyframes) frames correctly . So if you cut on an "i" frame, it will have errors

    Is your source large in filesize ? If it's not, can you upload it ?
    Quote Quote  
  21. Actually, maybe it had to do with the fact that I exported them as MP4v2. I tried exporting as MP4 and it worked.
    Quote Quote  
  22. Originally Posted by Hypersonic1 View Post
    Actually, maybe it had to do with the fact that I exported them as MP4v2. I tried exporting as MP4 and it worked.
    Are you 100% sure ?

    Can you do some more tests if you have time ? on that source or other sources? maybe try different sections ?

    Because if it doesn't work, it needs to be fixed / looked into . I've never seen it fail , if the cuts were done correctly .
    Quote Quote  
  23. Did you check your cut mp4v2 file, before using mp4fpsmod ? did it play ok before using mp4fpsmpd ?

    What version of mp4fpsmod were you using ?

    In theory, mp4v2 shouldn't make a difference, because mp4v2 support was added to mp4fpsmod 0.25
    Quote Quote  
  24. Originally Posted by poisondeathray View Post
    Did you check your cut mp4v2 file, before using mp4fpsmod ? did it play ok before using mp4fpsmpd ?

    What version of mp4fpsmod were you using ?

    In theory, mp4v2 shouldn't make a difference, because mp4v2 support was added to mp4fpsmod 0.25
    I am using mp4fpsmod 0.25. I am sure that I cut it correctly. I have tried several different mp4v2 files and they don't work correctly after using mp4fpsmod. If I convert them to mp4v1 then mp4fpsmod works properly. I will just use mp4v1 since I don't actually need mp4v2.
    Quote Quote  
  25. I can replicate the issue with mp4v2 cut with avidemux - but it works with mp4fpsmod 0.24, or lsmash timelineeditor

    So looks like something up with 0.25 . Can you just do a quick check with 0.24 to see if it's ok on your end ?
    Quote Quote  
  26. Originally Posted by poisondeathray View Post
    I can replicate the issue with mp4v2 cut with avidemux - but it works with mp4fpsmod 0.24, or lsmash timelineeditor

    So looks like something up with 0.25 . Can you just do a quick check with 0.24 to see if it's ok on your end ?
    Yes. I just tried using an MP4v2 file with 0.24, and it works properly now. Thanks.
    Quote Quote  
  27. ok thanks for double checking, I filed a bug report for 0.25
    Quote Quote  



Similar Threads

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