Difference between revisions of "Transcode"

From LinuxTVWiki
Jump to: navigation, search
(Introduction)
m (Recording from v4l)
Line 16: Line 16:
 
--lame_preset medium -o $DIR/$FIL.avi
 
--lame_preset medium -o $DIR/$FIL.avi
   
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]; I've not yet had a chance to test them, but sync is a known problem without these parameters.
+
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!
  +
  +
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.
   
 
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.
 
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.

Revision as of 06:56, 31 March 2006

Introduction

The transcode program provides an integrated framework for encoding and transcoding, bringing together a large number of multimedia projects under one umbrella.

Recording from v4l

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 \
-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 \
--lame_preset medium -o $DIR/$FIL.avi

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.

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.