0

Someone has sent me a video that I wish to embed into a presentation I'm building. However, it doesn't play back as the author intended either embedded or standalone. I suspect was encoded on a Mac, but not sure at the present time what tool was used - still looking into that information...

I discovered that the video plays fine in Windows Quicktime v7.7.9, but using VLC v3.0.16 and Windows Media Players, and K-Lite Media Player Classic, it does not. Depends which player what happens, but VLC shows an out-of-sequence frame for about 10s, then the frames from the first part, then seems to hang video playback. WMP plays the audio out of sync with the video.

I should add, this is a recording of someone speaking over a slide deck, and a lot of the video frames are the same - it doesn't have a talking head in the corner or anything. I think that might account for the surprisingly low frame rate - there aren't a lot of different frames.

I've tried a few attempts at re-encoding using FFmpeg, but to no avail. I'm wondering what more information I can extract to help diagnose the issue. Meanwhile, am trying to get the author to produce an alternative export in case that helps...

MediaInfo reports:

General
CompleteName                     : C:\work\video\input.mp4
Format/String                    : MPEG-4
Format_Profile                   : Base Media / Version 2
CodecID/String                   : mp42 (isom/mp41/mp42)
FileSize/String                  : 10.0 MiB
Duration/String                  : 8 min 54 s
OverallBitRate_Mode/String       : Variable
OverallBitRate/String            : 157 kb/s
Encoded_Date                     : UTC 2021-11-24 19:15:52
Tagged_Date                      : UTC 2021-11-24 19:15:52

Video
ID/String                        : 2
Format/String                    : AVC
Format/Info                      : Advanced Video Codec
Format_Profile                   : High@L4
Format_Settings                  : CABAC / 2 Ref Frames
Format_Settings_CABAC/String     : Yes
Format_Settings_RefFrames/String : 2 frames
CodecID                          : avc1
CodecID/Info                     : Advanced Video Coding
Duration/String                  : 8 min 54 s
Source_Duration/String           : 10 min 4 s
BitRate_Mode/String              : Variable
BitRate/String                   : 26.9 kb/s
BitRate_Maximum/String           : 768 kb/s
Width/String                     : 1 920 pixels
Height/String                    : 1 080 pixels
DisplayAspectRatio/String        : 16:9
FrameRate_Mode/String            : Variable
FrameRate/String                 : 0.046 FPS
FrameRate_Minimum/String         : 0.010 FPS
FrameRate_Maximum/String         : 5.000 FPS
ColorSpace                       : YUV
ChromaSubsampling/String         : 4:2:0
BitDepth/String                  : 8 bits
ScanType/String                  : Progressive
Bits-(Pixel*Frame)               : 0.282
StreamSize/String                : 1.88 MiB (19%)
Source_StreamSize/String         : 2.01 MiB (20%)
Title                            : Core Media Video
Encoded_Date                     : UTC 2021-11-24 19:15:52
Tagged_Date                      : UTC 2021-11-24 19:15:52
CodecConfigurationBox            : avcC

Audio
ID/String                        : 1
Format/String                    : AAC LC
Format/Info                      : Advanced Audio Codec Low Complexity
CodecID                          : mp4a-40-2
Duration/String                  : 8 min 54 s
Source_Duration/String           : 8 min 54 s
BitRate_Mode/String              : Constant
BitRate/String                   : 128 kb/s
Channel(s)/String                : 1 channel
ChannelLayout                    : C
SamplingRate/String              : 44.1 kHz
FrameRate/String                 : 43.066 FPS (1024 SPF)
Compression_Mode/String          : Lossy
StreamSize/String                : 7.91 MiB (79%)
Source_StreamSize/String         : 7.91 MiB (79%)
Title                            : Core Media Audio
Encoded_Date                     : UTC 2021-11-24 19:15:52
Tagged_Date                      : UTC 2021-11-24 19:15:52

Based on the comments below that the low framerate could be confusing the players, I tried a couple of options that I thought might interpolate to produce a more "expected" output framerate:

