个人工具

“UbuntuHelp:MythExport”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:MythExport}}
 
{{Languages|UbuntuHelp:MythExport}}
 
<<Include([[UbuntuHelp:MythTV|MythTV]]/Header)>>
 
<<Include([[UbuntuHelp:MythTV|MythTV]]/Header)>>
'''''~+NOTE: Version 1.0.2 has been released for Intrepid.  This page now contains updated information for the latest version.+~'''''
+
This page has been updated for information on the latest version, for information on past versions please see [[UbuntuHelp:MythExport_old|MythExport_old]]
'''''~+UPDATE: I am moving the packages to the Mythbuntu Testing PPA. This way I can do some development on my own PPA without breaking everyone's system. You should remove my PPA from your apt sources and add this one instead: http://launchpad.net/~mythbuntu-testing/+archive +~'''''
+
If you are using MythExport from the Mythbuntu Testing PPA, please add a comment to the following bugs before upgrading to the latest version, this will help get these fixes pushed into Intrepid:
== New Features in 1.0.2 ==
+
* https://bugs.launchpad.net/ubuntu/+source/mythexport/+bug/282498
* RSS Support.  Just hit http://X.X.X.X/mythexport.  This will work with your internal URL and, if configured, your external URL as well.  If you would like to group your podcasts by different names you can do so by passing a name into the MythExport script and appending it on the end of the url when accessing the RSS feed.  Example: http://X.X.X.X/mythexport/iPod/
+
* https://bugs.launchpad.net/ubuntu/+source/mythexport/+bug/297016
* File cleanup. A daily cronjob will delete files when they reach their expiration date.
+
* https://bugs.launchpad.net/ubuntu/+source/mythexport/+bug/288184
* New "none" device & codec. Instead of exporting the video, a symlink is made to the original recording.  ** THIS FEATURE MAY NEED ADDITIONAL TESTING **
+
* https://bugs.launchpad.net/ubuntu/+source/mythexport/+bug/297019
* New mp3 export codec.  Will export your recording without video as a mp3 file.
+
* https://bugs.launchpad.net/ubuntu/+source/mythexport/+bug/288186
* Some bug fixes.
+
== New Features in 2.0 ==
To install this latest version in Hardy you need to add the following to your /etc/apt/sources.list:
+
* Web interface for setup, file maintenance, user jobs, "On The Go" functionality.
<pre><nowiki>
+
* Main script is now a Daemon.
deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu hardy main
+
* Added mythexport_addjob script (used to add export jobs to the queue).
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu hardy main
+
* Added "On The Go" functionality.
</nowiki></pre>
+
* Added file maintenance functionality.
 
== Introduction ==
 
== Introduction ==
MythExport is a script that can be added to [[UbuntuHelp:MythTV|MythTV]] as a User Job and used to export recordings into a format playable on portable devices such as iPod Video, iPod Touch, and PSP. Besides converting your recordings, this script also grabs data from the [[UbuntuHelp:MythTV|MythTV]] MySQL database and injects it as iTunes data into the exported video so that it will show up correctly on your iPod.
+
MythExport is a Perl  daemon  that can be used with [[UbuntuHelp:MythTV|MythTV]] to export recordings into a format playable on portable devices such as iPod Video, iPod Touch, PSP, and other devices. Besides converting your recordings, this script also grabs data from the [[UbuntuHelp:MythTV|MythTV]] MySQL database and injects it as iTunes data into the exported video so that it will show up correctly on your iPod.  MythExport may also be used to take  your  recordings "On The Go" and provides a RSS feed to all exported recordings.
 
== Installation ==
 
== Installation ==
If you installed MythExport and AtomicParsley by hand previously then you will need to remove them (Also note that mythexport.pl has now become mythexport in the new installation):
+
To install this latest version in Jaunty add the following to your /etc/apt/sources.list:
 
<pre><nowiki>
 
<pre><nowiki>
sudo rm /usr/local/bin/mythexport.pl
+
deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main
sudo rm /usr/local/bin/AtomicParsley
+
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main
 
</nowiki></pre>
 
</nowiki></pre>
On Gutsy you need to add additional sources before installing, this is not needed on Hardy.  Add the following to your /etc/apt/sources.list:
+
To install this latest version in Intrepid add the following to your /etc/apt/sources.list:
 
<pre><nowiki>
 
