Forum Replies Created

Page 1 of 2
  • Dr. nagy Ferenc

    January 6, 2008 at 9:07 am in reply to: MP3 in an avi file

    I installed the FHG Radium MP3 codec v1.263 and now there are two “MPEG Layer-3” audio codecs and one of them contains higher bitrates as well. However, if I choose anything higher than 56 kbps, it says “An error occured while opening a codec.”. If the bitrate is <= 56 kbps, then it's fine. The real solution would be to use Sony's built-in mp3 codec but I don't know how to access that. (I could render the video and the audio separately and then put together with VirtualDub but that's just stupid, there should be a smarter workaround.)

  • Dr. nagy Ferenc

    January 1, 2008 at 8:07 am in reply to: Separate scanned photos

    Thanks, that’s exactly what I’m looking for.

  • Dr. nagy Ferenc

    December 16, 2007 at 2:42 pm in reply to: 3D Track Motion Weirdness

    I wanted to do exactly the same thing and had the same problem. My workaround is simple: I put a 2D track between every 3D tracks. It’s not a nice solution but since I do the whole project via scripting, it’s the easiest thing to do — and it works perfectly well.
    If you’re interested in my script, you can find it here: https://forums.creativecow.net/thread/24/875493

  • Dr. nagy Ferenc

    December 13, 2007 at 5:47 pm in reply to: Scripting parent track’s motion

    It seems that this scripting feature is not implemented yet — maybe it will be in Vegas 9.

  • Dr. nagy Ferenc

    December 13, 2007 at 4:24 pm in reply to: How to get rid of motion blur

    A managed to solve the problem myself. The problem was that “Field order” was set to “Lower field first” instead of “None (progressive scan)” which is appropriate.
    Free Image Hosting at www.ImageShack.us

  • Dr. nagy Ferenc

    December 10, 2007 at 7:15 pm in reply to: Scripting parent track’s motion

    Thanks for your response. I tried it that way but it actually sets the track’s motion and does not affect the child tracks.

    I’m afraid there is no solution for this problem but still it would be good if anyone could confirm that.

  • Dr. nagy Ferenc

    December 7, 2007 at 9:13 pm in reply to: Scripting 3D track motion

    I’ve uploaded this picture for a different topic but it shows quite well what this script does (look at the left picture):
    Free Image Hosting at www.ImageShack.us

  • Dr. nagy Ferenc

    December 6, 2007 at 10:09 pm in reply to: Scripting 3D track motion

    I completed the alpha version of my script.
    The “Polaroid-frame” is given the images by a Photoshop action, it’s actually 20 pixels of white and 2 pixels of black border.
    I used the PSD files directly so I could have a very slight shadow (of course, unfortunately JPEG is not capable of transparency).
    My video settings are 720*540 square pixels and 25 fps.

    It might have a few bugs and problems with random number generation but it worked fine for 3 pictures.

    import Sony.Vegas;
    import System.Windows.Forms;
    
    const seconds = 100;
    const n = 3; //number of pictures
    const path = "D:\\pictures\\"; //path of the directory containing the background
                                   //and the pictures named as 1, 2, 3...
    const extension = ".psd";
    const backgroundImageFile = "background.jpg";
    const picInterval = 3 * seconds;
    const moveInterval = 1 * seconds;
    const picWidth = 600; //the photos' width in the video
    const maxRotationDegree = 10; //the rotation will be between -maxRotationDegree and +maxRotationDegree
    const minRotationDifference = 5; //minimum difference between a rotation and the previous/next one
                                     //be careful, if minRotationDifference >= maxRotationDegree,
                                     //the script will freeze
    const projectWidth = 720;
    const projectHeight = 540;
    const distanceX = 400; //the horizontal distance of startKeyframe
    const distanceY = 250; //the vertical distance of startKeyframe
    
    //this function inserts a new video track containing one image file
    function insertImageTrack(imageFilePath, name, startTime, endTime) {
      var track = new VideoTrack(0, name);
      Vegas.Project.Tracks.Add(track);
      
      var media = new Media(imageFilePath);
      if (!media.IsValid()) throw "Media file does not exist: " + imageFilePath;
      
      var trackEvent = new VideoEvent(new Timecode(startTime), new Timecode(endTime), "Video Event 0");
      track.Events.Add(trackEvent);
      var stream = media.Streams.GetItemByMediaType(MediaType.Video, 0);
      trackEvent.Takes.Add(new Take(stream));
      
      return track;
    }
    
    //main script
    
    //inserting the background
    insertImageTrack(path + backgroundImageFile, "background", 0, picInterval * n + 1);
    
    //inserting the image tracks
    var prevRotation, newRotation;
    prevRotation = 0;
    
    for (var i = 1; i <= n; i++) {
      var myTrack3D = insertImageTrack(path + i + extension,
                                     "pic" + i + " 3D",
                                     picInterval * (i - 1) + 1,
                                     picInterval * (n - i + 1));
      myTrack3D.CompositeMode = CompositeMode.SrcAlpha3D;
      
    //3D track  
      //set endKeyframe
      var endKeyframe = myTrack3D.TrackMotion.InsertMotionKeyframe(
         new Timecode(picInterval * (i - 1) + moveInterval)
      );
      endKeyframe.Height = endKeyframe.Height * picWidth / endKeyframe.Width;
      endKeyframe.Width = picWidth;
      //generating random rotation it's not different enough from the previos one
      do {
        newRotation = (Math.random() - 0.5) * 2 * maxRotationDegree;
      } while (Math.abs(newRotation - prevRotation) <= minRotationDifference);  
      endKeyframe.OrientationZ = newRotation;  
      prevRotation = newRotation;
      
      //set startKeyframe 
      var startKeyframe = myTrack3D.TrackMotion.InsertMotionKeyframe(
        new Timecode(picInterval * (i - 1))
      );
      
      startKeyframe.VideoKeyframeType = VideoKeyframeType.Fast;
    
      //setting the angle
      startKeyframe.OrientationY = 90;
      
      //the startKeyframe (center) position is somewhere outside the video
      //on a rectangle which is distanceX and distanceY far from the video
      if (Math.random() < 0.5) {
        //top or bottom
        var posX = (Math.random() - 0.5) * (projectWidth + distanceX * 2);
        var posY = (distanceY + projectHeight / 2) * ((Math.random() > 0.5) ? (+1) : (-1));
      } else {
        //left or right
        var posX = (distanceX + projectWidth / 2) * ((Math.random() > 0.5) ? (+1) : (-1));
        var posY = (Math.random() - 0.5) * (projectHeight + distanceY * 2);
      }
      startKeyframe.PositionX = posX;
      startKeyframe.PositionY = posY;
    
    
    //empty 2D track
      Vegas.Project.Tracks.Add(new VideoTrack(0, "blank"));
    }
    

    The empty 2D track is there so that the 3D tracks won’t “cross” each other while moving. However, I’m sure there is a cleverer workaround for there. Any other ideas and improvements are welcome as well.

  • Dr. nagy Ferenc

    December 4, 2007 at 9:04 pm in reply to: Scripting 3D track motion

    The video will show Polaroid-like photographs falling on a surface. I think this is a much more stunning way of showing them than using the incredibly boring transitions.
    I have to sort out the appropriate limits for random numbers to make it look good – this might take while. However, as soon as I finish it (probably on the weekend), I’ll post it here.

  • Dr. nagy Ferenc

    December 4, 2007 at 7:32 pm in reply to: Scripting 3D track motion

    I’ve finally managed to get it working with this code:

    var myTrack = VideoTrack(track);
    myTrack.CompositeMode = CompositeMode.SrcAlpha3D;
    var startKeyframe = myTrack.TrackMotion.MotionKeyframes[0];
    var endKeyframe = myTrack.TrackMotion.InsertMotionKeyframe(new Timecode(1000));

    Now I can access the startKeyframe.RotationX / Y / Z, startKeyframe.OrientationX / Y / Z and all the other 3D properties.

    Thank you very much for your help, I truly believe only a few people in the world could have solved this innocent-looking problem — just look at Google which doesn’t return any results for “InsertMotionKeyframe”.

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy