VideoHelp Forum

+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 38
Thread
  1. **************************************************
    To see the solution to this problem along with a recap, see post #37
    **************************************************


    I have a streaming MP4 file (for this post I will call it orig.mp4) that I have downloaded that is 2:51:54 long. At about the 1:57:07 mark, using VLC or Zoom Player, the video speeds up but the audio does not. This continues to the end, where the video has stopped minutes earlier but the audio continues. I have downloaded this file multiple times and the exact thing happens at the same time mark each time. When I view the streaming video in a browser, the video never speeds up in relationship to the audio.

    I understand that a possible solution is to find another video downloader and see if the same thing occurs. I have tried multiple apps but I have not found any others that will download from that site.

    When I play this orig.mp4 in VLC, it shows that it is using the H264 codec and the frame rate is 94.126760. In another MP4 that I have downloaded from that site where the video and audio is out of sync, the frame rate is 33.056366. Those two seem like really weird rates - which is probably an indication that something is wrong. Except for these two MP4s, when I use my Adobe Premiere Elements 14 to edit the MP4s from that site, I see a value of 30 fps and VLC shows a frame rate for 29.969922 for those MP4s.

    When I use Premier Elements to look at orig.mp4, the counter shows that I can only see 30 frames per second. It shows the file to be 2:24:31 long but nothing is cut off at the end. And, the place in orig.mp4 in VLC where it speeds up is at 1:38:38 in Premier Elements and the video does not speed up at that point.

    I can't figure out what is going on here, what to look for to fix, and, how to fix it. In addition to fixing this MP4, I want to understand more about how the problem happened and how to figure out what needs to change. So, I have several questions:
    • first, is "frames per second" and "frame rate" the same thing and, if not, how are they different?
    • what tool can I use to see exactly where this change is happening?
    • what is the name of the setting(s) that I am looking for to see the change?
    • other than trying to concatenating two files with different fps, is it really possible to have an MP4 that has a fps change within an MP4?
    • I know that speeding up the video (a la Benny Hill) is desirable in some situations, but, how /why would a video downloader want to, or be able to, do that?
    • if I decide to use the ffmpeg "setpts" switch to fix this, how can I figure out exactly what value to use?
    • is there a tool other than ffmpeg that can fix this problem?
    Last edited by the_steve_randolph; 5th Sep 2021 at 21:22. Reason: removing the links to the named apps
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Open the file in mediainfo, put it in text view, and post the output here
    Quote Quote  
  3. Originally Posted by davexnet View Post
    Open the file in mediainfo, put it in text view, and post the output here
    Code:
    General
    Complete name                            : C:\out.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/avc1/mp41)
    File size                                : 7.82 GiB
    Duration                                 : 2 h 51 min
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 6 512 kb/s
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 54 min 44 s
    Source duration                          : 2 h 24 min
    Bit rate                                 : 7 620 kb/s
    Width                                    : 1 912 pixels
    Original width                           : 1 920 pixels
    Height                                   : 1 088 pixels
    Original height                          : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 35.648 FPS
    Minimum frame rate                       : 5.994 FPS
    Maximum frame rate                       : 120.000 FPS
    Original frame rate                      : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.103
    Stream size                              : 2.45 GiB (31%)
    Source stream size                       : 7.70 GiB (98%)
    mdhd_Duration                            : 3284125
    Codec configuration box                  : avcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 2 h 51 min
    Bit rate mode                            : Variable
    Bit rate                                 : 93.6 kb/s
    Maximum bit rate                         : 424 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 44.1 kHz
    Frame rate                               : 43.066 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 115 MiB (1%)
    
    Text #1
    ID                                       : 1-CC1
    Format                                   : EIA-608
    Muxing mode                              : SCTE 128 / DTVCC Transport
    Muxing mode, more info                   : Muxed in Video #1
    Duration                                 : 54 min 44 s
    Bit rate mode                            : Constant
    Stream size                              : 0.00 Byte (0%)
    CaptionServiceName                       : CC1
    
    Text #2
    ID                                       : 1-CC3
    Format                                   : EIA-608
    Muxing mode                              : SCTE 128 / DTVCC Transport
    Muxing mode, more info                   : Muxed in Video #1
    Duration                                 : 54 min 44 s
    Bit rate mode                            : Constant
    Stream size                              : 0.00 Byte (0%)
    CaptionServiceName                       : CC3
    Quote Quote  
  4. Try
    ffmpeg -r 29.970 -i out.mp4 -map 0 -c copy newout.mp4
    Quote Quote  
  5. Originally Posted by ProWo View Post
    Try
    ffmpeg -r 29.970 -i out.mp4 -map 0 -c copy newout.mp4
    After executing this command, I play the newout.mp4 in both VLC and Zoom Player. The video track stops at 54:44 (this end is before the actual end of the MP4 file) but the audio track continues to the end at 2:51:54. The original out.mp4 has the size of 8199 MB in Windows Explorer but the newout.mp4 has the size of 2691 MB. This is the Mediainfo output of outnew.mp4:
    Code:
    General
    Complete name                            : C:\newout.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/avc1/mp41)
    File size                                : 2.57 GiB
    Duration                                 : 2 h 51 min
    Overall bit rate                         : 2 137 kb/s
    Writing application                      : Lavf58.78.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 54 min 45 s
    Source duration                          : 54 min 45 s
    Bit rate                                 : 6 405 kb/s
    Maximum bit rate                         : 20.1 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 29.970 (30000/1001) FPS
    Minimum frame rate                       : 5.994 FPS
    Maximum frame rate                       : 121.091 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.103
    Stream size                              : 2.45 GiB (95%)
    Source stream size                       : 2.45 GiB (95%)
    mdhd_Duration                            : 3285870
    Codec configuration box                  : avcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 2 h 51 min
    Bit rate mode                            : Constant
    Bit rate                                 : 93.6 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 44.1 kHz
    Frame rate                               : 43.066 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 115 MiB (4%)
    Default                                  : Yes
    Alternate group                          : 1
    
    Text #1
    ID                                       : 1-CC1
    Format                                   : EIA-608
    Muxing mode                              : SCTE 128 / DTVCC Transport
    Muxing mode, more info                   : Muxed in Video #1
    Duration                                 : 54 min 45 s
    Bit rate mode                            : Constant
    Stream size                              : 0.00 Byte (0%)
    CaptionServiceName                       : CC1
    
    Text #2
    ID                                       : 1-CC3
    Format                                   : EIA-608
    Muxing mode                              : SCTE 128 / DTVCC Transport
    Muxing mode, more info                   : Muxed in Video #1
    Duration                                 : 54 min 45 s
    Bit rate mode                            : Constant
    Stream size                              : 0.00 Byte (0%)
    CaptionServiceName                       : CC3
    Last edited by the_steve_randolph; 18th Aug 2021 at 01:51.
    Quote Quote  
  6. And with
    ffmpeg -i out.mp4 -map 0 -c copy newout.mp4
    ?
    Quote Quote  
  7. Originally Posted by ProWo View Post
    And with
    ffmpeg -i out.mp4 -map 0 -c copy newout.mp4
    ?
    After running this command, I see no difference in the output from your previous command suggestion.
    Quote Quote  
  8. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Perhaps something like this to force the 29.97 constant frame rate. It's going to re-encode the file
    Code:
    ffmpeg -r 29.970 -vsync 1 -i in.mp4 -c:v libx264 out29.mp4
    Quote Quote  
  9. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Sounds like someone joined 2 segments together that had different encoding parameters. I've had this happen to me and I've always had to split at the mismatch point and reencode the failing half. If you use ffprobe you will probably see some wild swings in PTS and DTS times, especially at the join point.
    Quote Quote  
  10. Originally Posted by Budman1 View Post
    Sounds like someone joined 2 segments together that had different encoding parameters. I've had this happen to me and I've always had to split at the mismatch point and reencode the failing half. If you use ffprobe you will probably see some wild swings in PTS and DTS times, especially at the join point.
    Agree.
    Another try
    ffmpeg -i out.mp4 -map 0 -c copy newout.ts
    Quote Quote  
  11. Originally Posted by davexnet View Post
    Perhaps something like this to force the 29.97 constant frame rate. It's going to re-encode the file
    Code:
    ffmpeg -r 29.970 -vsync 1 -i in.mp4 -c:v libx264 out29.mp4
    When running this command, ffmpeg generated the message "More than 1000 frames duplicated" at the 00:34:09.53 mark while continuing. It also displayed the "q=29.0" information during the re-encoding. The resulting output file showed an O/S size of 2068 MB and a time of 2:51:54. When I clicked on the output file to view it in VLCl], a panel displayed that said:

    VLC crash reporting
    Ooops: VLC media player just crashed.
    Would you like to send a bug report to the developers team?
    Yes No

    My computer then automatically opened VLC with the MP4 that showed a length of 2:51:54. The video was in sync with the audio, but, stopped at 54:44 while the audio continued until the end. VLC shows a fps of 29.970000
    Quote Quote  
  12. Originally Posted by Budman1 View Post
    Sounds like someone joined 2 segments together that had different encoding parameters. I've had this happen to me and I've always had to split at the mismatch point and reencode the failing half. If you use ffprobe you will probably see some wild swings in PTS and DTS times, especially at the join point.
    First, why would a streaming service do that? Second, I don't see that "speeding up" effect when viewing the streaming file in real time. Third, when I run ffprobe on the file, I get the same output as from ffmpeg - so I am not sure what you are claiming I will see. Please clarify.
    Last edited by the_steve_randolph; 18th Aug 2021 at 04:27.
    Quote Quote  
  13. Originally Posted by ProWo View Post
    Originally Posted by Budman1 View Post
    Sounds like someone joined 2 segments together that had different encoding parameters. I've had this happen to me and I've always had to split at the mismatch point and reencode the failing half. If you use ffprobe you will probably see some wild swings in PTS and DTS times, especially at the join point.
    Agree.
    Another try
    ffmpeg -i out.mp4 -map 0 -c copy newout.ts
    When I run that command, ffmpeg displays the "q=31.0" information during the re-encoding. After it is finished, the O/S information shows the file to be 1829 MB in size and 54:44 in length. VLC shows the file to be 54:44 in length, the fps is 29.970030, and, the video quality is greatly reduced. In VLC the video and audio are in sync, and, everything ends at 54:44.
    Last edited by the_steve_randolph; 18th Aug 2021 at 04:39.
    Quote Quote  
  14. Another one

    Code:
    ffmpeg -i out.mp4 -map 0 -c:v copy -c:s copy -c:a ac3 -b:a 256k newout.mp4
    Maybe the correct video length is 54min 44 sec, and there is only a problem with the aac timing.
    Last edited by ProWo; 18th Aug 2021 at 06:37.
    Quote Quote  
  15. Originally Posted by ProWo View Post
    Another one

    Code:
    ffmpeg -i out.mp4 -map 0 -c:v copy -c:s copy -c:a ac3 -b:a 256k newout.mp4
    Maybe the correct video length is 54min 44 sec, and there is only a problem with the aac timing.
    That command creates a file that is 2:51:54 long according to Windows Explorer. VLC plays the audio for the full 2:51:54 but the video stops at 54:44.

    I *KNOW* that this video lasts 2:51:54 because when I stream it in a browser, it lasts that long without any problems.
    Quote Quote  
  16. The best way would be to download the video again
    Quote Quote  
  17. The best way would be to download the video again.
    Another idea: cut the first 1min with Avidemux and use this cutted part as reference file in untrunc (see software section) to repair your out.mp4.
    Quote Quote  
  18. Originally Posted by ProWo View Post
    The best way would be to download the video again.
    Another idea: cut the first 1min with Avidemux and use this cutted part as reference file in untrunc (see software section) to repair your out.mp4.
    I have downloaded this MP4 at least 5 times and it has the same problem every time.

    I cannot find a "software section". But, searching the entire site, it seems that "untrunc" is a Linux utility and I am running Windows.
    Quote Quote  
  19. Originally Posted by the_steve_randolph View Post
    I cannot find a "software section".
    https://www.videohelp.com/software
    Quote Quote  
  20. I don't know what untrunc is, what it is for, or, how to use it. How would it help me with this problem?
    Quote Quote  
  21. It's a portable program to repair truncated avc videos.
    Unpack the archive and start untrunc-gui.
    In the left field search for the reference file (read above), in the right field for your out.mp4.
    Then click on untrunc (bottom right).
    That's all.
    Quote Quote  
  22. Originally Posted by ProWo View Post
    It's a portable program to repair truncated avc videos.
    Unpack the archive and start untrunc-gui.
    In the left field search for the reference file (read above), in the right field for your out.mp4.
    Then click on untrunc (bottom right).
    That's all.
    OK, several issues. I have Avidemux but don't know how to use it. So, I don't know what you mean by "cut the first 1min with Avidemux". If you mean, create a 1 minute file from the first minute of the MP4, I can do that with my Premiere Elements. But, I don't know if Avidemux is doing something special other than just taking the first minute. Plus, again, I don't know how to use Avidemux, so, I don't know how to use it to get just the first minute. But, I ran it and opened my MP4 and it generated this error:

    This video contains B-frames, but presentation time stamps (PTS) are either missing or monotonically increasing. Avidemux can try to reconstruct correct PTS by decoding the entire video. This may take a lot of time. Proceed?

    Can you tell me what Avidemux and untrunc are doing according to what you want me to do? And, why do you think that the video is "truncated" when it seems that part of it is sped up?
    Quote Quote  
  23. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    My suspicion, FWIW, is that the download was in 2 pieces with different formats, sampling rates, etc. During a scrne change the second part began streaming behind the first. You streaming device accepts different formats so it play fine. Capturing as one file does not play well during the second half.

    My suggestion is to cut the final third of the video and see if that plays ok.
    Quote Quote  
  24. Originally Posted by Budman1 View Post
    My suspicion, FWIW, is that the download was in 2 pieces with different formats, sampling rates, etc. During a scrne change the second part began streaming behind the first. You streaming device accepts different formats so it play fine. Capturing as one file does not play well during the second half.
    I used the same video downloader (Video DownloadHelper) to download multiple MP4s from the same site that are larger/longer than my problem MP4 and those other MP4s do not have the same problem. Also, what is "a scrne change"? Video DownloadHelper does not give me any information or options that indicate this particular file is in two parts, although the fact that I have downloaded this file multiple times and the problem starts at the same timestamp every time lends itself to the idea that it may be in two parts at some point in my process. But, why would the streaming site create two parts that have "different formats, sampling rates, etc."? My "streaming device" is my PC and I am viewing it in Firefox and using Video DownloadHelper in the same browser window.

    My suggestion is to cut the final third of the video and see if that plays ok.
    I don't understand what this would accomplish. The MP4 plays fine in VLC and Zoom Player until 1:57:07. I want the entire MP4, so, chopping off the end would be useless for me.
    Quote Quote  
  25. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    If the final third (past the beginning of bad start) plays ok then it is being affected by the first part. You can also check it mediainfo output against the complete video.
    Quote Quote  
  26. Originally Posted by Budman1 View Post
    If the final third (past the beginning of bad start) plays ok then it is being affected by the first part. You can also check it mediainfo output against the complete video.
    Oh, OK, I thought you meant to get rid of the end part.

    So, I ran this command to get the part after the video starts to speed up:
    Code:
    ffmpeg -ss 01:57:10.000 -in.mp4 -c copy out2.mp4
    This resulted in a file that Windows Explorer says is 54:44 long, which is interesting since that is the exact same length of the resulting TS file from post #13. When I run this MP4 in VLC, there is no video and it just shows the orange cone, the audio goes all of the way to the end but goes in and out. Interestingly, it shows a frame rate of 0.000022. Zoom Player opens the MP4 but plays nothing. Windows Media Player is so confused that I can't even describe what it is doing. And Nero Showtime is also very confused.

    So, this would prove that the first part is not causing problems for the second part.

    The MediaInfo for the original MP4 is in post #3. And, here is the MediaInfo for this MP4:
    Code:
    General
    Complete name                            : C:out2.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom (isom/iso2/avc1/mp41)
    File size                                : 79.7 MiB
    Overall bit rate                         : 156 b/s
    Writing application                      : Lavf58.78.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Source duration                          : 17 ms
    Bit rate                                 : 61.1 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 59.940 (59940/1000) FPS
    Original frame rate                      : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.492
    Stream size                              : 29.8 TiB
    Source stream size                       : 124 KiB (0%)
    mdhd_Duration                            : 43977728
    Codec configuration box                  : avcC
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : mp4a-40-2
    Duration                                 : 54 min 44 s
    Source duration                          : 1 h 57 min
    Bit rate mode                            : Constant
    Bit rate                                 : 93.6 kb/s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 44.1 kHz
    Frame rate                               : 43.066 FPS (1024 SPF)
    Compression mode                         : Lossy
    Stream size                              : 36.6 MiB (46%)
    Source stream size                       : 78.4 MiB (98%)
    Default                                  : Yes
    Alternate group                          : 1
    mdhd_Duration                            : 3284536
    Last edited by the_steve_randolph; 18th Aug 2021 at 10:40.
    Quote Quote  
  27. Originally Posted by the_steve_randolph View Post
    why do you think that the video is "truncated" when it seems that part of it is sped up?
    The videostream is messed up after 54:44.
    Untrunc could find this compromised frames and repair the whole videostream.
    Quote Quote  
  28. Originally Posted by ProWo View Post
    Originally Posted by the_steve_randolph View Post
    why do you think that the video is "truncated" when it seems that part of it is sped up?
    The videostream is messed up after 54:44.
    Untrunc could find this compromised frames and repair the whole videostream.
    See post #23
    Quote Quote  
  29. I gave you some hints and you answer with questions instead of working off the hints.
    I am out
    Quote Quote