Is it possible to trim a video layer according to sound levels found in its audio spectrum?

Hi There,
I'm interested to know if there is any way via a script or an existing plugin that would allow me to trim down a video layer based on the sound levels in it audio track?  For example, if I wanted to set the in point for a source footage element to where sound started.  Is that possible with scripting?  If not, is there a plugin that analyzes the audio spectrum so that a script could possibly determine that point?
Thanks for your time and help!

This example uses the "Convert Audio to Keyframes" menu command to find the first frame where the selected layer's audio level is above the value specified in variable "threshold" (0.1 in this example). It then sets the selected layer's in point to that frame.
    var threshold = .1;
    function main(){
        var myComp = app.project.activeItem;
        if (myComp == null || ! (myComp instanceof CompItem)){
            alert("No comp active.");
            return;
        if (myComp.selectedLayers.length == 0){
            alert("No layer selected.");
            return;
        if (myComp.selectedLayers.length > 1){
            alert("More that one layer selected.");
            return;
        var myLayer = myComp.selectedLayers[0];
        if (! myLayer.hasAudio){
            alert("Selected layer doesn't have audio.");
            return;
        app.executeCommand(app.findMenuCommandId("Convert Audio to Keyframes"));
        var myAudioLayer = myComp.layer(1);
        var myProp = myAudioLayer.effect("Both Channels")("Slider")
        audioFound = false;
        for (var i = 1; i <= myProp.numKeys; i++){
            if (myProp.keyValue(i) > threshold){
                audioFound = true;
                myLayer.inPoint = myProp.keyTime(i);
                break;
        myAudioLayer.remove();
        if (! audioFound){
            alert("No audio above threshold found.");
            return;
    main();
Dan

Similar Messages

  • Added video to premiere didn't synchronized precisely with its audio

    so when I add a certain mp4 video (7 minutes long) to a new project, at the beginning its playing fine but at the middle its starts to be unsynced a little with its audio (a half of a second delay or so)
    but when I open it in MPC its precisely synced.
    strange thing that this issue only with that certain video file, other videos are meanwhile fine.
    please help people !

    Hi john and thank you for your answer !
    this file downloaded from youtube with this online tool - clipconverter.cc
    though ,it is not the only file that I worked with this way - through youtube and clipconverter.cc  , and for an unknown reasons it is the only one that makes me trouble.
    here is this file full characteristics
    General
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 103 MiB
    Duration                                 : 7mn 1s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 2 060 Kbps
    Encoded date                             : UTC 2012-01-29 18:33:37
    Tagged date                              : UTC 2012-01-29 18:33:37
    gsst                                     : 0
    gstd                                     : 421046
    gssd                                     : B0AFCF364MH1428357472807044
    gshh                                     : r13---sn-25ge7n7e.googlevideo.com
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : [email protected]
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 1 frame
    Format settings, GOP                     : M=1, N=30
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 7mn 1s
    Bit rate                                 : 1 916 Kbps
    Maximum bit rate                         : 6 676 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 29.917 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.070
    Stream size                              : 96.2 MiB (93%)
    Encoded date                             : UTC 1970-01-01 00:00:00
    Tagged date                              : UTC 2012-01-29 18:33:38
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 7mn 1s
    Bit rate mode                            : Variable
    Bit rate                                 : 144 Kbps
    Maximum bit rate                         : 214 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 7.11 MiB (7%)
    Title                                    : IsoMedia File Produced by Google, 5-11-2011
    Encoded date                             : UTC 2012-01-29 18:33:38
    Tagged date                              : UTC 2012-01-29 18:33:38

  • Good day everyone, just wanna ask for help regarding my iPad, this past few weeks I've noticed that while playing the videos that I made it doesn't have its audio, but when using my music and other stuffs it has audio.. same through when i use skype

    Hi everyone, I just wanna ask regarding my ipad, This past few weeks after I recorded a video, when I played it, it has no audio, while when I use My music it has audio and same through with other apps, and when I use my skype also I can't hear my voice on a test call, what's the best solution you could offer to me to help with my problem. Hoping for a positive response from the tech gurus here. thanks much -appleS

    Try a reset:
    Hold the Sleep and Home button down until you see the Apple logo.

  • Placing an Audio Spectrum Effect on top of a video.

    I'm wondering if it's possible to use the audio spectrum effect on top of a video layer. That is, the video is playing while there is an audio visualizer *on top* of it. My goal is to produce a video podcast, but add some style to it by having each podcast member have their voice synced to an audio visualizer while there are video clips playing in the background.
    Is this possible with After Effects, or any of Adobe's products at all? Every time I place an audio spectrum effect on, I can hear the audio of my video clips, but the visualizer refuses to show on top of anything other than the black background that appears the moment I activate the effect.
    Can anyone help? Thanks.

    Place the audio in the comp and then add a solid layer. (comp size)
    Next, go to Effects, Generate, "Audio Spectrum" or "Audio Waveform" depending on what you'd like.
    You can apply the waveform directly to the video layer, but placing it on a separate layer allows separate adjustment of both layers independently.
    There are quite a few parameters that can be adjusted, however the defaults should be fine for most things.
    Here's a nice tutorial on the effect:
       http://www.motionworks.com.au/2009/08/effect-audio-wavefor/
    --Desmond

  • Video is not sync with its audio and imported material is degraded

    I'm new to Adobe Premiere.
    Problem #1: Whenever i import videos (the one i captured using windows movie maker), and i play it in the program view, the video is degraded. [I've set the program view to high].
    Problem #2: The other videos I import is not in sync with its audio, the audio is super fast (sounded like chipmunks) but the video speed is normal.
    The files I imported are AVI.
    I have a 1.73 Ghz processor, 20% free diskpace, i have a 1.5GB RAM, i use a laptop so i have a Mobile Intel Graphics.
    What seems to be the problem? I really need help.

    1. Don't capture with WMM or convert the captured files to DV AVI type2.
    2. What codecs are used? AVI is not a codec, just a wrapper.
    20% free diskspace on a laptop with limited memory and a meager CPU is asking for trouble. Invest in a good editing machine.

  • Is it possible to add a logo layer to an H264 video

    I just found out the following Adobe FAQ :
    quote:
    Q: Does the H.264 implementation in Flash Player support
    alpha channel?
    A: No. Our first implementation does not support alpha
    channels using H.264...
    Would that means that it is not possible to add a logo layer
    to an MPEG4/h264 video

    Unfortunately, fading out at the end and fading in at the beginning does not create a seamless loop, since there are a few moments when the clip alpha is 0% and everything is completely black.This might be ok for some situations. But for creating a seamless loop, I need to have something, well, more seamless.
    Actually, I think I may have come up with a possible workaround to simulate a true seamless loop of an embedded video (at least get closer to it) by placing a still image (which has been converted into a movie clip) of the first frame on a new layer at the last frame, and then copying that keyframe and pasting it about 25 frames before the end, then alpha fading from the first keyframe to the final frame.
    It is not perfect, but it's something.
    Perhaps someone else might have a better solution?

  • Is it possible to overlay a PNG over video layer?

    This process may be strange but there's a reason for this madness. We are taking h.264 .mp4 videos into PowerPoint then using the Acrobat 9 extended pro add-on and converting this file to a .pdf. There's possibly a need to put a watermark over the video. However when we insert a transparent PNG over the video in PowerPoint then convert it to .PDF the video punches through the PNG. It seems like the video layer wants to be the frontmost even if listed as part of the background in Acrobat. We can go back to the video and do it there but we would have to process the video again so we're trying to avoid that. Any ideas?

    follow advice given in the User Tipp section of this board:
    How to create a pointer or a custom title

  • Content Aware Scaling on Video Layer

    Hello,
    I hope this is possible because it works really well on still frames but how would I go about applying content aware scaling to a video layer inside PS? Basically I'm trying to use this feature to fake an aspect ratio change where by I have a subject surrounded by a relatively uniform background and I would like to be able to create a protection mask as an alpha layer and have photoshop apply the content aware scaling only to the background(to fill in the empty parts of the rescaled video) and leave the subject untouched.
    What I've done is opened a video in photoshop as a layer, created an alpha channel to represent the subject(subject is white, background is black on the created alpha channel), changed the canvas size to the new aspect ratio which obviously created a tranparent frame around the original video frame. I then tried to apply content aware scaling to the video, it converted the layer to a smart object then displayed the free transform handles. However, when I selected my alpha channel as the protection area, the content aware scaling seemed to ignore it and went on to distort the entire frame. Now I tried this with still frame from the same video with the same mask/alpha channel and it worked as expected just didn't seem to do it with video.
    The idea, if it would be possible to do this in PS, is to rotoscope the subject roughly in AE and generate a matte pass which can then be used as the acompanying alpha layer of the video so then the content aware scaling can be applied to each invidividual frame.
    Is this possible??

    No that's not what I was trying to do, I mask the central subject of my frame and as I said it was surrounded by a fairly uniform background(main subject is a rock formation in the middle of the ocean) I want to change the aspect ratio of that frame, so I created an alpha mask to cover the main subject, the surrounding background was not covered in this alpha channel mask. This way when I scale using the content aware feature all that happens is the background(the water) is streteched evenly with lesser distorion(than normal scaling) while the masked main subject is "avoided" with completely no distrotion. I think the key point you missed in my description is that I am in fact creating an alpha matte for only my subject not the entire frame and using that in the "protect" option of content aware scaling.
    The result is essentially a frame aspect ratio change that does not sacrifice the resolution around the main subject(because the main subject remains of the same size and PS doesn't have to interpolate any pixels...this is obviously  is not the same as just resizng and cropping where the subject and background are streched evenly to fill an essentially larger area of the screen causing "softness"). The result using this method is also much more predictable from frame to frame than content aware filling because it's taking information from the current frame and using is to fill the empty background resulting from the aspect ratio change. I know this works because I tried it on individual still frames from the video then compiled them back in on AfterEffects...thats not my problem. My problem is when you try to natively try to do this inside PS on a video layer(rather than a still frame) it doesn't work and I'm not sure if this is a bug or if video content aware streching is just not supported.I have CS6 Production Premium.

  • Missing frames in smart object converted video layer?

    I noticed that whenever i try to convert a video layer I drew on in photoshop to a smart object, when i play it back there are empty frames! And no matter what I do I cannot get it to show the frames. Now I know the frames werent empty when i first drew on the video layers, and when i import a video into photoshop and convert it to a smart object all the frames are there. So I guess it's just an error with video layers with drawings on them done in photoshop? I tried googling every possible wording of this scenario but I found NOTHING, so can someone please help me?

    after using  high fidelity image trace  i hit expand, then i went to layers and hit the drop arrow by my thumbnail, which then shows <Group>,hit that drop arrow and it will show a list of all your paths, the very bottom one was my white background, you can click the eye or delete that path and it disappeared for me. i was using a png file with a transparent background, and nothing else worked for me, it always converted with white background, i never saw this mentioned anywhere, and accidentally discovered it, hope it works!!!

  • Importing a video layer from photoshop cs5 to after effects cs5

    hi - you guys were so brilliant and prompt on answering my last question. thankyou
    i did have another i needed help with -
    is it possible to bring in a video layer from photoshop cs5 to after effects cs5 - i tried but it said "the photoshop library operation failed because the file is not compatible with this version of photoshop"
    thanks again

    In the import dialog box, uncheck the Photoshop Sequence option.
    The problem is the number on the end of your file name.  When After Effects sees a number there, and there are other files in that directory with the same name and a number, it thinks the images are part of a sequence and will enable that checkbox.
    More info here: Import a single still image or a still-image sequence

  • Camera Raw Filter is not working correctly in Photoshop CC when applied to video layer

    With Photoshop CC, when editing a video and adding a "Camera Raw Filter" to some video layer, the effect will be applied only to one frame and not to the whole video layer.
    Should it not add that filter to the whole layer (e.g. all frames in that clip)?

    Either it's a bug or a limitation. Haven't yet tried this, so I can't tell you whether it works as it should or is acting up... I would however assume that within what one can expect it works as designed - ACR doesn't have a built-in timeline, so there would be nothing for the PS routines to request retrieval of frames from withing the SO.
    Mylenium

  • How can I Copy/paste the pixels within a frame in a video layer to another frame? (It duplicates the whole frame instead.)

    I'm making a handdrawn animation in the timeline using video layers, so each video layer contains the frames for the animation. The method works great..except for this -
    If lasso select a section of one frame and try to paste into another frame, it duplicates the the whole frame and pastes it with an arbitrary long frame duration for some reason (not the same duration as the frame its copied from)....not at all what I'm trying to do. Any work around? I've tried all the variations of 'paste special' to no avail.
    Thanks.

    Images and other object can either be floating or be inline. Yours are floating and will not move with the text. Inline object will move with the text but can't be outside the text layer. It doesn't help if you have created section in the document. Floating images doesn't care. Nor will it help if you create several documents that you want to merge later. Doesn't make any difference.
    My suggestion is that until your text is finished you have the images inline. Then as a last editing you can start make the images floating and move them a little.

  • Is it possible to transfer music/videos from one itunes account to a separate one?  I need to give my music and videos that I bought a grandchild to her for her ipad.

    Is it possible to transfer music/videos from my itunes account to a grandchild (she will need her own account)  I bought her music and videos and let her play with my ipod touch.  Now she has an ipad.

    No you cannot transfer purchases from one account to another account. Apple does not allow it and never has allowed it.
    She can use you Apple ID on the device and switch between her ID and your ID, but that can cause problems at times and can become a bit of a pain.

  • Is it possible to change the video card of a pavilion g7-1075dx?

    So, I have an HP Pavilion g7-1075dx Notebook with Windows 7. I'm an avid gamer and wish to play the newest games. However, there's one problem thats keeping me from doing so. Alot of the newer games require newer video/graphics cards. This particular laptop has an ATI Mobility Radeon HD 4250. The newest games seem to require ATI Radeon HD 4850 and above. This is the only thing thats keeping me from playing games like Starcraft II on the highest settings OR in the case of Star Wars: The Old Republic, it almost keeps me from playing the game, period, due to the graphics being too much for my current card to handle, causing massive lag. I was hoping I could change the video card. Upgrade. However, i've heard that with most laptops or notebooks you can't upgrade anything other than the RAM. I'm hoping anyone on here can help me out and tell me if it is possible to get a new video card for my laptop. We don't have a desktop computer so this laptop is my only hope for a long time to play newer PC games.

    Alright, let me put this in a simpler message: Does anyone know if it is possible to change the video card currently in my laptop, the HP Pavilion g7-1075dx, for a newer and better one. ATI Mobility Radeon HD 4250 to ATI Radeon HD 4850 or higher.

  • Adobe Media Encoder cuts off video layer when the Ultra Key effect is applied

    I am working on a Mac (10.8.5) using the latest verison of Premiere Pro CC. I am using Ultra Key to remove the chroma key background from the "talent layer" and adding a "new background layer" behind the talent video layer. When I export directly from Premiere, the sequence exports as expected. However, I have many sequences, and wish to speed up the  process using Adobe Media Encoder. When I export the same sequence using Adobe Media Encoder, the top half of the "talent layer" is completly cut off:
    The issue has something to do with the Ultra key effect because when I remove the effect from the "talent layer" it exports in tact (with a chroma key background of course). Adobe Media Encoder CC is up to date as well; are there any known bugs with Media Encoder CC and the Ultra Key effect in Premiere Pro?
    Thanks!

Maybe you are looking for

  • Ipod nano-song jumps prematurely

    In my ipod nano the song jumps to next in few seconds mostly. People suggest it is due to defective CD from which the song was downloaded on to itunes in PC Is it possible to dwload itunes from PC to a CD or DVD,erase itunes prtly or fully from the p

  • ERRORS IN PORTAL WHEN DROPPING SCHEMA OWNER

    I ran a PDK demo script and added 2 db packages to a schema in the portal repository. After running theses porlets, I decided to attempt to create my own. Prior to adding to the schema I wanted to clean out the old db packages. I thought the easy way

  • Decimal error in table BSEG.

    Dear experts, I will present my problem in a scenario. I'm using txc FB70 to make an invoice in currency COP (columbian peso) or MXP (mexican peso). When using MXP it works fine, but with COP the amount entry in table BSEG gets divided by 100. The re

  • Text rendering errors

    Hi, i have a problem about displaying long text.. i want to displat only one row for 'detail section' but my first field data can be more over 70-80 chars and i observed that: - in the preview (at design time) the text is contained (truncated) in the

  • Mac mini on photoshop and imovie

    Hi, I am looking to switch over to Mac for non-professional photo editing and video editing. I have been looking at the mac mini basic model and upgrading the ram to 16gb. Is this a good option or is it worth waiting and saving up for the basic Imac.