Code Monkey home page Code Monkey logo

chuck-renderer's Introduction

chuck-renderer

Docker Automated build

Docker image for ChucK rendering as a service with .wav to .m4a conversion with FFMPEG.

Build

  1. Install Docker: brew cask install docker
  2. Launch Docker.app from the Applications folder to complete installation
  3. Clone this repository: git clone [email protected]:markcerqueira/chuck-renderer.git
  4. Go into the directory: cd chuck-renderer
  5. Build the image: . ./compile.sh
  6. Any time you make changes you can stop the old image and rebuild the new one by running: . ./compile.sh

ID is now set to the container id of the image and docker ps will show the chuck-renderer running:

~ echo $ID
0b40c14f68de4770c752da68b1092d09390a04eaf252965bcffa31eb51ae4220
~ docker ps
CONTAINER ID        IMAGE               COMMAND                   PORTS 
0b40c14f68de        chuck-renderer      "thin -R config.ru -p"    0.0.0.0:9000->9000/tcp

How to do stuff:

  • The local server in server/app.rb can be accessed with a browser by visiting 0.0.0.0:9000/.
  • Accessing 0.0.0.0:9000/debug displays the debug console.
  • The image can be stopped with docker stop $ID. docker ps will list container ids if $ID is incorrect for some reason.
  • Logs can be access with docker logs $ID.
  • To get shell access to the running image: sudo docker exec -i -t $ID /bin/bash. Type exit in this shell to exit.

Resources

chuck-renderer's People

Contributors

markcerqueira avatar spencersalazar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chuck-renderer's Issues

Quiet down ffmpeg logs

For each .wav to .m4a conversion, ffmpeg outputs the a large chunk of log statements (see below). We don't need this much information. Configure/compile/run ffmpeg to log less.

ffmpeg version git-2017-01-14-3ac46a0 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-libfdk-aac
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 72.100 / 57. 72.100
  libavformat    57. 62.100 / 57. 62.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 69.100 /  6. 69.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'resources/57b1f2b4c994b66bf82d9f65308ffeafa5824b7e2469b7ecbffbdf99d6f7de57.wav':
  Duration: 00:00:30.00, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
[libfdk_aac @ 0x2440ee0] Note, the VBR setting is unsupported and only works with some parameter combinations
Output #0, ipod, to 'resources/57b1f2b4c994b66bf82d9f65308ffeafa5824b7e2469b7ecbffbdf99d6f7de57.m4a':
  Metadata:
    encoder         : Lavf57.62.100
    Stream #0:0: Audio: aac (libfdk_aac) (mp4a / 0x6134706D), 48000 Hz, stereo, s16
    Metadata:
      encoder         : Lavc57.72.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
size=     226kB time=00:00:30.01 bitrate=  61.6kbits/s speed=60.5x
video:0kB audio:220kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.838930%
172.17.0.1 - - [19/Jan/2017:06:35:40 +0000] "POST /render/ HTTP/1.1" 200 231185 2.8421
[chuck](VM): sporking incoming shred: 2 (204f63b3af836d85201ff0587ce57f4a.ck)...
ffmpeg version git-2017-01-14-3ac46a0 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-libfdk-aac
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 72.100 / 57. 72.100
  libavformat    57. 62.100 / 57. 62.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 69.100 /  6. 69.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'resources/2d233ae623da0b06b943a132a811993b70a0956a0d7ea4b331324c555da3f3e9.wav':
  Duration: 00:00:20.00, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
[libfdk_aac @ 0x3d17ee0] Note, the VBR setting is unsupported and only works with some parameter combinations
Output #0, ipod, to 'resources/2d233ae623da0b06b943a132a811993b70a0956a0d7ea4b331324c555da3f3e9.m4a':
  Metadata:
    encoder         : Lavf57.62.100
    Stream #0:0: Audio: aac (libfdk_aac) (mp4a / 0x6134706D), 48000 Hz, stereo, s16
    Metadata:
      encoder         : Lavc57.72.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
size=     140kB time=00:00:20.01 bitrate=  57.4kbits/s speed=74.2x
video:0kB audio:136kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.238465%

Optimize ffmpeg compilation to increase build speed

FFMPEG compilation with libfdk-aac to convert .wav to .m4a files takes a really long time. We only need enough of FFMPEG to have this command work properly:

`ffmpeg -i #{WAV_FILE} -c:a libfdk_aac -vbr 4 #{AAC_FILE}`

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.