mirror of
https://github.com/immich-app/immich.git
synced 2025-08-07 09:04:09 -04:00
fix: video thumbnail generation for short videos (#20629)
fix video thumbnail generation for short videos ffmpeg gives conversion failed with error 234 for short mp4 files (less than 10s) that where converted from m2ts. Longer videos work fine. It looks like ffmpeg has no frames left to use for generating a thumbnail. This change fixes this issue and seems to not change the behaviour for other mp4 files (same thumbnail before and after change) This might also fix all mts file thumbnail generation.
This commit is contained in:
parent
6ddef3a7e4
commit
1ca46fbd98
@ -368,7 +368,7 @@ describe(MediaService.name, () => {
|
||||
'-frames:v 1',
|
||||
'-update 1',
|
||||
'-v verbose',
|
||||
String.raw`-vf fps=12:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,scale=-2:1440:flags=lanczos+accurate_rnd+full_chroma_int:out_range=pc`,
|
||||
String.raw`-vf fps=12:start_time=0:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,scale=-2:1440:flags=lanczos+accurate_rnd+full_chroma_int:out_range=pc`,
|
||||
],
|
||||
twoPass: false,
|
||||
}),
|
||||
@ -403,7 +403,7 @@ describe(MediaService.name, () => {
|
||||
'-frames:v 1',
|
||||
'-update 1',
|
||||
'-v verbose',
|
||||
String.raw`-vf fps=12:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,tonemapx=tonemap=hable:desat=0:p=bt709:t=bt709:m=bt709:r=pc:peak=100:format=yuv420p`,
|
||||
String.raw`-vf fps=12:start_time=0:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,tonemapx=tonemap=hable:desat=0:p=bt709:t=bt709:m=bt709:r=pc:peak=100:format=yuv420p`,
|
||||
],
|
||||
twoPass: false,
|
||||
}),
|
||||
@ -440,7 +440,7 @@ describe(MediaService.name, () => {
|
||||
'-frames:v 1',
|
||||
'-update 1',
|
||||
'-v verbose',
|
||||
String.raw`-vf fps=12:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,tonemapx=tonemap=hable:desat=0:p=bt709:t=bt709:m=bt709:r=pc:peak=100:format=yuv420p`,
|
||||
String.raw`-vf fps=12:start_time=0:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,tonemapx=tonemap=hable:desat=0:p=bt709:t=bt709:m=bt709:r=pc:peak=100:format=yuv420p`,
|
||||
],
|
||||
twoPass: false,
|
||||
}),
|
||||
|
@ -403,7 +403,7 @@ export class ThumbnailConfig extends BaseConfig {
|
||||
|
||||
getFilterOptions(videoStream: VideoStreamInfo): string[] {
|
||||
return [
|
||||
'fps=12:eof_action=pass:round=down',
|
||||
'fps=12:start_time=0:eof_action=pass:round=down',
|
||||
'thumbnail=12',
|
||||
String.raw`select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20)`,
|
||||
'trim=end_frame=2',
|
||||
|
Loading…
x
Reference in New Issue
Block a user