The other day I tried to make a quick video of our Elf on the Shelf turning and winking at the camera. This was the final result:
I haven’t done any video editing like this before and I know that there are better tools for the job, but I wanted to stick with what I had. It came out OK for what it is! In summary, I recorded a video, split it into frames, edited the single frames and then put it all back together again. To have the elf turn his head I just removed the frames that included my arm reaching over to turn it’s head. The tools that I used on Linux were MPlayer/MEncoder and Gimp.
- Split the original mp4 into single frame JPGs. This will give you lots of JPG files with filenames in a numbered sequence:
mplayer original.mp4 -vo jpeg
- Extract the audio for the original movie:
mplayer -vc null -vo null -nocorrect-pts -ao pcm:waveheader original.mp4
- Convert the extracted audio to mp3:
lame -h -b 192 audiodump.wav audio.mp3
- Edit the frames that needed editing with Gimp. This was just making a few frames with the pixels over the eyelid closing. I saved each new frame with a filename that put it in the correct order when listed alphabetically with the other frames in the sequence.
- Remove the frames that I wanted to hide (my arm turning the elf’s head)
- Assemble the edited JPGs into a new movie with the original extracted audio:
mencoder mf://*.jpg -mf w=800800:h=453:fps=30:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -audiofile audio.mp3 -o new_movie.avi
test 1