I
Immich•3y ago
Kryptonian

Transcoding difficulties

It seems that ffprobe is having difficulty so end result is no transcoded video. 🤔
[Nest] 1 - 04/10/2023, 1:35:38 PM ERROR [MediaService] Failed to handle video conversion for asset: ad2d646a-1b58-48dd-a6f2-81effb02bd67
Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input

at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
[Nest] 1 - 04/10/2023, 1:35:38 PM ERROR [MediaService] Failed to handle video conversion for asset: ad2d646a-1b58-48dd-a6f2-81effb02bd67
Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input

at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
32 Replies
bo0tzz
bo0tzz•3y ago
Have you pulled the file and checked if it plays OK etc?
Kryptonian
KryptonianOP•3y ago
Huh, it seems to be corrupt. Even exiftool says file format error.
bo0tzz
bo0tzz•3y ago
Might be tricky, but any chance you can find a version of the file from before it went into immich? Off your phone or such
Kryptonian
KryptonianOP•3y ago
What's the DB query to figure out the original file name from assetid?
bo0tzz
bo0tzz•3y ago
Good q, sec
Kryptonian
KryptonianOP•3y ago
It would be useful to have list of the main DB queries that one might need to figure out things like these somewhere documented.
bo0tzz
bo0tzz•3y ago
select "imageName" from exif where "assetId"='3852f850-38ad-4f20-898a-87ce392323cc';
Kryptonian
KryptonianOP•3y ago
Well, that show's nothing. :D There is nothing in exif table about it. Oh, right should use proper id. :D
bo0tzz
bo0tzz•3y ago
:')
Kryptonian
KryptonianOP•3y ago
Hmm, used ad2d646a-1b58-48dd-a6f2-81effb02bd67 and still nothing. Other ideas? :D @bo0tzz
bo0tzz
bo0tzz•3y ago
Hmmm Is there a Error in video metadata extraction log for that same asset? Cause if that job fails, it doesn't save the original name to the database And it likely would fail on a corrupt file as it does ffprobe
Kryptonian
KryptonianOP•3y ago
There is thumbnail errors, and the video conversion but no metadata.
bo0tzz
bo0tzz•3y ago
Can you run "extract missing metadata" and see what it does?
Kryptonian
KryptonianOP•3y ago
Well,
[Nest] 1 - 04/10/2023, 2:16:34 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type integer: "{"500"}"
QueryFailedError: invalid input syntax for type integer: "{"500"}"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:35 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:35 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:36 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:34 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type integer: "{"500"}"
QueryFailedError: invalid input syntax for type integer: "{"500"}"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:35 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:35 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
[Nest] 1 - 04/10/2023, 2:16:36 PM ERROR [MetadataExtractionProcessor] Error extracting EXIF QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async MetadataExtractionProcessor.extractExifInfo (/usr/src/app/dist/apps/microservices/apps/microservices/src/processors/metadata-extraction.processor.js:156:13)
Cannot know which asset it's talking about.
bo0tzz
bo0tzz•3y ago
Ooh fun That's the exif extract, not video metadata, so that's a different asset Both of those metdata jobs need better error handling. They're both wrapped in a huge try/catch that just gives up if anything goes wrong. They do still have some data that could be saved anyways (such as the original filename from upload).
Kryptonian
KryptonianOP•3y ago
Also the input should be sanitized/validated before trying to push to the db. ;)
bo0tzz
bo0tzz•3y ago
Yup
Kryptonian
KryptonianOP•3y ago
Let's see what happens:
Kryptonian
KryptonianOP•3y ago
No description
Kryptonian
KryptonianOP•3y ago
I originally only did "missing", so let's test all. Well, it doesn't log it properly so that's why I couldn't grep via assetid...
Error in video metadata extraction Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f698f10c640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f698f10c640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input

at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Error in video metadata extraction Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f698f10c640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f698f10c640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input

at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
@bo0tzz That definitely needs better error handling.
bo0tzz
bo0tzz•3y ago
GitHub
Metadata extraction jobs need better error handling · Issue #2229 ·...
Both the image exif and video metadata jobs need better error handling. Currently, both are wrapped in one big try/catch that just gives up on any errors. Meanwhile, any bad data that doesn't c...
bo0tzz
bo0tzz•3y ago
I can't think of a way to find the original filename in this case atm
Kryptonian
KryptonianOP•3y ago
Maybe originalPath in the assets table?
bo0tzz
bo0tzz•3y ago
You could take the path from the error -> where originalPath='' -> assetId, but it errored before the original filename was saved to the db, so that's just not in there
Kryptonian
KryptonianOP•3y ago
But it is select * from assets where "id"='ad2d646a-1b58-48dd-a6f2-81effb02bd67'; does return things.
bo0tzz
bo0tzz•3y ago
But it wouldn't return the filename as it was on your phone Because that's saved to the exif table by the job with bad error handling
Kryptonian
KryptonianOP•3y ago
Well, it kinda does. deviceAssetID has it as part of it (Uploaded from web)
bo0tzz
bo0tzz•3y ago
Oh, interesting, I didn't know it does that I thought that was always uuid So then you can locate the untouched pre-upload file, right? Is that also corrupted?
Kryptonian
KryptonianOP•3y ago
That would be correct.
bo0tzz
bo0tzz•3y ago
So immich didn't kill it then Phew 😅
Kryptonian
KryptonianOP•3y ago
But still that's... an interesting error case. Next question is how do I yeet the assets that don't have thumbs and/or exif?
bo0tzz
bo0tzz•3y ago
Yeah, idk if we can really do anything with files that are that broken. Maybe just shift it into a separate folder, log a big fat error, and forget about it? There's no easy way I think. Find them in the DB, manually clean them from assets table (and any relations, though on broken files those shouldn't've been created yet atm), and manually clean them off disk.

Did you find this page helpful?