<pre><nowiki>
deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu gutsy main
+
deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu gutsy main
+
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main
 +
</nowiki></pre>
 +
Then add the GPG Key
 +
<pre><nowiki>
 +
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C3862D78
 
</nowiki></pre>
 
</nowiki></pre>
 
Install MythExport and AtomicParsley:
 
Install MythExport and AtomicParsley:
第33行: 第37行:
 
sudo apt-get install mythexport atomicparsley
 
sudo apt-get install mythexport atomicparsley
 
</nowiki></pre>
 
</nowiki></pre>
== Script Configuration ==
+
== Configuration ==
Use the script usage below to choose your settingsYou can reference this when you need them later.
+
Everything in MythExport is now configurable from the web interfaceHit http://localhost/mythexport (substitute localhost if you are accessing it from elsewhere in your network).
<pre><nowiki>
+
john@ultramagnus:~$ mythexport
+
 
+
How to use mythexport:
+
 
+
chanid = Channel ID associated with the recording to export.
+
starttime = Recording start time in either 'yyyy-mm-dd hh:mm:ss' or 'yyyymmddhhmmss' format.
+
exportdir = Directory to export completed MP4 files to (note the user the script runs as must have write permission on that directory).
+
size = Frame size of output file.  320x240 is the default value.
+
aspect = Aspect ratio of output file.  Valid values are 4:3 (default) and 16:9.
+
audio_bitrate = Audio bitrate in output file in kbps.  Default value is 96kb.
+
video_bitrate = Video bitrate in output file in kbps.  Default value is 300kb.
+
export_codec = Acceptable export codecs: mpeg4, xvid, h264, mp3, none.
+
export_device = Acceptable export devices: ipod, psp, zune, archos, none.
+
delete_period = How long (in days) to keep the exported files before removing them. Default value is 30 days.
+
podcast_name = Used to group recordings into different podcasts.  Default value is null.
+
debug = Enable debugging information - outputs which commands would be run.
+
 
+
Example: mythexport exportdir=/mythtv/ipod starttime=20060803205900 chanid=1006 size=320x240 aspect=4:3 audio_bitrate=192kb video_bitrate=300kb export_device=ipod export_codec=mpeg4 debug
+
</nowiki></pre>
+
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
 
|||||'''Compatability'''
 
|||||'''Compatability'''
第64行: 第48行:
 
|iPod Nano||mpeg4/xvid||320x240
 
|iPod Nano||mpeg4/xvid||320x240
 
|-
 
|-
|iPod Touch||mpeg4/xvid/h264||480x320
+
|iPod Touch||mpeg4/xvid/h264||480x320(Display) 640x480(TV Out)
 
|-
 
|-
|iPhone||mpeg4/xvid/h264||480x320
+
|iPod Classic||mpeg4/xvid/h264||320x240(Display) 640x480(TV Out)
 +
|-
 +
|iPhone||mpeg4/xvid/h264||480x320(Display) 640x480(TV Out)
 
|-
 
|-
 
|PSP||mpeg4/xvid||480 x 272*
 
|PSP||mpeg4/xvid||480 x 272*
第76行: 第62行:
 
|none||none||not needed (this symlinks to the original recording)
 
|none||none||not needed (this symlinks to the original recording)
 
|-
 
|-
|Additional Devices||colspan=2|Email john.baab@gmail.com with a working ffmpeg line
+
|Additional Devices||colspan=2|Email rhpot1991@ubuntu.com with a working ffmpeg line
 
|-
 
|-
 
|colspan=3|* Verification Still Needed
 
|colspan=3|* Verification Still Needed
 
|}
 
|}
== MythTV Configuration ==
+
== Daemon Controls ==
Enable a User Job to be used:
+
<pre><nowiki>
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_1.png
+
john@grimlock:~$ sudo /etc/init.d/mythexport
If you have multiple backends, check this box so that you don't get errors with a backend trying to export a file it doesn't have:
+
Usage: /etc/init.d/mythexport {start|stop|restart|force-reload|status}
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_2.png
+
</nowiki></pre>
Fill in a name for your User JobThen add the command you want the custom job to run:
+
== Detailed Page Descriptions ==
Here is my command for medium quality:
+
=== MythExport Setup ===
 +
Here you will setup your device configurations.  On the first page you Choose a device, on the second page you fill in the options you would like to use.  These are the same options that the original script used.
 +
You may also edit an existing configuration from this section.
 +
