Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Televisie opnemen met mencoder  (gelezen 2522 keer)

Offline wutnubu

  • Lid
  • Steunpunt: Nee
Televisie opnemen met mencoder
« Gepost op: 2007/01/01, 08:58:28 »
Wisten jullie dat je met mencoder tv-programma's kunt opnemen als je een TV-kaart hebt.
Ik niet dus, maar een dagje surfen en rommelen heeft een mooi scriptje opgeleverd, dat samen met het "at" commando een geweldige mogelijkheid biedt om van je PC een "werkende" recorder te maken.
De reguliere programma's kreeg ik niet aan de praat.

Nu nog een grafisch schilletje..

===============begin script==================
#!/bin/bash

# VBRATE: 470 -> 3 h / CD, 580 -> 2.5 h / CD, 740 -> 2 h / CD
VBRATE=740
ABRATE=64
OUTDIR=$HOME
KDETV_CH_LIST="${HOME}/.kde/share/apps/kdetv/channels.cvs"
BADAPPS="kdetv-bin|kradio|celestia|foobillard|stellarium"
WAITTIME=20

ERR_BADUSAGE=1
ERR_FILEEXISTS=2
ERR_BADCHANNEL=3
ERR_RUNNING=4
ERR_CANTKILL=5

if [ $# -ne 3 ]; then
  printf "Usage: `basename \"$0\"` <rec_time> (e.g. `basename \"$0\"` 7 \"The Simpsons\" \"01:30:00\")\n\n"<br />  exit $ERR_BADUSAGE<br />fi<br /><br />CHANNEL="$1"<br />TITLE="$2"<br />RECTIME="$3"<br /><br />if [ -s "${OUTDIR}/${TITLE}.avi" ]; then<br />  printf "File \"${OUTDIR}/${TITLE}.avi\" already exists!\n\n"<br />  exit $ERR_FILEEXISTS<br />fi<br /><br />FREQ=`gawk -F "," -v CH="$CHANNEL" '{ if ( $1 == CH ) { print $2 / 1000; exit 0 } }' "$KDETV_CH_LIST"`<br /><br />if [ -z $FREQ ]; then<br />  printf "There's no channel \"$CHANNEL\"!\n\n"<br />  exit $ERR_BADCHANNEL<br />fi<br /><br />if [ `ps -A -o "comm args" | grep -E "^mencoder" | grep -E "tv://" | wc -l` -gt 0 ]; then<br />  printf "MEncoder already running!\n\n"<br />  exit $ERR_RUNNING<br />fi<br /><br />if [ `pgrep -x "$BADAPPS" | wc -l` -gt 0 ]; then<br />  pkill -x "$BADAPPS"<br />  if [ $? -ne 0 ]; then<br />    printf "Cannot kill one of $BADAPPS!\n\n"<br />    exit $ERR_CANTKILL<br />  fi<br />  amixer -q set Line mute<br />  echo "Waiting $WAITTIME seconds for resources to become available..."<br />  sleep $WAITTIME<br />fi<br /><br />amixer -q set Line cap<br />amixer -q set Capture cap<br /><br />if [ "$RECTIME" = "0" ]; then<br />  mencoder tv:// -tv driver=v4l2:device=/dev/video:input=0:freq=$FREQ:width=768:height=576:fps=25:norm=0 -vf crop=744:552,pp=lb,scale=496:368 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBRATE:mbd=1 -oac mp3lame -lameopts cbr:mode=3:br=$ABRATE:aq=2 -ffourcc DIVX -o "${OUTDIR}/${TITLE}.avi"<br />else<br />  mencoder tv:// -tv driver=v4l2:device=/dev/video:input=0:freq=$FREQ:width=768:height=576:fps=25:norm=0 -vf crop=744:552,pp=lb,scale=496:368 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBRATE:mbd=1 -oac mp3lame -lameopts cbr:mode=3:br=$ABRATE:aq=2 -ffourcc DIVX -o "${OUTDIR}/${TITLE}.avi" -endpos "$RECTIME"<br />fi<br /><br />===============einde script==================</div> </div> </div> <div class="moderatorbar"> <div class="smalltext modified" id="modified_60114"> </div> <div class="smalltext reportlinks"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=reporttm;topic=6100.0;msg=60114">Meld dit bericht aan de moderator</a>   <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/ip.gif" alt="" /> Gelogd </div> </div> </div> <span class="botslice"><span></span></span> </div> <hr class="post_separator" /> <a id="msg60130"></a> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="post_wrapper"> <div class="poster"> <h4> <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/useroff.gif" alt="Offline" /> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=profile;u=1037" title="Bekijk profiel van Soul-Sing">Soul-Sing</a> </h4> <ul class="reset smalltext" id="msg_60130_extra_info"> <li class="postgroup">Lid</li> <li class="stars"></li> <li class="profile"> <ul> </ul> </li> <li class="custom">Steunpunt: Nee</li> </ul> </div> <div class="postarea"> <div class="flow_hidden"> <div class="keyinfo"> <div class="messageicon"> <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/post/xx.gif" alt="" /> </div> <h5 id="subject_60130"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&topic=6100.msg60130#msg60130" rel="nofollow">Televisie opnemen met mencoder</a> </h5> <div class="smalltext">« <strong>Reactie #1 Gepost op:</strong> 2007/01/01, 11:18:04 »</div> <div id="msg_60130_quick_mod"></div> </div> </div> <div class="post"> <div class="inner" id="msg_60130">@hellinga<br /><br />geweldig. mijn idee? direct verplaatsen naar <strong>=de etalage=</strong> van dit forum!:)</div> </div> </div> <div class="moderatorbar"> <div class="smalltext modified" id="modified_60130"> </div> <div class="smalltext reportlinks"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=reporttm;topic=6100.1;msg=60130">Meld dit bericht aan de moderator</a>   <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/ip.gif" alt="" /> Gelogd </div> </div> </div> <span class="botslice"><span></span></span> </div> <hr class="post_separator" /> <a id="msg193077"></a> <div class="windowbg"> <span class="topslice"><span></span></span> <div class="post_wrapper"> <div class="poster"> <h4> cyrus_the_virus </h4> <ul class="reset smalltext" id="msg_193077_extra_info"> <li class="membergroup">Gast</li> </ul> </div> <div class="postarea"> <div class="flow_hidden"> <div class="keyinfo"> <div class="messageicon"> <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/post/xx.gif" alt="" /> </div> <h5 id="subject_193077"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&topic=6100.msg193077#msg193077" rel="nofollow">Televisie opnemen met mencoder</a> </h5> <div class="smalltext">« <strong>Reactie #2 Gepost op:</strong> 2008/01/04, 18:43:13 »</div> <div id="msg_193077_quick_mod"></div> </div> </div> <div class="post"> <div class="inner" id="msg_193077">Dat is inderdaad handig!<br /><br />Ik heb alleen een probleem, hij wil geen geluid opnemen. Ik heb al een beetje zitten klooien met amixer maar het wil niet lukken <img src="https://forum.ubuntu-nl.org/Smileys/default/sad.gif" alt=":(" title="Sad" class="smiley" /><br />Ik heb een PCTV kaart van Pinnacle en die zit aangesloten op de Aux van mn SB Audigy 2 geluidskaart.<br /><br />Ik heb geprobeerd met<br />amixer -c 2 -q set Aux cap<br />amixer -c 2 -q set 'Analog Mix' cap<br />(De c 2 is omdat ik meerdere geluidskaarten heb)<br />Maar als ik dat doe krijg ik een 'amixer: Invalid command!'<br /><br />Ik heb ook geprobeerd om in de gnome mixer de juiste kanalen opnemen aan te zetten.<br /><br />Weet iemand hoe ik dat kan oplossen?<br /><br />Martijn.</div> </div> </div> <div class="moderatorbar"> <div class="smalltext modified" id="modified_193077"> </div> <div class="smalltext reportlinks"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=reporttm;topic=6100.2;msg=193077">Meld dit bericht aan de moderator</a>   <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/ip.gif" alt="" /> Gelogd </div> </div> </div> <span class="botslice"><span></span></span> </div> <hr class="post_separator" /> <a id="msg193083"></a> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="post_wrapper"> <div class="poster"> <h4> <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/useron.gif" alt="Online" /> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=profile;u=1103" title="Bekijk profiel van maasnet">maasnet</a> </h4> <ul class="reset smalltext" id="msg_193083_extra_info"> <li class="postgroup">Lid</li> <li class="stars"></li> <li class="avatar"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=profile;u=1103"> <img class="avatar" src="https://forum.ubuntu-nl.org/avs/avatar_1103_1482248982.png" alt="" /> </a> </li> <li class="im_icons"> <ul> <li><a href="https://launchpad.net/~m-vd-hoeven"><img src="https://forum.ubuntu-nl.org/Themes/default/images/launchpadlogo_16x17.png" alt="m-vd-hoeven" /></a></li> </ul> </li> <li class="profile"> <ul> </ul> </li> <li class="custom">Steunpunt: Ja</li> </ul> </div> <div class="postarea"> <div class="flow_hidden"> <div class="keyinfo"> <div class="messageicon"> <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/post/xx.gif" alt="" /> </div> <h5 id="subject_193083"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&topic=6100.msg193083#msg193083" rel="nofollow">Televisie opnemen met mencoder</a> </h5> <div class="smalltext">« <strong>Reactie #3 Gepost op:</strong> 2008/01/04, 18:56:11 »</div> <div id="msg_193083_quick_mod"></div> </div> </div> <div class="post"> <div class="inner" id="msg_193083">Kan dit ook met het programma TVTime?</div> </div> </div> <div class="moderatorbar"> <div class="smalltext modified" id="modified_193083"> </div> <div class="smalltext reportlinks"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=reporttm;topic=6100.3;msg=193083">Meld dit bericht aan de moderator</a>   <img src="https://forum.ubuntu-nl.org/Themes/light-smf-theme/images/ip.gif" alt="" /> Gelogd </div> <div class="signature" id="msg_193083_signature">Je ziet wel wat een ander heeft, maar je ziet niet wat hij mist.<br /><br />OS: Ubuntu 16.04/Xubuntu 16.04/Ubuntu 17.10; RPI: Raspbian Jessie; Asus 1005PE: Q4OS; Linux Lite 3.4; W10<br />***Steunpunt Ede***  voor andere steunpunten: <a href="https://kaart.ubuntu-nl.org/" class="bbc_link" target="_blank">https://kaart.ubuntu-nl.org/</a></div> </div> </div> <span class="botslice"><span></span></span> </div> <hr class="post_separator" /> </form> </div> <a id="lastPost"></a> <div class="pagesection"> <div class="pagelinks floatleft">Pagina's: [<strong>1</strong>]   <a href="#top"><strong>Omhoog</strong></a></div> <div class="nextlinks_bottom"></div> </div> <div class="navigate_section"> <ul> <li> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&"><span>Ubuntu Nederlands</span></a> » </li> <li> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&#c5"><span>Interactief</span></a> » </li> <li> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&board=11.0"><span>Etalage</span></a> » </li> <li class="last"> <a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&topic=6100.0"><span>Televisie opnemen met mencoder</span></a> </li> </ul> </div> <div id="moderationbuttons"></div> <div class="plainbox" id="display_jump_to"> </div> <br class="clear" /> <script type="text/javascript" src="https://forum.ubuntu-nl.org/Themes/default/scripts/topic.js"></script> <script type="text/javascript"><!-- // --><![CDATA[ if ('XMLHttpRequest' in window) { var oQuickModify = new QuickModify({ sScriptUrl: smf_scripturl, bShowModify: true, iTopicId: 6100, sTemplateBodyEdit: '\n\t\t\t\t\t\t\t\t<div id="quick_edit_body_container" style="width: 90%">\n\t\t\t\t\t\t\t\t\t<div id="error_box" style="padding: 4px;" class="error"><' + '/div>\n\t\t\t\t\t\t\t\t\t<textarea class="editor" name="message" rows="12" style="width: 100%; margin-bottom: 10px;" tabindex="1">%body%<' + '/textarea><br />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="a6e96d1fe89" value="15c7a3b708061d77cdfe5f5960459afc" />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="topic" value="6100" />\n\t\t\t\t\t\t\t\t\t<input type="hidden" name="msg" value="%msg_id%" />\n\t\t\t\t\t\t\t\t\t<div class="righttext">\n\t\t\t\t\t\t\t\t\t\t<input type="submit" name="post" value="Opslaan" tabindex="2" onclick="return oQuickModify.modifySave(\'15c7a3b708061d77cdfe5f5960459afc\', \'a6e96d1fe89\');" accesskey="s" class="button_submit" />  <input type="submit" name="cancel" value="Annuleren" tabindex="3" onclick="return oQuickModify.modifyCancel();" class="button_submit" />\n\t\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t\t<' + '/div>', sTemplateSubjectEdit: '<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="4" class="input_text" />', sTemplateBodyNormal: '%body%', sTemplateSubjectNormal: '<a hr'+'ef="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&'+'?topic=6100.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%<' + '/a>', sTemplateTopSubject: 'Topic: %subject%  (gelezen 2522 keer)', sErrorBorderStyle: '1px solid red' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">Ga naar:<" + "/label> %dropdown_list%", iCurBoardId: 11, iCurBoardChildLevel: 0, sCurBoardName: "Etalage", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "ga" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: true, iBoardId: 11, iTopicId: 6100, sSessionId: "15c7a3b708061d77cdfe5f5960459afc", sSessionVar: "a6e96d1fe89", sLabelIconList: "Berichticoon", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); } // ]]></script> </div> </div></div></div> </div> <!-- Close main-wrapper --> <div id="footer_section"> <div class="container"> <dl class="footer-content"> <dt>Legal Disclaimer</dt> <dd><p>© 2010 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</p></dd> </dl> <dl class="footer-content"> <dt>Content license</dt> <dd> <ul class="footer-links"> <li class="footer-item"><a href="https://www.ubuntu-nl.org/node/100" class="footer-link">Images</a></li> <li class="footer-item"><a href="https://www.ubuntu-nl.org/node/101" class="footer-link">texts</a></li> </ul> </dd> </dl> <dl class="footer-content"> <dt>More Ubuntu</dt> <dd> <ul class="footer-links"> <li class="footer-item"><a href="http://ubuntu.com/getubuntu/download/" class="footer-link">Get Ubuntu</a></li> <li class="footer-item"><a href="http://brainstorm.ubuntu.com/" class="footer-link">Ubuntu Brainstorm</a></li> <li class="footer-item"><a href="https://ubuntuforums.org/" class="footer-link">Ubuntu Forums</a></li> <li class="footer-item"><a href="http://spreadubuntu.neomenlo.org/" class="footer-link">Spread Ubuntu</a></li> </ul> </dd> </dl> <dl class="footer-content"> <dt>Forum Links</dt> <dd> <ul class="footer-links"> <li class="footer-item"><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="footer-link new_win" title="Valid XHTML 1.0!"><span>XHTML</span></a></li> <li class="footer-item last"><a id="button_wap2" href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&wap2" class="footer-link new_win"><span>WAP2</span></a></li> </ul> </dd> </dl> <dl class="footer-content footer-content-right"> <dt>Thema instellingen</dt> <dd> <ul class="footer-links"> <li class=""><a href="javascript:void(0);" onclick="theme_switch('ubuntu');" class="footer-link">Ubuntu oranje</a></li> <li class=""><a href="javascript:void(0);" onclick="theme_switch('kubuntu')" class="footer-link">Kubuntu blauw</a></li> </ul> </dd> </dl> <div class="foot-note"> <ul class="reset"> <li class="copyright-theme"> <a href="https://code.launchpad.net/ubuntu-nl-artwork/light-smf-theme" title="https://code.launchpad.net/ubuntu-nl-artwork/light-smf-theme" target="_blank"> <b>Ubuntu thema door Ronnie en Yordi</b> </a> </li> <li class="copyright-smf"> <span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;"><a href="https://forum.ubuntu-nl.org/index.php?PHPSESSID=ktn3d7ldvvkc4npo9oanb6jqd2&action=credits" title="Simple Machines Forum" target="_blank" class="new_win">SMF 2.0.13</a> | <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF © 2016</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a> </span> <p>Pagina opgebouwd in 0.036 seconden met 24 queries.</p></li> <li class="footer-bottom-hosting"> <span class="hosting-text">Hosting</span> <a alt="hcc! logo" href="http://www.hcc.nl/" title="logo hcc" id="logo-hcc"></a> <a alt="Bit logo" href="http://www.bit.nl/extern1/" title="logo bit" id="logo-bit"></a> </li> </ul> </div> <div style="clear:both;"></div> </div> </div> </body></html>