ffmpeg - error processing files generated by premier pro 2022 - ffmpeg

Please help with the error, trying to re-encode the source file produced with prores 4444+alpha. Alpha channel is required in my case.
I've tried two separate options, both are erroring out:
$ ffmpeg -i Input.mxf -vcodec prores_ks -profile:v 4 -y Output.mxf
I'm getting this output
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 12.0.5 (clang-1205.0.22.9)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mxf, from 'Input.mxf':
Metadata:
operational_pattern_ul: 060e2b34.04010101.0d010201.01010100
uid : b52947e8-d982-11ec-9a2d-b42e99ab5f4d
generation_uid : b52947e9-d982-11ec-a612-b42e99ab5f4d
company_name : Adobe Inc.
product_name : Premiere Pro
product_version_num: 2.0.0.0.1
product_version : 22.4.0
application_platform: Mac OS X
product_uid : 0c3919fe-46e8-11e5-a151-feff819cdc9f
toolkit_version_num: 5.3.6.0.1
modification_date: 2022-05-22T03:53:15.000000Z
material_package_umid: 0x060A2B340101010501010D1113000000F88BD5002197058861C9B42E99AB5F4D
timecode : 00:00:00;00
Duration: 00:00:59.66, start: 0.000000, bitrate: 32803 kb/s
Stream #0:0: Video: prores (4444) (ap4h / 0x68347061), yuva444p12le(tv, bt709, progressive), 1920x1080, SAR 1:1 DAR 16:9, 29.97 tbr, 29.97 tbn, 29.97 tbc
Metadata:
file_package_umid: 0x060A2B34010101050101051213D028BEF88BD500219705880089B42E99AB5F4D
file_package_name: Source Package
track_name : Track 1
Stream mapping:
Stream #0:0 -> #0:0 (prores (native) -> prores (prores_ks))
Press [q] to stop, [?] for help
Output #0, mxf, to 'Output.mxf':
Metadata:
operational_pattern_ul: 060e2b34.04010101.0d010201.01010100
uid : b52947e8-d982-11ec-9a2d-b42e99ab5f4d
generation_uid : b52947e9-d982-11ec-a612-b42e99ab5f4d
timecode : 00:00:00;00
material_package_umid: 0x060A2B340101010501010D1113000000F88BD5002197058861C9B42E99AB5F4D
product_version_num: 2.0.0.0.1
modification_date: 2022-05-22T03:53:15.000000Z
application_platform: Mac OS X
product_uid : 0c3919fe-46e8-11e5-a151-feff819cdc9f
toolkit_version_num: 5.3.6.0.1
encoder : Lavf58.76.100
Stream #0:0: Video: prores (ap4h / 0x68347061), yuva444p10le(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn
Metadata:
file_package_umid: 0x060A2B34010101050101051213D028BEF88BD500219705880089B42E99AB5F4D
file_package_name: Source Package
track_name : Track 1
encoder : Lavc58.134.100 prores_ks
[mxf # 0x7fbbbc008200] could not get prores profile0:00.00 bitrate=N/A speed= 0x
av_interleaved_write_frame(): Operation not permitted
Error writing trailer of Output.mxf: Unknown error occurred
frame= 33 fps= 27 q=-0.0 Lsize= 0kB time=00:00:00.03 bitrate= 0.0kbits/s speed=0.027x
video:67kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
Above I can't even fully see the error since the red text over black background covers the screen:
I have also tried the following encoding options:
-c:v qtrle -pix_fmt argb
to which, I'm getting the following error:
track 0: could not find essence container ul, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Error initializing output stream 0:0 --
Conversion failed!
In case this is helpful, I'm displaying MediaInfo for the source file:

Don't use mxf wrapper, I've had this issue before, what helped is to process the output as MOV. This solved my issue and this is how I request agency to send me their output, if alpha is needed:
Preset: custom
Format: QuickTime
Video Codec: Animation
then, under basic video settings:
expend more
Depth, and choose 8-bpc+alpha

Related

Wrong video duration and fps

I recorded a RTSP stream(4K) via VLC for about an hour and something odd happened.
The file size is 6.6 GB, but the video length is only 12 minutes long.
When I play it on VLC, the progress bar reaches the end, but the video still plays continuously.
Add to that, its FPS is 213, although playing speed is 30 FPS.
I tried below commands, but couldn't fix the issue.
$ ffmpeg -i <INPUT.mp4> -filter:v fps=fps=30 <OUTPUT.mp4>
// Only returns a 12 minutes long video
$ ffmpeg -vsync drop -i <INPUT.mp4> -map 0:v -vcodec copy output.mp4
// Crashes immediately
ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x55ed710400c0] st: 0 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 # 0x55ed710400c0] st: 0 edit list 1 Cannot find an index entry before timestamp: 0.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from <INPUT.mp4>:
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: mp41avc1
creation_time : 2021-11-20T01:02:54.000000Z
encoder : vlc 3.0.16 stream output
encoder-eng : vlc 3.0.16 stream output
Duration: 00:11:42.58, start: 0.000000, bitrate: 74723 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 74694 kb/s, 30.07 fps, 120 tbr, 1000k tbn, 60 tbc (default)
Metadata:
creation_time : 2021-11-20T01:02:54.000000Z
handler_name : VideoHandler
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: mp41avc1
encoder : Lavf58.45.100
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 74694 kb/s, 30.07 fps, 120 tbr, 1000k tbn, 1000k tbc (default)
Metadata:
creation_time : 2021-11-20T01:02:54.000000Z
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 # 0x55ed71043180] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
av_interleaved_write_frame(): Invalid argument
frame= 1 fps=0.0 q=-1.0 Lsize= 0kB time=-577014:32:22.77 bitrate=N/A speed=N/A
video:623kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
Although I couldn't restore the full file due to corrupted frames, I want to share the progress.
MP4Box supports changing the framerate without re-encoding
$ MP4Box -single 1 -raw 1 <INPUT_MP4_FILE>
It will return two files, <INPUT_MP4_FILE>_track1.mp4 and <INPUT_MP4_FILE>_track1.h264.
<INPUT_MP4_FILE>_track1.mp4 is a file with the correct fps and duration.
For my video, the file stops at 54:17 (the total length is 1:23:17),and I believe it's due to corrupted frames.
Reference