=== System Setup ===
 +
Here you will setup the location where your exported files live and where the RSS feed looks for files.
 +
=== User Jobs ===
 +
Here you will setup user jobs, this page will enable a user job if it is not currently enabled.
 +
* Note this page overrides the user job of your choice, be careful not to destroy something you care about.
 +
=== RSS Feed ===
 +
Here you can view all your rss feeds.  This page includes a deep link to the current feed you are viewing.
 +
=== On the Go ===
 +
Here you can export recordings to take On the Go.  There are two available options:
 +
1. Lightweight - Will export the recordings with the configuration of your choice and create an XML file that can be used within a web browser for easy recording browsing.
 +
2. Full - Will copy recordings and create a sql dump of all relevant data for the resulting recordings.  The user will then need to use MythImport to import these recordings into their On the Go backend.
 +
 
 +
* The XML CSS is still very bland and ugly, this should be fancied up soon.
 +
=== File Maintenance ===
 +
Here you can view exported recordings on your system and delete them immediately, this will delete the files and any MythExport database entries associated with the files.
 +
=== Job Queue ===
 +
Here you can view the current MythExport job queue.
 +
== Configuration Files ==
 +
Configuration files are now kept in the following places:
 +
<pre><nowiki>
 +
/etc/mythtv/mythexport_settings.cfg
 +
/etc/mythtv/mythexport.cfg
 +
</nowiki></pre>
 +
This config contains configuration options used to export recordingsNote the ffmpegArgs, the web interface will generate this and the daemon will use it when exporting, this is done as an effort to allow the users an option to easily tweak the resulting ffmpeg lines which was not easy in the past.  You may modify this to fit your needs, but remember the web interface will overwrite it if you ever choose to modify the configuration.
 +
<pre><nowiki>
 +
/etc/mythtv/mythexport_settings.cfg
 +
Configuration Options:
 +
removeCommercials - Bit for removing commercials using cut points, 1 for yes 0 or empty for no.
 +
codec - Export codec
 +
sizeY - Y resolution size
 +
sizeX - X resolution size
 +
aspect - Aspect ratio, normally 4:3 or 16:9
 +
videoBR - Video bitrate in kb or b
 +
threads - Enable multi threading, sets thread=auto.  1 for yes 0 or empty for no.
 +
device - Export device
 +
podcastName - Podcast Name
 +
deletePeriod - Delete period in days
 +
audioBR - Audio bitrate in kb or b
 +
audioChannels - Audio channels, empty and this is not used, any integer and this will be the number of channels used.  This may help with recordings that export without any sound, forcing this to 2 seems to help.
 +
ffmpegArgs - ffmpeg arguments, these are generated by the web interface using all the options in this config, you may change these to fit your needs
 +
deinterlace - Enable deinterlacing, 1 for enabled 0 or empty for disabled
 +
</nowiki></pre>
 +
It is recommended you start with a simple configuration and work from there, this will make it much easier to diagnose ffmpeg issues.  Here are some sample values which you can use to start off with:
 
<pre><nowiki>
 
<pre><nowiki>
mythexport exportdir=/mythtv/ipod starttime=%STARTTIME% chanid=%CHANID% size=320x240 aspect=4:3 audio_bitrate=192kb video_bitrate=600kb export_device=ipod export_codec=mpeg4
+
codec=mpeg4
 +
sizeY=240
 +
sizeX=320
 +
aspect=4:3  
 +
videoBR=600kb  
 +
deletePeriod=30
 +
audioBR=192kb
 
</nowiki></pre>
 
</nowiki></pre>
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_3.png
 
The User Job name and command can also be modified in [[UbuntuHelp:MythWeb|MythWeb]] (by clicking on the [[UbuntuHelp:MythTV|MythTV]] Settings button), but it must first be enabled in mythtvfrontend as shown above:
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=mythweb_user_job_0.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=mythweb_user_job_1.png
 
 
== Exporting a Recording ==
 
== Exporting a Recording ==
 
Execute your user job in MythTv:
 
Execute your user job in MythTv:
第99行: 第132行:
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_4.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_4.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_5.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_5.png
You can check that your job is running in the Info Center (Information Center -> System Status -> Job Queue):
+
You can check that your job has run in the Info Center (Information Center -> System Status -> Job Queue):
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_7.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_7.png
 
