First in a series of LMMS and ZynAddSubFX videotutorials

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

First in a series of LMMS and ZynAddSubFX videotutorials

Post by unfa »

Hey!

I've just released the first video for a project "LMMS & ZynAddSubFX Watch and Learn" (LZW for short).

Find the video here:
http://youtu.be/7tq4lX6OmLc

And post on my blog here:
http://unfamusic.com/1343

I hope to get some feedback and requests form you :)
And to give you some useful knowledge with with this!
nils
Established Member
Posts: 538
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by nils »

I started watching it, in fact it is still running.
It looks so professional and I really like the sound and from the mouse running around the screen it looks you really know what you are doing! Great stuff to have.
Maybe you can tell us something about the screen casting and video editing process as well?

I downloaded the video from youtube to be sure my connection is allright and I play it back in (s)mplayer.

But I am terribly sorry, I can't bear to watch it once you start creating the sounds around minute 5 or 6. I skipped through the video and all the actual screencasting is really really out of sync.
I am talking several seconds here. Maybe the amount is varying because I couldn't find the right amount of audio delay for mplayer to get it back in sync.

As a podcast, audio only, it is a bit lame since I want to see what you are doing.

Is there any chance you can try to fix the desync manually in a video editor and re-upload (if it is a constant latency)?
User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by unfa »

NilsGey wrote:I started watching it, in fact it is still running.
It looks so professional and I really like the sound and from the mouse running around the screen it looks you really know what you are doing! Great stuff to have.
Maybe you can tell us something about the screen casting and video editing process as well?

I downloaded the video from youtube to be sure my connection is allright and I play it back in (s)mplayer.

But I am terribly sorry, I can't bear to watch it once you start creating the sounds around minute 5 or 6. I skipped through the video and all the actual screencasting is really really out of sync.
I am talking several seconds here. Maybe the amount is varying because I couldn't find the right amount of audio delay for mplayer to get it back in sync.

As a podcast, audio only, it is a bit lame since I want to see what you are doing.

Is there any chance you can try to fix the desync manually in a video editor and re-upload (if it is a constant latency)?
Hey! I'm very sorry for the desync, I have no idea why it happens. I recorded the video with recordmydesktop, and audio with Ardour (as you can see in the video).
All video work is done in Blender.

I think I migth try to manually re-sync the audio every n minutes, but I had very hard times to get it in sync even in one point. The problem is even reference audio I have recorded with recordmydesktop is floating and I have no idea how to ensure I get a stable, synchronised material. Maybe I should start capturing everything with external devices?

I'm watching the original file in VLC right now and it seems like it's coming out of sync an in back again at times. I wonder if this is not some flaw of Ogg Video format. Maybe if I used Xvid I woudn't get this problem...
Shadow_7
Established Member
Posts: 175
Joined: Tue Jun 08, 2010 3:35 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by Shadow_7 »

In mplayer you can use the - / + keys to change the audio delay on the fly during playback (for the +/- by the zero key you do not have to hold shift because the = works for +).

If the sync is consistently the same amount off, it's likely that the audio is captured at a sooner time than the video. About 200ms of a difference for my tv capture card. But I'm splitting the signal at the VCR because my desktop doesn't have the audio connection that exits the capture card. Our brains cringe at hearing things before the event that triggered them is seen. Because it's normally the other way around.

There was a trick to use jackd to create a delay of a specified amount. But I don't recall how that was done. And a few other ways to fix it at the playback, without having to re-edit the video. Although improving the source video is ideal. I'm noticeing the a/v shift myself, so it probably needs the +/- on the fly to adjustment if you use mplayer. Since it appears to be the content.

EDIT: It looks like the first ten minutes average about 200ms-ish off, then it jumps to several seconds out of sync and I'm not sure in which direction.
Nachei
Established Member
Posts: 235
Joined: Fri Feb 17, 2012 3:32 am
Has thanked: 6 times
Been thanked: 27 times
Contact:

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by Nachei »

Funny coincidence, I was looking for a better way to do my bass lines, and precisely today I opened LMMS for the first time. :)

In that vein, it would be great a tutorial about how to use samplings in LMMS, and maybe a few tips about how to humanize a sampled bass line. I am more into rock than drum&bass, so maybe this is something you are not interested in covering -- you have a lot of skill at using Zyn parameters, and maybe never use samplings. So, as a second suggestion for the database...

