Menu

Capturing video/sound from capture card

ken
2009-10-12
2012-09-15
  • ken

    ken - 2009-10-12

    Hi all,

    I am mostly a newbie - I used LiVES a few years back to convert some VHS tapes
    (made originally from 8/16mm home movies) into computer friendly forms.

    At that time, I could enter a URL for mplayer (tv:// ...) and LiVES would
    capture that output. But now, I can't seem to find that functionality in this
    version (1.1.2).

    So, simple(?) question: how do I do that now?

    TIA

    ken

    BTW: this is a great piece of software. I tried many other video editors -
    both on linux and windoz, and this works the best for me. The only thing
    missing - at least for me - is adding in DVD structures (titles, menus, etc.).
    Perhaps a link to DVDAuthor? Then again, it really isn't that necessary, since
    QDVDAuthor does that, and fairly well.

     
  • Salsaman

    Salsaman - 2009-10-13

    Hi Ken,

    I am not sure how this would work, but perhaps File -> Open Location/Stream
    would do the trick.

    Regarding your second point, this is planned as a future enhancement (post-
    encoding activities)

    : https://sourceforge.net/tracker/?func=detail&aid=2818291&group_id=6
    4341&atid=507142

     
  • ken

    ken - 2009-10-13

    I tried that with the following stream:

    tv:// -tv device=/dev/video0:driver=v4l2:input=1:amode=1:immediatemode=0:audio
    rate=48000:adevice=/dev/dsp1

    This works with standalone mplayer, giving me a window w/ audio. But when I
    use it in LiVES, all I get is rgb snow, and no audio.

    I was thinking it might be something with the video format output by mplayer -
    any suggestions would be appreciated. But then there is the no audio problem.

    FWIW: I tried to capture from an external window, but the video was the same,
    and jack audio complained about everything and turned into a rogue unkillable
    process (where's keannu reeves when you need him? :-( ).

    ken

     
  • Salsaman

    Salsaman - 2009-10-13

    The sound part should be easy to solve - you need to remove some of your
    settings, ie.

    tv:// -tv device=/dev/video0:driver=v4l2:input=1:amode=1:immediatemode=0

    You may be getting snow because the framerate is too high to encode properly,
    so try a lower fps setting, e.g.

    tv:// -tv
    device=/dev/video0:driver=v4l2:input=1:amode=1:immediatemode=0:fps=10

     
  • ken

    ken - 2009-10-14

    No luck.

    still the same "snow", with no audio. BTW: the "snow" is
    more like vertical lines of the spectrum (different colors). I have seen this
    before, but can't remember how to fix it.

    As for the audio, these were needed by mplayer to get sound to capture with my
    capture card.

     
  • ken

    ken - 2009-10-14

    Okay, I think I got it figured out (I must be turning into a guru to even
    think of this:-) ).

    I started up LiVES in a terminal window. When I tried to run my capture URL, I
    got this mplayer command string (won't go into details):

    mplayer {bunch of LiVES generated options} "my URL"

    My URL is tv:// {my options}

    Apparently my options were conflicting with the generated options. I assume
    the LiVES generated mplayer options come mainly from the preferences, as well
    as some other assumptions made by the app. My options are needed specifically
    to get both video and audio off of my card.

    IMHO, I see a somewhat simple solution: have an advanced option for the
    Open From Stream selection (like a check box in the enter URL dialog) that
    displays the entire generated mplayer command, and then

    allows the user to add/edit his/her own options (caveat emptor, though,: the
    user must know what LiVES is expecting from mplayer; hence the advanced
    label).

    Another more complicated solution, that probably isn't needed as much, is to
    have a Capture From TV Card selection that would let the user select the
    specific options for his/her card (this would also work for DV camcorders,
    webcams, etc.). That would take a lot more development work, and I don't know
    if enough people would want to use LiVES to capture video directly to make it
    worthwhile.

    Anyways, that is where I am at. For now, I will just get mplayer to capture
    the video/audio to a file, and import that file into LiVES (that is what I was
    hoping to avoid).

    But the edit URL option I think would still be useful :-).

    Thanks,

    ken

     
  • Salsaman

    Salsaman - 2009-10-14

    OK, thanks - that has calrified things a bit. What you are suggesting is kind
    of possible already.

    First, go into Preferences and find the Decoding tab. Then, where you see
    Video Open Command, with an entry something like:

    /usr/bin/mplayer

    I want you to edit this and replace it with:

    /usr/bin/mplayer -tv
    device=/dev/video0:driver=v4l2:input=1:amode=1:immediatemode=0

    then click OK.

    Now go to File/Open location or stream, for the URL just enter: tv://

    also select "Do not send bandwidth"

    I think this should work. After capturing your clips, you will need to reverse
    the process and set the command back to /usr/bin/mplayer

    or you will not be able to open ordinary video clips.

    You may also need to enter videorate=48000 option, if the audio is coming out
    at the wrong rate.

    The option adevice=/dev/dsp should not be used, as this will cause the audio
    to be sent to your soundcard, and LiVES needs to send it to a file.

    Also, you can see the format of the command by editing the file
    /usr/bin/smogrify, and near the beggining of the file adding: $DEBUG_OPEN=1;

    Hope this helps !

     
  • ken

    ken - 2009-10-15

    Okay, that helped - mostly.

    It will now capture video, but the sound it captures is all noise. I added
    audiorate=48000 to the mplayer open command, but that didn't help.

    I think this has something to do with the way I had to software wire things to
    get my capture card to route its audio to pulse audio. I have to use oss and
    not alsa - hence the /dev/dsp I used before (it took serveral weeks of
    googling and forum posts to get that to work).

    Jack also messes up sound on my system, so I try to avoid it.

    I am going through all the steps I did originally to make the audio capture
    work. But if you have any ideas, please feel free to tell me.

    BTW: When I capture a video cliip (usally about 60 secs) and then try to play
    it (Play->Play All), it shows (in the preview window) the first few frames,
    then jumps to the last frame and ends. If I have it loop continuously, then it
    will play all frames, repeatedly, though. Is there something I am missing?

    Thanks for your help, and great software.

    ken

     
  • Salsaman

    Salsaman - 2009-10-15

    Ken,

    can you capture a short clip - say about 10 seconds, then in LiVES
    File->Backup and attach the resulting .lv1 file here. I can then take a
    look at the audio and try to figure out what the problem is and how to solve
    it.

    Cheers,

    Gabriel.

     
  • ken

    ken - 2009-10-15

    Gabriel,

    I finally got it to work! I played around with mplayer options (actually
    SMPlayer since it uses similar options to LiVES), scouring over log files,
    until I got both video and sound captured.

    The main problem - with the sound - was knowing where the capture card's audio
    gets routed to. In my case it was /dev/dsp1. At first, it may not seem logical
    to you (or me), but what I had to do originally to get to the capture audio
    was to use oss, and via various options to the snd_oss modules, alias that
    audio output (fromt the card) to /dev/dsp1.

    Therefore, after adding adevice=/dev/dsp1 to the mplayer command line, the
    audio and video caputred perfectly.

    I would send you the backup .lv1 file, but I couldn't figure out how to attach
    a file in this forum.

    Thanks for the help, though.

    As I mentioned in my last post, I am still having problems playing back the
    captured clips in the editor preview wiindow. The preview window pops up and
    may show a frame or two, then closes. Any ideas about this?

     
  • Salsaman

    Salsaman - 2009-10-15

    Great news that you got it working !

    Hazarding a guess about the playback problem - most likely you are using sox
    as your audio player and it is failing because something else is using the
    soundcard. I would recommend that you upgrade to LiVES 1.1.3 and use the pulse
    audio player as it is the easiest to set up.

     
  • ken

    ken - 2009-11-09

    I rebuilt and installed 1.1.5.

    But apparently the same issues. Here is the startup messages:


    LiVES 1.1.5

    Copyright 2002-2009 Gabriel Finch (salsaman@xs4all.nl) and others.

    LiVES comes with ABSOLUTELY NO WARRANTY

    This is free software, and you are welcome to redistribute it

    under certain conditions; see the file COPYING for details.

    error loading plugin /usr/lib//lives/plugins/effects/realtime/weed/libvis.so



    Note the double '/' after /usr/lib. I did verify that libvis.so is in the
    proper directory.

    As for the preview/sound problems: I am not using sox. I think I mentioned
    earlier, but Jack doesn't play well with my capture card (bad Jack, bad Jack).
    For the card (Pinnacle based on Conexant cx288xx chip), I need to use oss to
    capture audio. I would love for someone to figure out how to get alsa to work
    with it, but I spent months googling, posting, and experimenting and this is
    the only thing that worked.

    Maybe I should try sox?

    One other thing (isn't there always?): I captured a video from VHS (with both
    video and stereo audio). Lives reported that it changed the frame rate (from
    29.97 - standard NTSC) to 29.00 fps. When I encoded the clip as XVid/MP3, the
    video was sped up, although the audio was in real time (ie, out of sync with
    the encoded video). I am using the followng options to mplayer to capture:

    -tv adevice=/dev/dsp1:device=/dev/video0:amode=1:immediatemode=0:audiorate=48000:mjpeg:decimation=1

    (the 'mjpeg' option just pulls the mjpeg frame straight from the card so no
    transformation should be needed; 'decimation=1' sets the size to 704x480).

    Any suggestions?

    Thx for all the help, tho.

    ken

     
  • ken

    ken - 2009-11-10

    Couple of quick notes

    • the double back slash still exists in 1.1.5. I've only seen it when lives starts up, as shown in previous message
    • preview does play: I switched the player from mplayer to jack (mplayer can't open output device - /dev/dsp1 - if jack is runniing)
    • When encoding a clip captured from video (captured using mplayer options in previous message), the first 50 seconds are okay, but after that, the video speeds up. This happens with several different encoding formats
    • when playing an AVI back with VLC, VLC will "fix the indexing" before playing.
    • ffmpeg encoding to divx w/ mp3 audio fails: error message is that ffmpeg can't find mp3 encoder, although my ffmpeg is built with mp3lame. It is the stock version from the fedora repo.

    I have a backup (.lv1) of a very short clip (about 1 minute). If you let me
    know how to attach it to a message here (I am using the lives sourceforge
    forum) I will do that. Else, if you let me know your email address, I will
    attach it and send it that way.

    If I seem needy about this, I am trying to put together a dvd of clips from
    several home video VHS tapes of my nephew for his 18th birthday coming up
    soon.

    I've played around with other video capture/editing apps - both for linux and
    windoz - but lives is by far the most complete and best that I have found. The
    VJ stuff adds a little extra to my dvd present :-).

    Thanks to everyone involved for great OPEN software.

    ken

     
  • Salsaman

    Salsaman - 2009-11-10

    Hi again Ken.

    1) The double backslash/warning message is not relevant.

    2) You should be able to get around the ffmpeg/divx problem as follows:

    edit /usr/lib/lives/plugins/encoders/ffmpeg_encoder and change the following
    line (93):

    if ($otype eq "flv"||$otype eq "flv-youtube"||$otype eq "flv-youtubex") {

    to:

    if ($otype eq "flv"||$otype eq "flv-youtube"||$otype eq "flv-youtubex"||$otype
    eq "divx") {

    (Thanks for the heads-up, I will include it in the next release).

    This will then let you select mp3lame as the audio format.

    3) You can email the .lv1 file to me @ salsaman@gmail.com

    4) Just FYI, after encoding, you will find a file called encoder_log_*.txt in
    the LiVES temp directory. This will have the output of the encoder which you
    can examine for errors.

     

Log in to post a comment.