The User Job can be configured to run on recordings after they are created (Post Recording Processing Menu on the Recording Options screen):
 
The User Job can be configured to run on recordings after they are created (Post Recording Processing Menu on the Recording Options screen):
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_8.png
 
https://help.ubuntu.com/community/MythExport?action=AttachFile&do=get&target=user_job_8.png
 +
You may also run user jobs easily from [[UbuntuHelp:MythWeb|MythWeb]].
 
== Troubleshooting ==
 
== Troubleshooting ==
Verify that the user which runs the script has permissions to create files in the directory you are exporting to.
+
MythExport now logs everything to /var/log/mythtv/mythexport.log
If you get an error about config.xml missing, this can normally be found in the home directory of the user who runs your [[UbuntuHelp:MythTV|MythTV]] Fronend, and can be fixed by creating a symlink in mythtv's home directory (because that is the user who runs user jobs from the backend).  If you run into problems it is always a safe bet to make sure the config.xml exists in the following places:
+
If you are having issues see the log for relevant information.
 +
By default, debugging info is not logged. To enable it, edit /etc/init.d/mythexport and add "debug" to the ARGS variable.  Then sudo /etc/init.d/mythexport restart
 +
If you get an error about config.xml missing, this can normally be found in the home directory of the user who runs your [[UbuntuHelp:MythTV|MythTV]] Fronend, and can be fixed by creating a symlink in mythtv's home directory (because that is the user who runs the daemon).  By default most of these symlinks should exist if you are running Jaunty or using the weekly builds, if you run into problems it is always a safe bet to make sure the config.xml exists in the following places:
 
<pre><nowiki>
 
<pre><nowiki>
 
** These are especially important when using the RSS feature or running as a user job **
 
** These are especially important when using the RSS feature or running as a user job **
第112行: 第148行:
 
/home/mythtv/.mythtv
 
/home/mythtv/.mythtv
 
</nowiki></pre>
 
</nowiki></pre>
If you get any errors about aac, xvid, mp3, or h264 then your ffmpeg version may not have those enabled.  The easiest way to fix this is to enable the Medibuntu repositories.
 
 
----
 
----
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年5月12日 (二) 17:57的版本

<<Include(MythTV/Header)>> This page has been updated for information on the latest version, for information on past versions please see MythExport_old If you are using MythExport from the Mythbuntu Testing PPA, please add a comment to the following bugs before upgrading to the latest version, this will help get these fixes pushed into Intrepid:

New Features in 2.0

  • Web interface for setup, file maintenance, user jobs, "On The Go" functionality.
  • Main script is now a Daemon.
  • Added mythexport_addjob script (used to add export jobs to the queue).
  • Added "On The Go" functionality.
  • Added file maintenance functionality.

Introduction

MythExport is a Perl daemon that can be used with MythTV to export recordings into a format playable on portable devices such as iPod Video, iPod Touch, PSP, and other devices. Besides converting your recordings, this script also grabs data from the MythTV MySQL database and injects it as iTunes data into the exported video so that it will show up correctly on your iPod. MythExport may also be used to take your recordings "On The Go" and provides a RSS feed to all exported recordings.

Installation

To install this latest version in Jaunty add the following to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu jaunty main

To install this latest version in Intrepid add the following to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main
deb-src http://ppa.launchpad.net/mythbuntu-testing/ubuntu intrepid main

Then add the GPG Key

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C3862D78

Install MythExport and AtomicParsley:

sudo apt-get update
sudo apt-get install mythexport atomicparsley

Configuration

Everything in MythExport is now configurable from the web interface. Hit http://localhost/mythexport (substitute localhost if you are accessing it from elsewhere in your network).

Compatability
Device Encoding Max Resolution
iPod Video mpeg4/xvid 320x240
iPod Nano mpeg4/xvid 320x240
iPod Touch mpeg4/xvid/h264 480x320(Display) 640x480(TV Out)
iPod Classic mpeg4/xvid/h264 320x240(Display) 640x480(TV Out)
iPhone mpeg4/xvid/h264 480x320(Display) 640x480(TV Out)
PSP mpeg4/xvid 480 x 272*
Zune mpeg4/xvid/h264 480x320*
Archos mpeg4/xvid/h264 480x320*
none none not needed (this symlinks to the original recording)
Additional Devices Email [email protected] with a working ffmpeg line
* Verification Still Needed

Daemon Controls