It would also be really great to have a tutorial on the Zyn parameters --or well, synthesizer parameters in general, I guess--. Whenever I try to find a sound that resembles other in my head, I have to experiment a lot, I find the Zyn interface a bit intimidating, and the documentation very crammed and 1990-ish, so it would be great having a visual guide with you moving the knobs as you do in this video.

Again, you seem to be very tech-savy and take a lot of stuff for granted, so maybe you are not interesting on doing a tutorial at such an 'elemental' level, but, well, these are my 2 cents. Great job, it will be nice to see more stuff showing up in Youtube when searching for open source music tools... :)
User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by unfa »

Hey!
I'd love to carry on with this, but I need help.
I can't get my video and audio in sync!
Sometimes when I open ZynAddSubFX's interface from LMMS plugin I get a "zzzzzzap" and then framerate is broken. I have video that is playing like 4 times faster for a while, then freezes, then plays back again faster, slooowly, then gets in sync for a while, and breaks up again.

If any of you made a screencast and have any tips of how to record them - I'd appreciate. I've got a lot of knowledge to share, and I see people want to receive it, but I seem to have some evil tech against me.

I'm acttualy thinking about an audio-only tutorial form, or IDK.

I'm frustrated with this, as hours of my work get trashed by some wicked software problems.
I want to do things right, prepare them well and post-production. but I can get a good desktop video capture that would not corrupt files on machine hangups...
male
Established Member
Posts: 232
Joined: Tue May 22, 2012 5:45 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by male »

unfa wrote:Hey!
I'd love to carry on with this, but I need help.
I can't get my video and audio in sync!
Sometimes when I open ZynAddSubFX's interface from LMMS plugin I get a "zzzzzzap" and then framerate is broken. I have video that is playing like 4 times faster for a while, then freezes, then plays back again faster, slooowly, then gets in sync for a while, and breaks up again.

If any of you made a screencast and have any tips of how to record them - I'd appreciate. I've got a lot of knowledge to share, and I see people want to receive it, but I seem to have some evil tech against me.

I'm acttualy thinking about an audio-only tutorial form, or IDK.

I'm frustrated with this, as hours of my work get trashed by some wicked software problems.
I want to do things right, prepare them well and post-production. but I can get a good desktop video capture that would not corrupt files on machine hangups...
I've spent about a week on this issue myself. I've tried all of the available tools and even fixed a number of bugs in ffmpeg to no avail. The only way I've found to do screencasting is to record my screen with a video camera into which audio is fed from the system's line outs. No matter what I tried nothing could record audio and video in sync--regardless of framerate.

If you find a working solution--do let us know. I've given up myself. Perhaps an expert in gstreamer could find a solution. ffmpeg seems hopelessly messy. Writing a new tool from scratch is also an option. Capturing timestamped screenshots and audio buffers is not difficult--the hard part is muxing them into an A/V container that supports such timestamping which can then be transcoded into something distributable.
Image
Shadow_7
Established Member
Posts: 175
Joined: Tue Jun 08, 2010 3:35 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by Shadow_7 »

If you have a second machine and it has a capture card it's probably better to use it for the recording half. Assuming you have a dual head video card so you can clone the output and feed one to the capture card and one to the monitor you're looking at. Otherwise a camcorder user perspective isn't ideal, but it's more easily functional for video and audio sync.

My tv capture card (old aka analog) doesn't have a consistent framerate. I seem to recall using -benchmark with mplayer to capture from it with a forced framerate, but it's been so long. And things have probably evolved since then.
nils
Established Member
Posts: 538
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by nils »

There are hdmi and dvi + audio capture cards, intended for gaming 1920x1080 with 30fps up to 60fps.

While I think in the long run this might be a convenient and robust solution for people who do recording on a daily basis (professional screencasters and journalists) it cannot be that in the super-flexible-and-open-source-route-anything-to-anywhere there is no direct and good solution..

I did live streaming in linux with gstreamer, and that was hell and it took a long long way to get a somewhat stable pipeline. I never succeeded in just recording the exact same pipeline, just exchanging one end-point (internet streaming service) with another (local file). I can already hear the answer "That cannot be, just must have something wrong". First: I doubt it, Second: This is such a common , why didn't it work?

"We" (Linuxworld) seem to lack the requirements and demands of what capturing does in windows. High performance game recording, where the sound-effects have to match the video in the same strict sync that is required from pro-audio screencasts.
Shadow_7
Established Member
Posts: 175
Joined: Tue Jun 08, 2010 3:35 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by Shadow_7 »

