ehendrix23/tesla_dashcam

ffmpeg errors regarding AVOption preset and crf

jdandrea opened this issue · 6 comments

Given four directories pulled from TeslaCam/SavedClips, each with a number of mp4 files:

2019-05-22_09-53-05
2019-05-22_11-09-33
2019-05-22_12-13-43
2019-05-22_19-45-28

...and this command (using v0.1.9):

tesla_dashcam . --merge --output 2019-05-22.mp4 --layout WIDESCREEN --rear

The following errors are returned:

Error trying to create movie 2019-05-22_19-45-28.mp4

Codec AVOption preset (Configuration preset) specified for output file # 0 (2019-05-22_19-45-28.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

Codec AVOption crf (Select the quality for constant quality mode) specified for output file # 0 (2019-05-22_19-45-28.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

Output 2019-05-22_19-45-28.mp4 same as Input # 10 - exiting

FFmpeg cannot edit existing files in-place.

The 2019-05-22_19-45-28 directory looks fine though, and all the files are mp4 and playable. Thoughts welcomed!

More details...

Command

/var/folders/f5/gvbmrpj94lnbmpg79y20j37w0000gn/T/_MEIpdJblp/ffmpeg -i 2019-05-22_19-36-19.mp4 -i 2019-05-22_19-37-20.mp4 -i 2019-05-22_19-38-20.mp4 -i 2019-05-22_19-39-20.mp4 -i 2019-05-22_19-40-20.mp4 -i 2019-05-22_19-41-21.mp4 -i 2019-05-22_19-42-21.mp4 -i 2019-05-22_19-43-21.mp4 -i 2019-05-22_19-44-21.mp4 -i 2019-05-22_19-45-22.mp4 -i 2019-05-22_19-45-28.mp4 -filter_complex [0:v:0] [1:v:0] [2:v:0] [3:v:0] [4:v:0] [5:v:0] [6:v:0] [7:v:0] [8:v:0] [9:v:0] [10:v:0] concat=n=11:v=1:a=0 [v] -map [v] -preset medium -crf 28 -b:v 2500K -c:v h264_videotoolbox -y 2019-05-22_19-45-28.mp4

Input

ffmpeg version N-93225-g37e4c226c0-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.102 / 58. 47.102
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-36-19.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.92, start: 0.000000, bitrate: 2622 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2621 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-37-20.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.92, start: 0.000000, bitrate: 2626 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2625 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-38-20.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.72, start: 0.000000, bitrate: 2620 kb/s
    Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2619 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-39-20.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.96, start: 0.000000, bitrate: 2619 kb/s
    Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2618 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-40-20.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.96, start: 0.000000, bitrate: 2632 kb/s
    Stream #4:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2631 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #5, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-41-21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.72, start: 0.000000, bitrate: 2632 kb/s
    Stream #5:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2631 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #6, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-42-21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.96, start: 0.000000, bitrate: 2620 kb/s
    Stream #6:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2619 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #7, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-43-21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.92, start: 0.000000, bitrate: 2622 kb/s
    Stream #7:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2621 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #8, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-44-21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.92, start: 0.000000, bitrate: 2607 kb/s
    Stream #8:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2606 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #9, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-45-22.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:59.92, start: 0.000000, bitrate: 2610 kb/s
    Stream #9:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 2609 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #10, mov,mp4,m4a,3gp,3g2,mj2, from '2019-05-22_19-45-28.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.101
  Duration: 00:00:05.92, start: 0.000000, bitrate: 3040 kb/s
    Stream #10:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x480 [SAR 1:1 DAR 4:1], 3038 kb/s, 25 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      handler_name    : VideoHandler

Regarding the third error, I just noticed the ffmpeg output filename matches one of the input filenames. Unsure how to fix via tesla_dashcam though.

When the command runs it provides more output. Like this:
GPU acceleration is enabled Discovered 2 folders with 2 clips to process. Processing 1 clips in folder /users/ehendrix/Desktop/Dashcam/TeslaCam/SavedClips/2019-02-25_16-45-35 (1/2) Processing clip 1/1 from 02/25/19 16:35:28 and 60 seconds long. Creating movie /users/ehendrix/Desktop/Dashcam/2019-02-25_16-45-35.mp4, please be patient. Movie /users/ehendrix/Desktop/Dashcam/2019-02-25_16-45-35.mp4 for folder /users/ehendrix/Desktop/Dashcam/TeslaCam/SavedClips/2019-02-25_16-45-35 is ready.

Can you provide that? That will tell me each file it creates etc within the folders to understand why it has duplicate filenames (hopefully).

One other thing, what firmware are you on in your Tesla?

OK, found it. With new firmware Tesla changed the filenames resulting in sometimes the possibility of the folder name being the same as the filename for the last minute clip within the folder.
Changing the file we're creating now to be the start and end timestamp instead, and thus preventing this from happening. :-)

FYI,

Just released test version that includes a fix for this:
https://github.com/ehendrix23/tesla_dashcam/releases/tag/v0.1.10b0

Release v.0.1.10 has been made available with the fix:
https://github.com/ehendrix23/tesla_dashcam/releases/tag/v0.1.10