mencoder audio problem
Hello, I posted the below question on fedoraforum.org but didn't get much help. Hello, I am having some problems getting sound when using mencoder to capture video/audio from my camcorder. Video is fine, but when I run the follow command and play the output file in mplayer I do not get sound. mencoder -tv driver=v4l:input=1:width=512:height=384:fps=25:nor m=ntsc tv:// -ovc copy -oac copy -o file.avi My plan was to first copy the video/audio to my hard drive with mencoder and then encode it with the xvid/mp3lame codecs. I can hear the sound when I am running the caputre. The audio out from my caputre card is patched into my mic port on my onboard sound card and within the alsamixer the mic is set to capture. I'm a beginner at this sort of thing so it's all a bit cloudly. Thanks for any help. I have 2 sound cards in my pc one onboard and one pci so someone suggested I add adevice to my command. So then I tried the command below. mencoder -tv driver=v4l:input=1:adevice=/dev/dsp: width=512:height=384:fps=25:norm=ntsc tv:// -ovc copy -oac copy -o file.avi This didn't work either. I need some help. Thanks, Chris
On Thursday 22 September 2005 04:00, Chris & Melinda LaForce wrote:
I have 2 sound cards in my pc one onboard and one pci so someone suggested I add adevice to my command. So then I tried the command below.
mencoder -tv driver=v4l:input=1:adevice=/dev/dsp: width=512:height=384:fps=25:norm=ntsc tv:// -ovc copy -oac copy -o file.avi
If you have multiple soundcards, see if there are other dsp devices in /dev, like /dev/dsp1 or /dev/sound/dsp1. I'm not familiar with multiple soundcards, but I suspect the devices will be named something like that. --Ivo
On Thu, 2005-09-22 at 05:05 +0200, Ivo wrote:
On Thursday 22 September 2005 04:00, Chris & Melinda LaForce wrote:
I have 2 sound cards in my pc one onboard and one pci so someone suggested I add adevice to my command. So then I tried the command below.
mencoder -tv driver=v4l:input=1:adevice=/dev/dsp: width=512:height=384:fps=25:norm=ntsc tv:// -ovc copy -oac copy -o file.avi
If you have multiple soundcards, see if there are other dsp devices in /dev, like /dev/dsp1 or /dev/sound/dsp1. I'm not familiar with multiple soundcards, but I suspect the devices will be named something like that.
--Ivo
Ivo, Thanks, for the reply. I have tried both /dev/dsp and /dev/dsp1 but I am pretty sure the sound card that I am patching into from my capture card is /dev/dsp because I ran cat /dev/urandom > /dev/dsp and heard static from the speaker connected to it. Could it be some setting within the alsamixer. Thanks, Chris.
On Thu, Sep 22, 2005 at 06:55:26AM -0500, Chris & Melinda LaForce wrote:
On Thu, 2005-09-22 at 05:05 +0200, Ivo wrote:
On Thursday 22 September 2005 04:00, Chris & Melinda LaForce wrote:
I have 2 sound cards in my pc one onboard and one pci so someone suggested I add adevice to my command. So then I tried the command below.
mencoder -tv driver=v4l:input=1:adevice=/dev/dsp: width=512:height=384:fps=25:norm=ntsc tv:// -ovc copy -oac copy -o file.avi
If you have multiple soundcards, see if there are other dsp devices in /dev, like /dev/dsp1 or /dev/sound/dsp1. I'm not familiar with multiple soundcards, but I suspect the devices will be named something like that.
--Ivo
Ivo, Thanks, for the reply. I have tried both /dev/dsp and /dev/dsp1 but I am pretty sure the sound card that I am patching into from my capture card is /dev/dsp because I ran cat /dev/urandom > /dev/dsp and heard static from the speaker connected to it. Could it be some setting within the alsamixer. Thanks,
Try using another program to test audio recording, e.g. "rec" included with sox. Rich
Hello. I made a x264 video file with mencoder using this command (only writing the third and last pass): ------<<<<CODE START>>>>------ $ mencoder-cvs -dvd-device dvd.iso -oac faac -ovc x264 -vf pullup,softskip,crop=704:480:8:0,hqdn3d=6:4:2 -ofps 24000/1001 -channels 5 -faacopts br=192:tns:cutoff=0 -x264encopts subq=6:frameref=6:me=3:4x4mv:bframes=3:b_adapt:b_pyramid:qcomp=0.7:keyint=300:8x8dct:pass=3:bitrate=1300 dvd://1 -chapter 1-1 -o file.avi ------<<<<CODE END>>>>------ the file looks good (although the audio appears to be a bit out of sync). However, I want to mux this into a matroska file (mainly to be able to add subtitles to it), but mkvmerge refuses: ------<<<<CODE START>>>>------ $ mkvmerge -o file.mkv --atracks 1 --vtracks 0 file.avi 'file.avi': Using the AVI demultiplexer. Opening file. This may take some time depending on the file's size. At the moment mkvmerge does not support converting from VfW-mode AVC/h.264 tracks to native Matroska-mode AVC/h.264 tracks. You can, however, first import the video track into a MP4 file with e.g. 'MP4Box' (use Google). Then you can use mkvmerge and put the video into a Matroska file. If you really know what you are doing then you can force mkvmerge to put this AVC/h.264 track into a Matroska file even in VfW mode if you add '--engage allow_avc_in_vfw_mode' to the command line. You can do that in mmg with the 'Add command line options' menu entry in the 'Muxing' menu. ------<<<<CODE END>>>>------ using '--engage allow_avc_in_vfw_mode' creates a broken file, so I try MP4Box: ------<<<<CODE START>>>>------ $ MP4Box -add file.avi file.mp4 Video format h264 not supported - recompress the file first Error: Feature Not SupportedError importing file.avi: Feature Not Supported ------<<<<CODE END>>>>------ I also tried to get mencoder to put this in a mp4 file with -of lavf and -lavfopts format=mp4, but this creates a broken file as well; mplayer crashes after a few seconds when I play it, and mkvmerge says it doesn't recognize the codec. So, am I doing something wrong or is it just impossible to mux x264 files created by mencoder to matroska? Thank you.
Fredrik Eriksson wrote:
Hello.
I made a x264 video file with mencoder using this command (only writing the third and last pass):
------<<<<CODE START>>>>------
$ mencoder-cvs -dvd-device dvd.iso -oac faac -ovc x264 -vf pullup,softskip,crop=704:480:8:0,hqdn3d=6:4:2 -ofps 24000/1001 -channels 5 -faacopts br=192:tns:cutoff=0 -x264encopts subq=6:frameref=6:me=3:4x4mv:bframes=3:b_adapt:b_pyramid:qcomp=0.7:keyint=300:8x8dct:pass=3:bitrate=1300 dvd://1 -chapter 1-1 -o file.avi
------<<<<CODE END>>>>------
the file looks good (although the audio appears to be a bit out of sync). However, I want to mux this into a matroska file (mainly to be able to add subtitles to it), but mkvmerge refuses:
------<<<<CODE START>>>>------
$ mkvmerge -o file.mkv --atracks 1 --vtracks 0 file.avi 'file.avi': Using the AVI demultiplexer. Opening file. This may take some time depending on the file's size. At the moment mkvmerge does not support converting from VfW-mode AVC/h.264 tracks to native Matroska-mode AVC/h.264 tracks. You can, however, first import the video track into a MP4 file with e.g. 'MP4Box' (use Google). Then you can use mkvmerge and put the video into a Matroska file. If you really know what you are doing then you can force mkvmerge to put this AVC/h.264 track into a Matroska file even in VfW mode if you add '--engage allow_avc_in_vfw_mode' to the command line. You can do that in mmg with the 'Add command line options' menu entry in the 'Muxing' menu.
------<<<<CODE END>>>>------
using '--engage allow_avc_in_vfw_mode' creates a broken file, so I try MP4Box:
------<<<<CODE START>>>>------
$ MP4Box -add file.avi file.mp4 Video format h264 not supported - recompress the file first Error: Feature Not SupportedError importing file.avi: Feature Not Supported
------<<<<CODE END>>>>------
I also tried to get mencoder to put this in a mp4 file with -of lavf and -lavfopts format=mp4, but this creates a broken file as well; mplayer crashes after a few seconds when I play it, and mkvmerge says it doesn't recognize the codec. So, am I doing something wrong or is it just impossible to mux x264 files created by mencoder to matroska?
Thank you.
OK I got this one worked out, although it's very lengthy. I have to dump the videostream, but for some reason -dumpvideo in mplayer didn't work, so I had to use -of rawvideo in mencoder. Then the file must be named *.h264 or *.264, and then it can be remuxed to a .mp4 file with MP4Box, and then I can convert the mp4 file to matroska... well, if someone has the knowledge and some time to spare; a matroska muxer in mencoder would be greatly appreciated. Would like to help myself, but unfortunatly I don't think 3 weeks experience in C programming is enough... and I doubt that you would be happy with a muxer written in java ;)
On Wed, 21 Sep 2005 21:00:34 -0500 Chris & Melinda LaForce <cdlaforc@centurytel.net> wrote:
I can hear the sound when I am running the caputre. The audio out from my caputre card is patched into my mic port on my onboard sound card and within the alsamixer the mic is set to capture.
First I hope you mean your Line-in port, not "mic port". This is an FAQ. You need to set both the Line-in AND "Capture" devices as "Captur" with alsamixer.
On Thu, 2005-09-22 at 13:08 -0700, RC wrote:
On Wed, 21 Sep 2005 21:00:34 -0500 Chris & Melinda LaForce <cdlaforc@centurytel.net> wrote:
I can hear the sound when I am running the caputre. The audio out from my caputre card is patched into my mic port on my onboard sound card and within the alsamixer the mic is set to capture.
First I hope you mean your Line-in port, not "mic port".
This is an FAQ. You need to set both the Line-in AND "Capture" devices as "Captur" with alsamixer.
RC, Thanks that did it. I would like however to see this FAQ your talking about. I've been mostly googling for my information. Could you provide me with a link to the FAQ. Thanks, Chris.
participants (5)
-
Chris & Melinda LaForce -
Fredrik Eriksson -
Ivo -
RC -
Rich Felker