Skip to content
  • Home
  • Agro
    • Agro
    • Akuaponik
    • Hidroponik
    • Ayam Kampung
  • DIY
    • DIY
    • Rumah Kampung
  • Tech
    • Tech
    • Titanium Mobile
  • Media
    • Media
    • Downloads
    • Dashcam Drive
  • Misc
    • Pelbagai
    • Makanan
    • Fotografi
    • Idea
    • E-mau
  • Home
  • Agro
    • Agro
    • Akuaponik
    • Hidroponik
    • Ayam Kampung
  • DIY
    • DIY
    • Rumah Kampung
  • Tech
    • Tech
    • Titanium Mobile
  • Media
    • Media
    • Downloads
    • Dashcam Drive
  • Misc
    • Pelbagai
    • Makanan
    • Fotografi
    • Idea
    • E-mau
blog.azwan082.my


Blog ini tidak lagi dikemaskini, sila ke
👉 azwan082.my 👈
untuk dapatkan kandungan terbaru.

#Bash  #MEncoder  #MPlayer  #TV card

Record from tv card using mencoder

On 5 December 2012 in Tech

* Assuming tv card audio in cannot be detected & need to use line-in

rekodtv.sh

#!/bin/bash

CHANNEL=29 # R6-TV1,E11-TV2,29-TV3,37-NTV7,44-8TV,48-TV9
DURATION="60:00" # 60 minutes

amixer -c 0 sset 'Line',0 80% mute cap
mencoder tv://
  -tv channel=$CHANNEL:chanlist=europe-east:forceaudio:alsa:amode=1:adevice=hw.0,0:mjpeg
  -vf pp=md
  -of mpeg
  -oac lavc
  -ovc xvid
  -xvidencopts bitrate=800:vhq=2
  -endpos $DURATION
  -o tv.mpg&& sleep 20 && mplayer tv.mpg

Note: I set the Line-in as the capture channel for audio and mute it, so that no real-time audio coming out of the speaker. After 20 secs sleep, the recording playback started, settings to 5 secs is too low & the playback may stop itself.

To determine alsa hardware ID (hw.0,0) – assuming audio card 0 is the one
that connected the tv card audio out through line-in

$ amixer -c 0

Check

Simple mixer control 'Input Source',0
  ...
  Item0: 'Line'

Therefore, device ID is 0 (see ‘Input Source’)

ALSA hardware ID : hw.<cardID>,<deviceID>

To record:

$ chmod +x rekodtv.sh
$ ./rekodtv.sh

To force stop the recording (above script will auto stop record after 60 minutes)

stoprekod.sh

#!/bin/bash

kill -9 `ps ax|grep mencoder|grep -v grep|awk '{print $1}'`

Recorded videos must be reindexed before storing

idx.sh

#!/bin/bash

mencoder -idx tv.mpg -ovc copy -oac copy -o tv_idx.mpg

To play:

$ mplayer tv.mpg
Share this post:
  • Share
  • Tweet
  • LinkedIn

Related posts:

  • Avidemux
  • Compress / Decompress files using XZ
  • Check process that prevent unmount USB drive
  • Restart ADB

Filed under Tech with tags Bash, MEncoder, MPlayer, TV card

Post navigation

Previous Post Previous post:
Setup Trac on Windows
Next Post Next post:
iOS screen size

2 comments

  • Comment by Halloween spirit online 1 April 2014 at 10:44 pm - Reply

    Hi there. I stumbled upon a person’s weblog the usage of yahoo. That is the really nicely prepared post. Let me make sure you bookmark the idea as well as revisit go through extra within your tips. Was looking for submit. I’ll unquestionably returning.

  • Comment by Blanca 24 August 2014 at 7:18 pm - Reply

    I read a lot of interesting articles here. Probably you
    spend a lot of time writing, i know how to save you a lot of time, there is an online tool that creates readable, SEO
    friendly posts in minutes, just type in google
    – laranitas free content source

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Media sosial

  • facebook
  • instagram
  • twitter
  • pinterest
  • youtube

Carian

Artikel popular

  • Saiz standard kayu, papan dan plywood
  • Pemasangan dinding plywood rumah kampung secara solo
  • Kepincangan dalam menggunakan paip PVC sebagai saluran NFT hidroponik
  • 3 Jenis Asas Sistem Hidroponik Yang Digunakan Dalam Akuaponik Serta Variasinya
  • Cara membuat sistem NFT untuk akuaponik – Saliran masuk
  • Cara pasang pintu rumah
  • Jenis skru kayu
  • Larutan nutrien hidroponik DIY

Artikel terkini

  • 2 video #emau dari 2020/0221 February 2020
  • Gaya hidup minimalis14 February 2020
  • How to sync Mac OS Photos Library to an external disk storage17 January 2020
  • Sejarah dividen KWSP10 January 2020
  • Sejarah dividen Tabung Haji10 January 2020
  • Sejarah dividen ASB10 January 2020
  • Selamat dekad baru 2020-an3 January 2020
  • Dashcam Drive #17 – Taman Danu Serian → Ranchan Recreational Park1 January 2020

Tag

1N2D Akuaponik Android Apache Ayam Kampung Bash C# Cache Cili CommonJS Controller Dashcam Drive E-mau Fedora Fotografi Git Gnome Happy Together Hidroponik Idea Invincible Youth iOS Java Javascript Ke Indonesia Ke Kita? Ke Jepun Ke Kita? Ke Korea Ke Kita? Kewangan ListView Makanan Mr. Bean PHP Python Rant Roundtable Plus RPM Rumah Kampung Star Golden Bell Subversion SVN Titanium Mobile Titanium Module Titanium Studio windows phone WrestleMania

Arkib

Perihal

@azwan082

Seorang pembangun perisian (software developer) untuk peranti mudah alih (mobile devices) dan laman web, menggunakan bahasa pengaturcaraan Swift (iOS), Java (Android), PHP, MySQL dan Javascript (aplikasi web). Blog ini adalah tempat untuk saya berkongsi perkara, minat dan projek sampingan, seperti berkebun, kerja² kayu DIY, video dashcam drive dan pelbagai lagi.

© 2021 blog.azwan082.my

Back to top
sponsored