ffmpeg -i input.mp4 -crf 10 -filter:v tblend -r 24 output.24fps.mp4
ffmpeg -i input.mp4 -filter:v "minterpolate=mi_mode=dup" output.mp4

In both cases, this results in a video where the first slide of the deck is dropped - so it starts with slide 2 then the audio is out of sync thereafter. There's a hint that an issue reported in the ffmpeg output may be related:

c:\work\video>ffmpeg -y -i input.mp4 -crf 10 -filter:v tblend -r 24 output.24fps.mp4
ffmpeg version 4.4.1-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (Rev1, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000168edd2b740] decoding for stream 1 failed
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: isommp41mp42
    creation_time   : 2021-11-24T19:15:52.000000Z
  Duration: 00:08:54.25, start: 0.000000, bitrate: 157 kb/s
  Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 124 kb/s (default)
    Metadata:
      creation_time   : 2021-11-24T19:15:52.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 27 kb/s, 0.05 fps, 100 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2021-11-24T19:15:52.000000Z
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000168ee7bf380] using SAR=1/1
[libx264 @ 00000168ee7bf380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000168ee7bf380] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 00000168ee7bf380] 264 - core 164 r3075 66a5bc1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=10.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.24fps.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: isommp41mp42
    encoder         : Lavf58.76.100
  Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 12288 tbn (default)
    Metadata:
      creation_time   : 2021-11-24T19:15:52.000000Z
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      creation_time   : 2021-11-24T19:15:52.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 aac
More than 1000 frames duplicated    1792kB time=00:03:04.85 bitrate=  79.4kbits/s dup=628 drop=0 speed=  30x
frame= 4100 fps=127 q=15.0 size=    5376kB time=00:05:01.51 bitrate= 146.1kbits/s dup=4092 drop=0 speed=9.37x

The output contains the line:

[mov,mp4,m4a,3gp,3g2,mj2 @ 00000168edd2b740] decoding for stream 1 failed

I can set -analyzeduration to a larger figure to get rid of the failure, but I suspect that is masking rather than fixing it.

For further information, according to https://stackoverflow.com/questions/4425413/how-to-extract-the-1st-frame-and-restore-as-an-image-with-ffmpeg/4425466 this should extract the first frame:

ffmpeg -i input.mp4 -vf "select=eq(n\,0)" -vframes 1 out.png

but it provides the second slide in the presentation, when QT clearly shows a first, title slide, on screen for at least 10s...

