New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New filmstrip #44
New filmstrip #44
Conversation
Thank you for noticing the Thank you for showing me what to do 🙇 |
I think it would make the math easier with fewer bugs in the app if we extracted all images onto a standard black background with consistent size regardless of the source video aspect ratio. I would opt for a This would require a bit of tricky The height (100px) and width (180px) are saved in the .vha file and every thumbnail and filmstrip preview simply uses those dimensions for computing which of the many screen-captures to show. |
The upshot of this approach is that within the app we can simply show the relevant region of the horizontal strip (which will have the black bars around each image within the jpg). |
I got a script to work, but it works by manually adding vertical stripes (no fun and requires a lot of annoying computation if we do what I described above) ... would prefer to do it another way: pasting into the center of a black rectangle of predetermined size, a (possibly cropped) video screenshot, and attaching the result to the horizontal stack. But for now:
ps - I know that my color bars |
There's a very similar question with a great answer on StackOverflow: |
This might be super close to what I want:
I'll work on it some more 👍 |
Branch now works as desired 🎉 |
Once this PR lands, this issue will be ready to work on: #39 |
|
This is happening for me even at 300px! 😕 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I like the simplicity! 🎉
Added a few comments on my first pass! 👍
I'll test on a more varied video sample soon to confirm everything still works! 💯
|
||
// sweet thanks to StackExchange! | ||
// https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player | ||
const fancyScaleFilter = 'scale=' + ratioString + ':force_original_aspect_ratio=decrease,pad=' + ratioString + ':(ow-iw)/2:(oh-ih)/2'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting an issue when I try to use a thumbnail size of 50px:
grep stderr: Stream mapping:
Stream #0:0 (h264) -> scale
Stream #1:0 (h264) -> scale
Stream #2:0 (h264) -> scale
Stream #3:0 (h264) -> scale
Stream #4:0 (h264) -> scale
Stream #5:0 (h264) -> scale
Stream #6:0 (h264) -> scale
Stream #7:0 (h264) -> scale
Stream #8:0 (h264) -> scale
Stream #9:0 (h264) -> scale
hstack -> Stream #0:0 (mjpeg)
Press [q] to stop, [?] for help
grep stderr: [swscaler @ 0x7fd12ada9a00] deprecated pixel format used, make sure you did set range correctly
grep stderr: [Parsed_pad_1 @ 0x7fd129099800] Input area 0:0:89:50 not within the padded area 0:0:88:50 or zero-sized
[Parsed_pad_1 @ 0x7fd129099800] Failed to configure input pad on Parsed_pad_1
grep stderr: Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
grep stderr: Error while processing the decoded data for stream #9:0
grep stderr: Conversion failed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Input area 0:0:89:50 not within the padded area 0:0:88:50
Looks like rounding error!
(mousemove)="mouseIsMoving($event)" | ||
[ngStyle]="{ | ||
height: imgHeight + 'px', | ||
'background-image': 'url(' + (hover ? fullFilePath : firstFilePath) + ')', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, apart from 2 things:
-
Can we make it so that the image doesn't flick back to the first image when you stop hovering?
-
We should sync up the image and video thumbnails (at least the first one) if we're going to do this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I made the preview flick back to the original image on purpose as requested by a customer. But since the settings menu is cleaner I can add more option toggles -- this one could be it.
- I rather like that the video thumbnail image (the
-first.jpg
) is different from any of the ones in the filmstrip. I'm happy to keep them different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Yes please! 👍 I like it staying where it is!
-
Hmm, it conflicts with option 1 though, if it doesn't reappear... maybe it isn't an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put in a settings button that will allow users to choose between retaining the last-viewed thumbnail or to always come back to the first preview image.
What other fixes would you like to see before we can merge this in? (I know there's more polish and bug-fixing to do before this PR is a fully-operational feature, but I'd rather patch them with subsequent PRs rather than spend many more days on this one) 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your happy with bug fixes and changes later - merge away! 🎉 👍
@@ -323,8 +333,8 @@ export function takeTenClips( | |||
concat += '[' + (current - 1) + ':v]' + '[' + (current - 1) + ':a]'; | |||
current++; | |||
} | |||
concat += 'concat=n=' + (totalCount - 1) + ':v=1:a=1'; | |||
args.push('-filter_complex', concat, saveLocation + '/' + fileHash + '.mp4'); | |||
concat += 'concat=n=' + (totalCount - 1) + ':v=1:a=1[v][a];[v]scale=' + screenshotHeight + ':-2[v2]'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realised, this is now backwards (generates 300px wide, not high)!
Should be -2:screenshotHeight
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll also confirm later whether we need -2 or -1!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this change from your other branch without looking into what it does -- feel free to edit anything in takeTenClips
method as you see fit 👍
Excellent! Thank you for the approval -- I'll merge this in now and get started on bug-fixing / improvement PR. 🎉 |
Thank you @cal2195 for the
ffmpeg
extraction code to get the images arranged horizontally and resized properly withhstack
👍I'd love to add black bars between the screens, I suppose 3px would be the best size, do you have any preferences?
I'll try to code it up but might turn to you for help again:
https://video.stackexchange.com/questions/18419/add-black-or-other-color-padding-when-doing-vstack-or-hstack
Cheers!