RSS.About Mac OS X 10.6 (Snow Leopard) compatibility mov to get the sound to play in QuickLook/QuickTime/SaveHollywood. Then finally: ffmpeg -i ghost-concat.mp4 -i ghost-audio.mp3 -codec copy -shortest ghost-saver.mov I downloaded the OST from YouTube using youtube-dl, plugged it into Audacity, and exported a crop of the soundtrack that I wanted to use. $ ffmpeg -f concat -safe 0 -i filelist.txt -c copy ghost-concat.mp4Īnd now I had what I set out to do, but I felt that it could also do with some different music. So I concatenated them: $ cat filelist.txt Plugging these into SaveHollywood produced great results, but the transition between the two videos did include a half-second of a black screen, which was slightly jarring. Browsing i-frames.csv I settled on 47556, but after some trial and error I found the right one to be at the 00:33:02.898 timestamp.Īpply the same process to the end section for my first clip and to both start and end of my second clip, and I got: ffmpeg -i ghost-full.mp4 -ss "00:33:02.898" -to "00:33:52.905" -c copy ghost-1.mp4įfmpeg -i ghost-full.mp4 -ss "00:34:03.500" -to "00:36:19.969" -c copy ghost-2.mp4 So I needed an i-frame somewhere around frame 47568. show_entries stream=r_frame_rate ghost-full.mp4 To get the framerate: ffprobe -v 0 -of compact=p=0 -select_streams 0 \ To get the frame, you multiply by the framerate. The timestamp in seconds is: 33 * 60 4 = 1984 However, what I knew was the timestamp, 00:33:04, not the frame number. Then you can peek around vim i-frames.csv to see the exact frame numbers. To get the i-frames: cat ghost-frames.csv | grep -n I | cut -d ':' -f 1 > ghost-i-frames.csv This will output the full list of frames to a ghost-frames.csv file. of csv ghost-full.mp4 > ghost-frames.csv Re-encoding has the potential to introduce a loss of quality which is something I wanted to avoid.įinding the i-frames can be done with a tool that is part of the ffmpeg brew distribution, ffprobe: ffprobe -select_streams v -show_frames \ I found out that this was because of a concept called "index keyframes", or i-frames, which for this task were the only frames that I could crop from without re-encoding and without exporting gaps. It had a few seconds of no output in the beginning. I wrote a quick ffmpeg invocation to slice it: ffmpeg -i ghost-full.mp4 -ss "00:33:04" -to "00:33:53" \īut the resulting video didn't work correctly. I first scrubbed my copy of GitS to find the exact timestamps for the scenes that I want to export: 33:04 to 33:53 Producing the video turned out to be tricker than I initially thought. So that was a significant chunk of work done. But I stumbled on SaveHollywood, which is a macOS screensaver that allows you to supply any custom video(s) to play. My first idea was to fork JohnCoates/Aerial and repurpose it for this. I've wanted to create a screen saver that loops this scene over and over for a while, and I finally got around to doing it. Ghost in the Shell (1998) has a brief interlude containing gorgeously drawn scenes of a dystopian city modelled after Hong Kong. Creating a Ghost in the Shell screensaver for macOS 25 June 2017
0 Comments
Leave a Reply. |