0

I have the raw video data from a video stream (no audio) and the duration when I play the raw video in VLC is ~67 seconds. When I convert the file to MP4 using FFMPEG the duration is 82.68 seconds.

Video is available here: https://www.filedropper.com/showdownload.php/67seconds I am using FFMPEG/FFPROBE version git-2020-07-21-b5f1e05 on Windows.

Details of the raw video here:

ffprobe -i 67seconds.raw
ffprobe version git-2020-07-21-b5f1e05 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 97.100 / 58. 97.100
  libavformat    58. 49.100 / 58. 49.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, h264, from '67seconds.raw':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc

The mp4 duration matches my ffprobe calculation against the raw file itself (2067/25 = 82.68 seconds):

ffprobe -show_entries stream=r_frame_rate,nb_read_frames -select_streams v -count_frames -of compact=p=0:nk=1 -v 0 67seconds.raw
25/1|2067

What would explain this difference in durations between the raw playback and the FFMPEG interpretation and how do I encode to the same duration for this and other stream data?

LMB
  • 21
  • 2
  • Sounds like VLC is playing it at 30 fps. Does that speed look right? – Gyan Jul 28 '20 at 05:03
  • Technically 29.970030 (in my VLC), but yes! Thanks for that. Am I correct in thinking I need to use this format to encode to the same speed as VLC? 'ffmpeg -i 67seconds.raw -r 30 -vf "setpts=0.8333*PTS" 67seconds.mp4' – LMB Jul 28 '20 at 07:50
  • No need to re-encode. `ffmpeg -itsscale 0.834167 -i input -c copy out.mp4` – Gyan Jul 28 '20 at 08:11
  • That mp4 is still 82 seconds? `Duration: 00:01:22.68` – LMB Jul 28 '20 at 09:49

0 Answers0