john@grimlock:~$ sudo /etc/init.d/mythexport
Usage: /etc/init.d/mythexport {start|stop|restart|force-reload|status}

Detailed Page Descriptions

MythExport Setup

Here you will setup your device configurations. On the first page you Choose a device, on the second page you fill in the options you would like to use. These are the same options that the original script used. You may also edit an existing configuration from this section.

System Setup

Here you will setup the location where your exported files live and where the RSS feed looks for files.

User Jobs

Here you will setup user jobs, this page will enable a user job if it is not currently enabled.

  • Note this page overrides the user job of your choice, be careful not to destroy something you care about.

RSS Feed

Here you can view all your rss feeds. This page includes a deep link to the current feed you are viewing.

On the Go

Here you can export recordings to take On the Go. There are two available options: 1. Lightweight - Will export the recordings with the configuration of your choice and create an XML file that can be used within a web browser for easy recording browsing. 2. Full - Will copy recordings and create a sql dump of all relevant data for the resulting recordings. The user will then need to use MythImport to import these recordings into their On the Go backend.

  • The XML CSS is still very bland and ugly, this should be fancied up soon.

File Maintenance

Here you can view exported recordings on your system and delete them immediately, this will delete the files and any MythExport database entries associated with the files.

Job Queue

Here you can view the current MythExport job queue.

Configuration Files

Configuration files are now kept in the following places:

/etc/mythtv/mythexport_settings.cfg
/etc/mythtv/mythexport.cfg

This config contains configuration options used to export recordings. Note the ffmpegArgs, the web interface will generate this and the daemon will use it when exporting, this is done as an effort to allow the users an option to easily tweak the resulting ffmpeg lines which was not easy in the past. You may modify this to fit your needs, but remember the web interface will overwrite it if you ever choose to modify the configuration.

/etc/mythtv/mythexport_settings.cfg
Configuration Options:
removeCommercials - Bit for removing commercials using cut points, 1 for yes 0 or empty for no.
codec - Export codec
sizeY - Y resolution size
sizeX - X resolution size
aspect - Aspect ratio, normally 4:3 or 16:9
videoBR - Video bitrate in kb or b
threads - Enable multi threading, sets thread=auto.  1 for yes 0 or empty for no.
device - Export device
podcastName - Podcast Name
deletePeriod - Delete period in days
audioBR - Audio bitrate in kb or b
audioChannels - Audio channels, empty and this is not used, any integer and this will be the number of channels used.  This may help with recordings that export without any sound, forcing this to 2 seems to help.
ffmpegArgs - ffmpeg arguments, these are generated by the web interface using all the options in this config, you may change these to fit your needs
deinterlace - Enable deinterlacing, 1 for enabled 0 or empty for disabled

It is recommended you start with a simple configuration and work from there, this will make it much easier to diagnose ffmpeg issues. Here are some sample values which you can use to start off with:

codec=mpeg4 
sizeY=240 
sizeX=320 
aspect=4:3 
videoBR=600kb 
deletePeriod=30 
audioBR=192kb 

Exporting a Recording

Execute your user job in MythTv: Media Library -> Watch Recordings MythExport?action=AttachFile&do=get&target=user_job_4.png MythExport?action=AttachFile&do=get&target=user_job_5.png You can check that your job has run in the Info Center (Information Center -> System Status -> Job Queue): MythExport?action=AttachFile&do=get&target=user_job_7.png The User Job can be configured to run on recordings after they are created (Post Recording Processing Menu on the Recording Options screen): MythExport?action=AttachFile&do=get&target=user_job_8.png You may also run user jobs easily from MythWeb.

Troubleshooting

MythExport now logs everything to /var/log/mythtv/mythexport.log If you are having issues see the log for relevant information. By default, debugging info is not logged. To enable it, edit /etc/init.d/mythexport and add "debug" to the ARGS variable. Then sudo /etc/init.d/mythexport restart If you get an error about config.xml missing, this can normally be found in the home directory of the user who runs your MythTV Fronend, and can be fixed by creating a symlink in mythtv's home directory (because that is the user who runs the daemon). By default most of these symlinks should exist if you are running Jaunty or using the weekly builds, if you run into problems it is always a safe bet to make sure the config.xml exists in the following places:

** These are especially important when using the RSS feature or running as a user job **
/home/%your_user_account%/.mythtv
/root/.mythtv
/home/mythtv/.mythtv