Empty stream when cutting a video using ffmpeg

When I try cutting a video, it outputs an empty stream (262 byte video with 0s duration). Would appreciate any insight, thanks.
Command used:
ffmpeg -i /path/to/long/video.mp4 -ss 37.69 -t 4.96 -c copy /path/to/short/video.mp4
However, when I the following (more inaccurate) command, it outputs a video. This video also has some problems, as the last frame is repeated several times, making the video one second longer (with a frozen image for one second).
ffmpeg -ss 37.69 -i /path/to/long/video.mp4 -t 4.96 -c copy /path/to/short/video.mp4
ffmpeg version: ffmpeg version 3.4.6-0ubuntu0.18.04.1
The outputs for the two commands are:
First command:
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/proj/vondrick/datasets/HowTo100M/video/Cars_&_Other_Vehicles/Motorcycles/52907/video_nVbIUDjzWY4.mp4':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6avc1mp41
creation_time : 2015-06-26T00:39:04.000000Z
Duration: 00:07:14.40, start: 0.000000, bitrate: 244 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2015-06-26T00:39:04.000000Z
handler_name : VideoHandler
Output #0, mp4, to '/proj/vondrick/datasets/HowTo100M/cropped_video/Cars_&_Other_Vehicles/Motorcycles/52907/nVbIUDjzWY4/video_000000_p.mp4':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6avc1mp41
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2015-06-26T00:39:04.000000Z
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Second command:
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/proj/vondrick/datasets/HowTo100M/video/Cars_&_Other_Vehicles/Motorcycles/52907/video_nVbIUDjzWY4.mp4':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6avc1mp41
creation_time : 2015-06-26T00:39:04.000000Z
Duration: 00:07:14.40, start: 0.000000, bitrate: 244 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2015-06-26T00:39:04.000000Z
handler_name : VideoHandler
Output #0, mp4, to '/proj/vondrick/datasets/HowTo100M/cropped_video/Cars_&_Other_Vehicles/Motorcycles/52907/nVbIUDjzWY4/video_000000_3.mp4':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6avc1mp41
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2015-06-26T00:39:04.000000Z
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 159 fps=0.0 q=-1.0 Lsize= 159kB time=00:00:04.95 bitrate= 263.0kbits/s speed=1.89e+03x
video:158kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.909119%
Two issues:
3.4 is old. Update to a recent build before doing anything else. For Linux you can download or compile.
Cuts are not guaranteed to be accurate when using stream copy mode (-c copy) with H.264 and other similar formats because it will need to include all of the other frames necessary to decode the segment. So either cut on keyframes or re-encode by removing -c copy.

Are there differences between the parameters of different versions of ffmpeg?