BobC
  • 1
  • 2
  • 2
    Quicktime for Windows has been considered 'unsafe' since 2016 when support ceased. You really shouldn't be running it any more. – Tetsujin Nov 29 '21 at 17:46
  • The FPS looks unusually low. Can you run MediaInfo on it and provide the results. That might be more helpful than what was posted from Quicktime - https://mediaarea.net/en/MediaInfo. If the video is corrupted or not recoverable, but it does play in quicktime, could you play it and recapture using a screen recording software? – spaceman-spiff Nov 29 '21 at 17:58
  • 1
    I've known [Stellar Phoenix](https://www.stellarinfo.com/disk-recovery/video-repair.php) to be able to recover videos unplayable on many players - but it's expensive for a one-trick pony you might only need every few years. – Tetsujin Nov 29 '21 at 18:03
  • thanks, I know who the video came from, so I judged using an out of support tool just to confirm what the author said "it plays fine in QuickTime" wasn't too big a risk, and my aim here is to work out why its not playing properly in supported tools... added the MediaInfo output instead of QTs. – BobC Nov 29 '21 at 18:36
  • Can you share the file? – Gyan Nov 30 '21 at 04:12
  • Unfortunately not right now; its intended for an upcoming event so not something I can post in public until after the main presentation. If that changes I will. But if anyone can suggest other analysis I can try, that would be appreciated. – BobC Nov 30 '21 at 09:27
  • The issue is probably connected to the very low framerate (0.01 fps = 100 seconds still image) which some playback software might just not take into consideration. This is more of a slideshow with audio rather than a video. I could elaborate on this, but I'd need to know what you want to achieve, or if you're just plain curious. **ffprobe** is a way to analyze your file further, as for example indicated [here](https://superuser.com/a/1529110/714576), or on [ffmpeg.org](https://ffmpeg.org/ffprobe.html) – 1NN Nov 30 '21 at 10:45
  • Thanks for the hint - this helps me zero in a bit on what might be the cause. Yes, this is "more of a slideshow with audio", and my experience is "most" playback software I've tried - VLC, Windows Media Player, Media Player Classic - aren't taking the low framerate into consideration. I am ultimately hoping to work out an FFmpeg command that might efficiently re-encode it so those players, and specifically the player embedded in Powerpoint, play it as intended. – BobC Nov 30 '21 at 12:25
  • Re-make it at a standard FPS. The file will be barely larger, as the key-framing will pretty much take care of holding the still for the correct duration, without needing further data. – Tetsujin Nov 30 '21 at 18:38
  • I didn't author the file, so can't "re-make it" from source, and I've tried all sorts of ffmpeg commands to try to re-encode it with no success. I asked for an alternative version and got a .MOV which suffers exactly the same issues. So far, re-capturing it using a recording tool, e.g. QT player into zoom, is the only thing that's worked... Still think there's something missing here if a now no longer supported piece of software is the only tool that can decode a file someone has sent me in good faith, created I presume using what I assume must have been a 'common' slide recording tool... – BobC Nov 30 '21 at 18:59
  • tbh, we're 4 blind men trying to guess an elephant. We don't know what it was made on, or how, or whether the author realised it could have been done differently, or why they didn't... – Tetsujin Dec 01 '21 at 14:33
  • The author said "I am using QuickTime Player and it isn't giving me any troubles" - I don't think they know what they would have done differently to avoid this - as they don't see the issue. I realise it would help to know more about the origin, and to have the file itself. I've asked for more info but as this is coming via the assistant to a CEO doing me a favour, I am not sure what I'll get back. If I can extract something via ffprobe that would tell us blind men more, I can do that... I do appreciate the suggestions. – BobC Dec 01 '21 at 15:43
  • Also, as suggested, tried the free trial of Stellar video repair tool and while it said it repaired the file, the preview button wouldn't launch (save no available in trial) so that doesn't engender much confidence... – BobC Dec 01 '21 at 16:19
  • if ffmpeg doesn't work for re-encode, try [handbrake](https://handbrake.fr/) or [Media Coder](https://www.mediacoderhq.com/). Handbrake is used by professionals to convert vfr files to cfr. Both can be used for free, and are more user friendly than ffmpeg. If you want to be sure to be able to play it anywhere, you'll need to convert it to cfr in any case. – 1NN Dec 01 '21 at 18:14
  • Please note: if you don't tag people in your comments, using the @ in front of the username, such as `@BobC`, they won't know you've replied to them – 1NN Dec 01 '21 at 18:16
  • @1NN thanks. Handbrake seems to suffer the same difficulty as ffmpeg, and various attempts to set cfr in ffpmeg commands I've tried don't work because, as far as I can tell, both struggle to decode it in the first place. Author tells me "I used GoToMeeting on my Mac" which I don't think helps us very much. Anyway, it appears to be a mystery but since no longer supported Apple Quicktime can play it fine, perhaps since it originated on a mac, I'll have to go with re-recording it from there into Zoom or similar. – BobC Dec 03 '21 at 08:35
  • a last chance might be that in quicktime you can go on "Export to .." and save as a new file (i dont remember the options qt will give you). Maybe that new file can be converted easier. But otherwise, as you said, my original answer with a screen grabber (obs, zoom, whatever) is the surest bet. – 1NN Dec 04 '21 at 10:36

1 Answers1

0

If quality is not a big issue:

use an audio/video grabber such as OBS Studio, and capture the video while you play it back in Quicktime.

1NN
  • 5,232
  • 1
  • 17
  • 37
  • Thanks, yes, any answer that depended on re-capturing the QT playback would be a workaround. But, I'd like to try to understand what is causing the problem - nothing I've tried so far to analyse the file reports an error however playback is not as intended... – BobC Nov 29 '21 at 18:56