Git Product home page Git Product logo

tiny-tv's Introduction

Tiny TV

Do you remember the classic console TV's of the second half of the last century? You know, the ones that were a piece of furniture and took up a large portion of a room? Now you can build one that has that same classic look -- but only fills up a corner of your desk.

Tiny TV (featuring Bugs Bunny and Daffy Duck)

Tiny TV (featuring Becky G)

Getting Started

  • Use raspi-config to:
    • Expand your filesystem
    • Set your locale and keyboard options
    • Set up your WiFi connection
    • Enable SSH
    • Set your memory split to at least 128MB
  • Connect your display to your Raspberry Pi and configure according to the manufacturer's instructions
  • Ensure audio output is correctly configured.

Installation

Installation of the program, as well as any software prerequisites, can be completed with the following two-line install script.

wget -q https://raw.githubusercontent.com/eat-sleep-code/tiny-tv/master/install-tiny-tv.sh -O ~/install-tiny-tv.sh
sudo chmod +x ~/install-tiny-tv.sh && ~/install-tiny-tv.sh

Usage

tiny-tv <input> [options]
tiny-tv-persist <input> [options]
tiny-tv-resume

Options

  • --input : Select the video to be played (required, can be a file name, a Youtube URL, or the word 'category')
  • --saveAs : Enter the name you would like the file saved as (Used if downloading from YouTube only)
  • --category : Select the category (This will set the subfolder, for example --category cartoons will use the /home/pi/videos/cartoons folder)
  • --maximumVideoHeight : Set the maximum height (in pixels) for downloaded videos (default: 480)
  • --removeVerticalBars : Remove the vertical black bars (pillar box) from the input file. This time-intensive process will also resize the video to the maximum video height. (default: False)
  • --removeHorizontalBars : Remove the horizontal black bars (letter box) from the input file. This time-intensive process will also resize the video to the maximum video height. (default: False)
  • --resize : Resize the video to the maximum video height. This is a time-intensive process.
  • --volume : Set the initial volume in decibels [db] (default: -20, min: -60, max: 6`)
  • --loop : Set whether video plays continuously in a loop (default: True)

Playback Controls

You can control the device from either a Bluetooth keyboard or via an SSH connection from another machine.

Key Action
- Decrease Volume
+ Increase Volume
Space or p Pause/Resume
q Exit
1 Increase Speed
2 Decrease Speed
Left Seek -30
Right Seek +30
Down Seek -600
Up Seek +600

Examples

To download, crop, and play a video from YouTube:

tiny-tv https://www.youtube.com/watch?v=h8NrKjJPAuw --saveAs 'Bugs Bunny.mp4' --category 'cartoons' --removeVerticalBars True 

The default video height is 480px. This is an ideal resolution for a true Tiny TV. If you are utilizing a more powerful Raspberry Pi and a higher resolution screen, you may alter the maximum video height.

tiny-tv https://www.youtube.com/watch?v=h8NrKjJPAuw --saveAs 'Bugs Bunny.mp4' --category 'cartoons' --maximumVideoHeight 1080

To play a music video from your Raspberry Pi at a volume of 3db:

tiny-tv 'Becky G - Mayores (featuring Bad Bunny).mp4' --category 'music' --volume 3

Alternatively, you can type the video subfolder instead of using the category argument:

tiny-tv 'music/Becky G - Mayores (featuring Bad Bunny).mp4' --volume -10

To play all the cartoons in a loop:

tiny-tv 'category' --category 'cartoons' --volume 0

Keep Tiny TV playing even after SSH session ends

tiny-tv-persist 'category' --category 'christmas' --volume 3

After the video begins playing, you may:

  1. Press Ctrl-A.
  2. Press Ctrl-D.
  3. Disconnect from your SSH session.

To reconnect to the existing playback, you may:

  1. Connect via SSH
  2. Type tiny-tv-resume

Audio Settings

If you are using a USB audio device you may need to edit the /usr/share/alsa/alsa.conf file for audio output to function properly. Set the following values:

defaults.ctl.card 1
defaults.pcm.card 1

Building Your Own Tiny TV

Bill of Materials

General Instruction for Assembly of Electronic Components

Before You Start

Consider your case design, some case construction steps may be inserted before, in between, or after any of the steps below as appropriate. We constructed our case from hobby-grade walnut and basswood.

The Screen and Pi

  1. Complete the steps outlined in the Getting Started section.

  2. Install the software as outlined in the Installation section.

  3. Remove your micro SD card from the Raspberry Pi. The heat from soldering the adjacent GPIO header can potentially damage the SD card.

  4. Solder a female GPIO header to the rear/bottom of the Raspberry Pi Zero W so that the Pi can be removed in the future.

  5. Connect the display and the Raspberry Pi Zero W together.

Screen attached to Raspberry Pi Zero W

  1. Replace the micro SD card and boot up the Raspberry Pi.

  2. Install the software, following the manufacturer's instructions.

    cd ~/
    git clone https://github.com/tianyoujian/MZDPI.git
    cd MZDPI/vga
    sudo chmod +x mzdpi-vga-autoinstall-online
    sudo ./mzdpi-vga-autoinstall-online
    sudo reboot
    
  3. Remove your micro SD card from the Raspberry Pi.

Power Leads

If the header pins of your female GPIO header are too short you will need solder the power leads for the amplifiers directly to the GPIO pins:

  1. Trim the end from a red jumper wire, leaving the female end intact. Solder the red wire to either Pin 2 or Pin 4 of the Raspberry Pi Zero.

  2. Trim the end from a black jumper wire, leaving the female end intact. Solder the black wire to Pin 39 of the Raspberry Pi Zero.

Audio Amplifiers

  1. Solder the header pins and speaker posts to each Audio Amplifier.

  2. Create two Y jumper cables for the amplifier power and ground:

    • Trim the end from a red jumper wire, leaving the male end intact.

    • Trim the ends from two red jumper wires, leaving the female end intact.

    • Solder the two red female-ended cables to the red male-ended -- forming a Y cable with two female plugs on one end and a male plug on the other end.

    • Slide a length of heat shrink tubing over the solder joint and shrink it using either a torch on low heat or a heat gun.

    • Trim the end from a black jumper wire, leaving the male end intact.

    • Trim the ends from two black jumper wires, leaving the female end intact.

    • Solder the two black female-ended cables to the black male-ended -- forming a Y cable with two female plugs on one end and a male plug on the other end.

    • Slide a length of heat shrink tubing over the solder joint and shrink it using either a torch on low heat or a heat gun.

Audio amplifiers and speakers

  1. Attach a female plug of the black Y ground jumper cable to the GND (ground) pin of each audio amplifier board.

  2. Attach a female plug of the red Y power jumper cable to the VIN (voltage in) pin of each audio amplifier board.

Audio Source

  1. Create a Y audio distribution cable.

    • Trim the end of a red jumper wire, leaving the female end intact. Solder the wire end to the red wire of the 90° audio plug.

    • Trim the end of a white jumper wire, leaving the female end intact. Solder the wire end to the white wire of the 90° speaker plug.

    • Trim the end of two black jumper wires, leaving the female ends intact. Solder the wire ends to the ground/silver wire of the 90° speaker plug, forming a Y.

    • Slide a piece of heat shrink tubing over each individual solder joint and shrink it.

  2. Attach the female plug of the audio red wire to the A+ pin of one audio board.

  3. Attach the female plug of the audio white wire to the A+ pin of the other audio board.

  4. Attach the female plug of each audio wire to the A- pin of each audio amplifier board.

  5. Plug the ⅛"/3.5㎜ jack of the audio plug into the green headphone port of the USB audio adapter.

  6. Plug the USB audio adapter into one of the 90° down angle micro USB cables and plug the USB cable into the center plug of the Pi Zero W.

Audio Output

Top down view of the Tiny TV's internal assembly

  1. Trim the end of two red jumper wires, leaving the female ends intact. Solder one red wire to the appropriate post of each speaker.

  2. Trim the end of two white jumper wires, leaving the female ends intact. Solder one white wire to the appropriate post of each speaker.

  3. Attach the female plug of each speaker's red wire to the + speaker post of each audio board.

  4. Attach the female plug of each speaker's white wire to the - speaker post of each audio amplifier board.

Making Connections

Front view of the Tiny TV's internal assembly

  1. Connect the male ends of the power Y adapters to the corresponding leads you soldered to the Raspberry Pi at the beginning of this guide.

  2. Connect the second 90° down micro USB cable to USB extension cable.

  3. Connect the second 90° down micro USB cable to the power outer micro USB port of the Raspberry Pi.

  4. Replace the micro SD card and boot up the Raspberry Pi.

  5. Connect the USB extension cable to a power source and test the device.

Front view of the Tiny TV's internal assembly

Final Assembly

The case design is up to you. Below are a few images of our design for inspiration.

Front view of the Tiny TV's internal assembly

Front view of the Tiny TV's internal assembly

Finish assembling your case and put your Tiny TV to use.

Tiny TV (featuring Bugs Bunny and Daffy Duck)

Front view of the Tiny TV's internal assembly

Just the FAQs, ma'am

How big is it?

  • Maybe you should ask, "how tiny is it?". Our design is ridiculously small at just 3.75" x 3.75" x 3.25" (95.25mm x 95.25mm x 82.55mm). An iPhone will take up more room on your desk.

Does it just play video?

  • No, it plays sound too! As outlined above, there are two discrete audio amplifiers powering two 1.25" (32mm) speakers.

  • If you install Raspberry Pi OS desktop edition, you could use it as a ridiculously small desktop computer.

tiny-tv's People

Contributors

eat-sleep-code avatar

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.