diff --git a/.claude/settings.local.json b/.claude/settings.local.json index e0b5a4b..b69b7da 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -15,7 +15,16 @@ "Bash(go test ./...:*)", "Bash(git:*)", "mcp__aide__*", - "Bash(docker compose build *)" + "Bash(docker compose build *)", + "Bash(ffmpeg -loglevel error -i /home/dzecevic/repos/CamMonitor/testdata/footage/20260101/record/A260101_120000_120015.265 -c:v copy -movflags frag_keyframe+empty_moov -f mp4 /dev/null)", + "Bash(ffmpeg -loglevel error -i /home/dzecevic/repos/CamMonitor/footage/record/A260520_153838_153852.265 -c:v copy -movflags frag_keyframe+empty_moov -f mp4 /tmp/test_stream.mp4)", + "Bash(echo \"exit: $?\")", + "Read(//tmp/**)", + "Bash(ffmpeg -loglevel error -ss 0 -i /home/dzecevic/repos/CamMonitor/footage/record/A260520_153838_153852.265 -vframes 1 -vf scale=160:90:force_original_aspect_ratio=decrease -f image2 -vcodec mjpeg /tmp/test_thumb.jpg)", + "Bash(ffmpeg -loglevel warning -ss 0 -i /home/dzecevic/repos/CamMonitor/footage/record/A260520_153838_153852.265 -vframes 1 -vf scale=160:90:force_original_aspect_ratio=decrease -f image2 -vcodec mjpeg /tmp/test_thumb.jpg)", + "Bash(ffmpeg -loglevel error -i /home/dzecevic/repos/CamMonitor/footage/record/A260520_153838_153852.265 -ss 0 -vframes 1 -vf scale=160:90:force_original_aspect_ratio=decrease -f image2 -vcodec mjpeg /tmp/test_thumb2.jpg)", + "Bash(mv /home/dzecevic/repos/CamMonitor/footage/images/* /home/dzecevic/repos/CamMonitor/footage/20260520/images/)", + "Bash(mv /home/dzecevic/repos/CamMonitor/footage/record/* /home/dzecevic/repos/CamMonitor/footage/20260520/record/)" ] } } diff --git a/footage/20260520/images/A26052016045712.jpg b/footage/20260520/images/A26052016045712.jpg new file mode 100644 index 0000000..65185cb --- /dev/null +++ b/footage/20260520/images/A26052016045712.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8868cdf640a93052fe25e053dcafb27d7ecf673c5396c5d99b5f260d1748cd56 +size 443776 diff --git a/footage/20260520/images/A26052016290210.jpg b/footage/20260520/images/A26052016290210.jpg new file mode 100644 index 0000000..076ea70 --- /dev/null +++ b/footage/20260520/images/A26052016290210.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ba3f2b42e3e1808d396aa542b99c73821670b5d7a7241e500318c62a98712d +size 432951 diff --git a/footage/20260520/record/A260520_153838_153852.265 b/footage/20260520/record/A260520_153838_153852.265 new file mode 100644 index 0000000..6aca0ff --- /dev/null +++ b/footage/20260520/record/A260520_153838_153852.265 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fec5d0df9aef981b6e54fc0b7392873bd4edc5669acd100e49f2903a0f08ba04 +size 1366005 diff --git a/footage/20260520/record/A260520_160454_160509.265 b/footage/20260520/record/A260520_160454_160509.265 new file mode 100644 index 0000000..420ace2 --- /dev/null +++ b/footage/20260520/record/A260520_160454_160509.265 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:726d3f76ff30a59baf118baabed0eb88c8e5c35ccb1e52b3795fcd9f38dc91ef +size 1586743 diff --git a/internal/video/thumb.go b/internal/video/thumb.go index 6c9a2c3..dc2c16b 100644 --- a/internal/video/thumb.go +++ b/internal/video/thumb.go @@ -44,8 +44,12 @@ func (c *Cache) Thumbnail(absPath string) ([]byte, error) { cmd := exec.Command( c.ffmpegPath, "-loglevel", "error", - "-ss", "0", "-i", absPath, + // -ss must come AFTER -i for raw H.265 bitstreams. + // Input seeking (-ss before -i) requires an index that raw streams lack, + // causing "could not seek to position 0.000" and an empty output. + // Output seeking (-ss after -i) decodes from the start and is reliable. + "-ss", "0", "-vframes", "1", "-vf", fmt.Sprintf("scale=%d:%d:force_original_aspect_ratio=decrease", thumbnailWidth, thumbnailHeight), "-f", "image2", diff --git a/internal/web/templates/images.html b/internal/web/templates/images.html index 44c0886..e2b82a0 100644 --- a/internal/web/templates/images.html +++ b/internal/web/templates/images.html @@ -25,10 +25,32 @@ -
- {{.Current.Filename}} - Prev - Next + +
+ + {{.Current.Filename}} + + + + + + + + + + + +