Open gregorydimitriadis opened 1 year ago
Hmm…
We have been using flipped versions of the videos in our RIT data collection.
On Sep 22, 2022, at 3:13 PM, Greg Dimitriadis @.***> wrote:
Flipping video tool - to be coordinated with Augustine. He made an attempt, but the result was not synchronized with the original video. I don’t know whether he has an idea for fixing that problem…
— Reply to this email directly, view it on GitHub https://github.com/DCS-LCSR/SignStream3/issues/565, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADH7NQQ6U7U3HFKT6JLFRP3V7SVVTANCNFSM6AAAAAAQTLEMGI. You are receiving this because you are subscribed to this thread.
I can confirm what is reported here -- i.e., that the flipped videos we have been using are not synchronized with the originals. That is not a problem for the files we have already annotated, but it is something that should be addressed in the future for left-handed signer videos we may wish to convert. Thanks. @kwasiopoku
FYI - @kwasiopoku
RIT is now flipping left-handed videos they are collecting (and the flipped videos are synchronized with the originals). They are also doing some other editing (cropping, etc.) at the same time. Here's how Caluã says they are doing it, for future reference:
as we discussed, here's the FFMPEG command I'm using:
ffmpeg -ss 300 -i A001_09112205_C003.mov -frames:v 1800 -filter:v "[0:v]crop=out_h=in_h:out_w=1080[a];[a]hflip" -pix_fmt yuv420p -c:v libx264 -preset veryfast -crf 25 flipped.mov
I'll give a rundown of what it does:
ffmpeg: invokes the program
-ss 300: this -ss command is used to cut the video from a specific start point. The 300 number is in seconds.
-i A001... : this is the input file. For instance, here I'm selection the original camera file (around 50Gb)
-frames:v 1800: this specifies when the cut should end. If omitted it'll be cut at the end of the file. Unlike -ss, the number here is in frames, so you might need to know the frame rate of the video (in our case it's 60 frames per second, so in this example, I'm getting 30 seconds of video)
-filter:v : this invokes a complex filter, i.e., a stream of multiple filters done in sequence.
[0:v]crop=out_h=in_h:out_w=1080[a]; : this command makes the square crop. [0:v] selects the video*, crop=out_h=in_h:out_w=1080 crops it in a square, [a] identifies this new, cropped video.
[a]hflip : this selects the result from the crop ([a]) and flips it horizontally.
-pix_fmt yuv420p: this sets the pixel format to the yuv420p setting (not having this was what was causing the issue with Quicktime 😓)
-c:v libx264 -preset veryfast -crf 25: this encodes the output using the h264 codec. Even at the
veryfast
setting this can be slooow.
flipped.mov: the output file name.
This video selection syntax is potentially much more complex, but I didn't read too much into it since our use case was relatively simple.
I'm sharing this as general documentation of the process, but if you just want to mirror a video you can use:
ffmpeg -i INPUT.mp4 -vf hflip -c:a copy OUTPUT.mp4
Flipping video tool - to be coordinated with Augustine. He made an attempt, but the result was not synchronized with the original video. I don’t know whether he has an idea for fixing that problem…