Well the OEMs sort of work with that other OS. And actively work against linux. Case in point, adobe flash player. 11.2 is the latest linux version. 11.8 for windows. With a nice little message about linux support on future versions will not exist, but security fixes for 11.2 will likely exist. I mention the adobe thing because pogo.com which I used to play in linux, now bumps you to an upgrade flash page, which you basically can't in linux. Glad I don't have any EA stocks. And hopefully they'll refund the membership fees for the next 9 months that I wont be able to use. And at what point does youtube bump you to an upgrade screen that you cannot comply with?

I've captured in linux. I haven't captured and performed system demanding things at the same time. But my machines are over five years old. I don't expect to, even if I ran windows. If you had a quad core i7 with 8GB of ram I'm sure most issues would be moot. If you had the I/O capacity, you could probably script a screen capture 30 times a second and record audio at the same time. On my machine I'm doing good to capture 640x480 @ 5 fps. But I can still to some degree do all of the audio things reviewed by the video that started this thread.

Anyway this prompted me to dig up my old capture script. Disclaimer, not up to date with parameters. And for a tv capture card. But it should give someone something to base something more current off of.

Code: Select all

#!/bin/sh

if [ ! -r ./stream.yuv ]; then
  mkfifo stream.yuv
else
  echo "stream.yuv ALREADY present"
fi

mplayer -vo yuv4mpeg:file=stream.yuv -benchmark tv:// \
        tv=driver=v4l2:norm=0:input=0:outfmt=uyvy:width=640:height=480:quality=100:fps=60000/1001 \
        -vf yadif=0,scale -fps 30000/1001 -ao null -nosound -noframedrop -quiet -msglevel all=-1 &
ffmpeg -f oss -ac 2 -ar 48000 -i /dev/dsp \
       -f yuv4mpegpipe -i stream.yuv \
       -f avi -vcodec mpeg4 -b 50000k \
       -acodec pcm_s16le \
       -r 30000/1001 -y test.avi

killall mplayer

rm stream.yuv

echo
echo "FINISHED!!!"
Granted that you need to set the tv channel outside of this, I used to do that by running tvtime. But now do it by:

# v4l2-ctl -f 61.25
(aka channel 3)

Also noting that -b is now -b:v for video bitrate and -b:a for audio bitrate. For an old leadtek winfast 2000xp expert card I got off craigslist at the dawn of the digital tv turn over. aka Many moons ago. It has no on card encoding capabilities. I have no idea if that script still works, even if you change the parameters that are different now.
male
Established Member
Posts: 232
Joined: Tue May 22, 2012 5:45 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by male »

Unfa, I just posted my findings here: http://linuxmusicians.com/viewtopic.php?f=19&t=11352

Please try my solution. I think you'll be pleased.
Image
Shadow_7
Established Member
Posts: 175
Joined: Tue Jun 08, 2010 3:35 pm

Re: First in a series of LMMS and ZynAddSubFX videotutorials

Post by Shadow_7 »

I know it's been a while. But to expand on my old way, here's my new way of screen capture.

Code: Select all

avconv -f alsa -i default -f x11grab -s 1920x1080 -r:v 5 -draw_mouse 1 -i :0.0+0,0 \
            -aspect 16:9 -pix_fmt yuv444p -async 1 -r:v 5 \
            -codec:a pcm_s16le -codec:v libx264 -pre:v lossless_ultrafast \
            -filter_complex "asyncts=compensate=1:min_delta=0.1:max_comp=500:first_pts=0" \
            -y OUTPUT.mkv
In combination with mplayer -geometry 0%:0% and a window manager (cwm) that has no decorations and a no border option (.cwmrc), although I could compensate for those things with the :0.0+0,0 part. The performance is just enough for an fps of 30000/1001 for a 640x480 image on an old 2GHz-ish dual core. Outputting it to X11 first allows mplayer to deinterlace the video before the capture. The async and the filter_complex parts are to overcome an audio video sync issue. At the full 1080p I could probably do better than 5fps, but it's nice to keep the CPU usage < 50% so you have something tollerable to record. But 2GHz dual cores with 2GB of ram are still my beefy machine(s).

Although most of this is moot if you use a 2nd machine to capture and a magewell or equivalent capture card. There's also jitsy, open broadcaster, and other options if you have the hardware for it.
Post Reply