Transcode: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(A quick example)
 
m (Fix link to g4vl)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Transcode provides an integrated framework for a large number of multimedia projects, bringing them together under one umbrella as a suite of command line utilities that are capable of encoding and transcoding a variety of video and audio codecs and for converting between different container formats. Transcode also provides further features such as post-processing filters, the ability to import DVDs on-the-fly, and being capable of recording from V4L devices.
== Introduction ==


== Recording from a V4L device ==
* [[http://www.transcoding.org trancode project page]]
This example works on [[saa713x devices|saa7134 cards]], using the [[saa7134-alsa]] DMA module under OSS emulation:
* [http://www.transcoding.org/cgi-bin/transcode?Video4linux_Examples v4l examples]


transcode -x v4l2=resync_margin=1:resync_interval=250,v4l2 -M 2 -H 0 \
The transcode program provides an integrated framework for encoding and transcoding, bringing together a large number of multimedia projects under one umbrella.
-i /dev/video$DEV -p /dev/dsp$DEV -y ffmpeg -F h264 -c 00:$TIM \
-g 640x480 -f 29.970,4 -u 1024,2 -w 800 -b 128 -Q 5 -e 32000,16,2 \
-o $DIR/$FIL.avi --progress_off


The trick here is to set the audio import to 32000,16,2 -- the parameters used by the DMA audio channel on the card, and thus by the 7134-alsa module. The resync parameters are borrowed from Francesco Romani's recent addition to the [http://www.transcoding.org/cgi-bin/transcode?Video4linux_Examples transcode wiki]; they appear to solve the sync problem, way cool!
== Recording from v4l ==


The attempt to start two threads -- "-u 1024,2" -- fails because transcode doesn't yet have its own x264 export module (Francesco is working on it). The workaround is to create ~/.transcode/ffmpeg.cfg with this content:
This example works on saa7134 cards, using the [[saa7134-alsa]] DMA module:


[h264]
transcode -x v4l2,v4l2 -M 2 -i /dev/video$DEV -p /dev/dsp$DEV -y ffmpeg -F msmpeg4v2 \
threads = 2
-c $TIM -g 640x480 -f 29.970,4 -u 1024 -Q 5 -e 32000,16,2 --lame_preset medium \
-o $DIR/$FIL.avi


On a dual-core, I found xh26 doesn't do a great job with two threads -- CPU utilization doesn't get past full use of one core -- but ymmv. In addition, the recording time is extended beyond what is requested by up to 40%.
The trick here is to set the audio import to 32000,16,2 -- the parameters used by the DMA audio channel on the card, and thus by the 7134-alsa module.

The audio device referred to here is /dev/dspN, using the OSS emulation layer provided by ALSA. The transcode developers are working on accessing ALSA devices directly.

<big><b>Switches</b></big>

* For audio bitrates, you can use "--lame_preset medium" or specify a fixed bitrate, such as "-b 96"
* To turn off verbose progress feedback, for instance if you're having the result of a cron job mailed to you, use "--progress_off"
* To turn off device probling, use "-H 0" -- removes a few error messages, as v4l device probing is still imperfect in transcode

<big><b>GUI Frontend for transcode's V4L functions</b></big>

[http://gv4l.sourceforge.net/about.html Gv4l] provides a GUI frontend for transcode's ability to record audio & video streams from V4L devices, in either compressed or raw uncompressed formats.

==External Links==
* [http://www.transcoding.org Trancode project page]
** [http://www.transcoding.org/cgi-bin/transcode?Video4linux_Examples V4L examples]
* [http://news.gmane.org/gmane.comp.video.transcode.user Tanscode users mailing list archive]
* [http://tcforge.berlios.de/ Transcode support site]
* [http://gv4l.sourceforge.net/about.html Gv4l homepage]

[[Category:Apps & Utilities]]
[[Category:Software]]

Latest revision as of 10:54, 12 April 2010

Transcode provides an integrated framework for a large number of multimedia projects, bringing them together under one umbrella as a suite of command line utilities that are capable of encoding and transcoding a variety of video and audio codecs and for converting between different container formats. Transcode also provides further features such as post-processing filters, the ability to import DVDs on-the-fly, and being capable of recording from V4L devices.

Recording from a V4L device

This example works on saa7134 cards, using the saa7134-alsa DMA module under OSS emulation:

transcode -x v4l2=resync_margin=1:resync_interval=250,v4l2 -M 2 -H 0 \
-i /dev/video$DEV -p /dev/dsp$DEV -y ffmpeg -F h264 -c 00:$TIM \
-g 640x480 -f 29.970,4 -u 1024,2 -w 800 -b 128 -Q 5 -e 32000,16,2 \
-o $DIR/$FIL.avi --progress_off

The trick here is to set the audio import to 32000,16,2 -- the parameters used by the DMA audio channel on the card, and thus by the 7134-alsa module. The resync parameters are borrowed from Francesco Romani's recent addition to the transcode wiki; they appear to solve the sync problem, way cool!

The attempt to start two threads -- "-u 1024,2" -- fails because transcode doesn't yet have its own x264 export module (Francesco is working on it). The workaround is to create ~/.transcode/ffmpeg.cfg with this content:

[h264]
threads = 2

On a dual-core, I found xh26 doesn't do a great job with two threads -- CPU utilization doesn't get past full use of one core -- but ymmv. In addition, the recording time is extended beyond what is requested by up to 40%.

The audio device referred to here is /dev/dspN, using the OSS emulation layer provided by ALSA. The transcode developers are working on accessing ALSA devices directly.

Switches

  • For audio bitrates, you can use "--lame_preset medium" or specify a fixed bitrate, such as "-b 96"
  • To turn off verbose progress feedback, for instance if you're having the result of a cron job mailed to you, use "--progress_off"
  • To turn off device probling, use "-H 0" -- removes a few error messages, as v4l device probing is still imperfect in transcode

GUI Frontend for transcode's V4L functions

Gv4l provides a GUI frontend for transcode's ability to record audio & video streams from V4L devices, in either compressed or raw uncompressed formats.

External Links