GithubHelp home page GithubHelp logo

wave-mezzanine's Introduction

Creating WAVE mezzanine content from Tears of Steel (ToS)

Tools Used

Steps

  1. Download 1080p version of ToS from the Blender mirror site:
    wget http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov
  2. Extract a lossless 30-second segment from ToS, add top and bottom black bars to make it 16:9 aspect, 30fps, remove audio track:
    ffmpeg -i ToS-4k-1920.mov -ss 00:00:07.250 -t 00:00:30.0 -c:v libx264 -preset slower -crf 5 -filter:v "pad=1920:1080:0:140,setsar=1,fps=fps=30" -an tos-30sec-video-16-9.mp4
  3. Create a thirty-second audio track with beep every 5 seconds:
    ffmpeg -f lavfi -i "sine=beep_factor=4:duration=30" -c:a "aac" -b:a 320k -ac 2 tos-30sec-audio.m4a
  4. Export video frames at 30fps to sequence of lossless PNGs:
    mkdir frames && ffmpeg -y -i tos-30sec-video-16-9.mp4 -filter_complex "fps=fps=30" frames/%d.png
  5. Write a list of the PNGs to a text file:
    ls frames | sort -n -k1.1 > images.txt
  6. Export the timecodes of the video frames to a text file, using 00:00:00.000000 time format (ffprobe doesn't support 00:00:00.000 notation):
    ffprobe -f lavfi -i "movie=tos-30sec-video-16-9.mp4,fps=fps=30" -show_frames -show_entries frame=pkt_pts_time -sexagesimal -of csv=p=0 > frametimes.txt
  7. Trim trailing three millisecond digits from lines in frametimes.txt (must round up the remaining three because ffmpeg pts format is H:MM:SS.sss):
    awk 'BEGIN{OFS=FS=":"}{ $3=sprintf("%06.3f", $3) }1' frametimes.txt > frametimes-sss.txt
  8. Combine PNGs with frame timecodes into a tab-delimited text file:
    paste images.txt frametimes-sss.txt > images-frametimes.txt
  9. Generate QR codes (six-character clip ID, frame timestamp) for every frame.
    ./qrencode.sh
  10. Apply QR codes to export PNGs (note that this script will take a while).
    ./imagemagick.sh
  11. Use QR'd PNGs as sources to generate lossless MP4 file with QR codes and timecode box:
    ffmpeg -framerate 30 -start_number 0 -i "composited/%d.png" -c:v libx264 -preset slower -crf 5 -filter_complex "format=yuv420p,fps=fps=30,drawtext=fontfile=/usr/share/fonts/truetype/cousine/Cousine-Regular.ttf: text='%{pts \:hms}': x=(w-tw)/2: y=h-(4*lh): fontcolor=white: fontsize=60: box=1: boxborderw=20: boxcolor=Black" tos-qrs.mp4
  12. Create frame boundary markers overlay in Gimp, export to PNG (see boundaries.xcf and boundaries.png).
  13. Create final file with frame boundary overlay and audio:
    ffmpeg -y -i tos-qrs.mp4 -i boundaries.png -i tos-30sec-audio.m4a -c:v libx264 -preset slower -crf 5 -filter_complex "[0:v][1:v] overlay=0:0,format=yuv420p,fps=fps=30" -c:a "aac" -b:a 320k -ac 2 tos-30sec-final.mp4
  14. Verify tos-30sec-final.mp4 playback in VLC. Mobile QR reader apps are available in the Apple and Google stores to verify the QR codes in each frame against the timecode.

wave-mezzanine's People

Contributors

johnluther avatar

Watchers

 avatar James Cloos avatar

Forkers

haudiobe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.