I want to obtain a different raw video for each frame of an MP4 file.
My instruction works in an old version of ffmpeg but not in the new one.
In the mp4 file there are 137 frames. It is checked. The versions are installed on different machines.
Versions 2.8.15:
$ ffmpeg -i ./video.mp4 -vf fps=30 -vframes 137 -vcodec rawvideo -s '1920x1080' -pix_fmt gray -threads 0 frame%08d.raw
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
creation_time : 2019-03-11 16:16:54
Duration: 00:00:04.57, start: 0.000000, bitrate: 14014 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 13816 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default)
Metadata:
creation_time : 2019-03-11 16:16:54
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2019-03-11 16:16:54
Output #0, image2, to 'frame%08d.raw':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
encoder : Lavf56.40.101
Stream #0:0(eng): Video: rawvideo (Y800 / 0x30303859), gray, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2019-03-11 16:16:54
encoder : Lavc56.60.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
frame= 137 fps= 73 q=-0.0 Lsize=N/A time=00:00:04.56 bitrate=N/A dup=1 drop=0
video:277425kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Version 4.1.4:
$ ffmpeg -i ./video.mp4 -vf fps=30 -vframes 137 -vcodec rawvideo -s '1920x1080' -pix_fmt gray -threads 0 frame%08d.raw
ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x558d1a5bb880] st: 0 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 # 0x558d1a5bb880] st: 0 edit list 1 Cannot find an index entry before timestamp: 0.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
creation_time : 2019-03-11T16:16:54.000000Z
Duration: 00:00:04.57, start: 0.000000, bitrate: 14014 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 13816 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default)
Metadata:
creation_time : 2019-03-11T16:16:54.000000Z
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2019-03-11T16:16:54.000000Z
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'frame%08d.raw':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
encoder : Lavf58.20.100
Stream #0:0(eng): Video: rawvideo (Y800 / 0x30303859), gray, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 497664 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2019-03-11T16:16:54.000000Z
encoder : Lavc58.35.100 rawvideo
frame= 136 fps= 25 q=-0.0 Lsize=N/A time=00:00:04.53 bitrate=N/A speed=0.834x
video:275400kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
In the latest version, I expect 137 files but the amount is 136.
The old version did not have support for edit lists. Technically, some frames are not meant for presentation but only as reference, but since you want all frames, use
ffmpeg -ignore_editlist 1 -i ./video.mp4 -vsync 0 -c:v rawvideo -s '1920x1080' -pix_fmt gray frame%08d.raw

ffmpeg lose frames when extracting them

When I extract all frames from a video, FFmpeg lose one frame. I tried multiple options, like adding more parameters to the function, but none of them worked.
ffmpeg -i Multicam420-30a.mp4 -framerate 30 frame%08d.jpg
ffmpeg version N-94077-g01d8c72b95 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190621
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-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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 29.100 / 56. 29.100
libavcodec 58. 53.100 / 58. 53.100
libavformat 58. 28.100 / 58. 28.100
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 55.100 / 7. 55.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0000023af91f9e80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 # 0000023af91f9e80] st: 0 edit list 1 Cannot find an index entry before timestamp: 0.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Multicam420-30a.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
creation_time : 2019-08-20T01:30:57.000000Z
Duration: 00:00:01.00, start: 0.000000, bitrate: 11208 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 11007 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default)
Metadata:
creation_time : 2019-08-20T01:30:57.000000Z
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2019-08-20T01:30:57.000000Z
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler # 0000023afb923740] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'frame%08d.jpg':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41mp42
encoder : Lavf58.28.100
Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2019-08-20T01:30:57.000000Z
encoder : Lavc58.53.100 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 29 fps= 17 q=24.8 Lsize=N/A time=00:00:00.96 bitrate=N/A speed=0.557x
video:3153kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
As you can see, the original video has 30 frames and last 1 second, and the output frames are 29 and less than a second.

ffmpeg frame rate issue h264+ass to mkv

I'm using this command for ffmpeg:
ffmpeg -i 1.h264 -i ass1.ass -map 0 -map 1 -c copy test.mkv
The h264 file is 30 fps... the mkv plays at 25fps so it runs slow
The h264 come off my hd webcam. If i change the frame rate on the camera to 25 it works fine and 15fps wilk play at high speed. I can force the frame rate? Every if i need a different command line tool to change it that is acceptable. But if i could fix it form ffmpeg that would be ideal. I'm running the commands from vb.net.
command output
C:\Record\Normal\2013-06-27>c:\ffmpeg\bin\ffmpeg -i 1.h264 -i ass1.ass -map 0 -
map 1 -c copy test.mkv
ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers
built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil 52. 37.101 / 52. 37.101
libavcodec 55. 17.100 / 55. 17.100
libavformat 55. 10.100 / 55. 10.100
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 77.101 / 3. 77.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, h264, from '1.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuv420p, 1920x1088 [SAR 1:1 DAR 30:17],
25 fps, 25 tbr, 1200k tbn, 50 tbc
Input #1, ass, from 'ass1.ass':
Duration: N/A, bitrate: N/A
Stream #1:0: Subtitle: ssa
File 'test.mkv' already exists. Overwrite ? [y/N] y
Output #0, matroska, to 'test.mkv':
Metadata:
encoder : Lavf55.10.100
Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1920x1088 [SAR 1:1 DA
R 30:17], q=2-31, 25 fps, 1k tbn, 1200k tbc
Stream #0:1: Subtitle: ssa
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 144 fps=0.0 q=-1.0 Lsize= 2451kB time=00:00:05.72 bitrate=3509.6kbits
/s
video:2447kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.125529%
Eg. To force the frame rate of the output file to 24 fps (-r):
ffmpeg -i input.avi -r 24 output.avi

Resources