I have lots of short clips that I encode but without the audio because the encoders I use (hevc via x265) does not include a muxer to encode the audio along with the video. The only way I can add the audio into the hevc encoded video is to first encode the video and then extract the audio through virtualdub, then compress it, and then mux the video and audio with ffmpeg. But there are too many steps involved in some of that. I want to just get it from the avisynth script since that is what I am always in at the time.
I was wondering how can this be done, hopefully through a command line method.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
You can't really "extract" audio through avisynth, because it frameserves uncompressed audio and video. So you would be decompressing the original audio, then re-encoding it with something else, unless you planned to keep uncompressed audio
Since you were using ffmpeg, why not use that to stream copy the audio in the first place ? or if it's not a compatible audio format in your container, you can use it to re-encode. -
Let me explain my situation.
I spend most of my time in avisnth scripts, encoding different sections of analog captures. I am mainly in the trim() and selectevery() sections of the avs script.
Below is just a short snippet of how my script looks. I have dozens of lines like these that I run through different encodes and sometimes different encoders, ie avc and mpeg.
Code:# trim( 14046,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0001, 0000).trim( 0, 005448) # v = "c:\cap\cap.PAN.PV-S4670.to.HVR950Q.5thelement.20161005wed.svideo..01.avi" # trim( 14046,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0001, 0000).trim( 0, 000773) # v = "c:\cap\cap.PAN.PV-S4670.to.HVR950Q.5thelement.20161005wed.svideo..01.avi" # trim( 00005,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0002, 0000).trim( 0, 005448) # v = "c:\cap\cap.PAN.AG-1980.to.HVR950Q.5thelement.20161005wed.svideo.01.avi" # audio delay -6000 trim( 108681,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0004, 0000).trim( 0, 003740) # v = "g:\caps\cap.AG-5710.to.D-R4.to.HVR-950Q.to.UT.5thelement.2.avi" # no audio delay
-
But I use avisource() for my avi's.
I capture a lot of vhs content through various vcrs. And some directv too. So, I have a system, though messy, but this is how I work and it has been working for me for many years.
Here is a snippet (cleaned up for this discussion) of how I work with video, because the videos are telecine and I need to perform IVTC on them.
Code:v = "g:\caps\20161017.video.movie_PV-4662.to.D-R4.to.HVR-950Q.to.UT.1.avi" # v = "c:\cap\test1.directstream.avi" # v = "g:\caps\cap.AG-5710.to.D-R4.to.HVR-950Q.to.UT.5thelement.2.avi" # v = "f:\caps\cap.RCA.VR-618HF.to.HVR-950Q.to.UT.dr.oz.operah.4.avi" # v = "c:\cap\cap.PAN.PV-4662.to.HVR950Q.5thelement.02.D-R4.02.avi" # v = "c:\cap\cap.PAN.PV-4662.to.HVR950Q.5thelement.01.firsttime.avi" # first time i test ran this vcr # m = "C:\Users\dell\Documents\DOWNLOADS\00\Trailer Test Source.mkv" # m for mkv files AVIsource( v ) # UT codec separateFields( ).selectevery(2, 1,0).weave # required for my capture equipment and ITVC methods below Script name: movie.avs # trim( 14046,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0001, 0000).trim( 0, 005448) # v = "c:\cap\cap.PAN.PV-S4670.to.HVR950Q.5thelement.20161005wed.svideo..01.avi" # trim( 14046,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0001, 0000).trim( 0, 000773) # v = "c:\cap\cap.PAN.PV-S4670.to.HVR950Q.5thelement.20161005wed.svideo..01.avi" # trim( 00005,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0002, 0000).trim( 0, 005448) # v = "c:\cap\cap.PAN.AG-1980.to.HVR950Q.5thelement.20161005wed.svideo.01.avi" # audio delay -6000 trim( 108681,0000+00000).trim(00000,00000).separateFields().selectevery( 05, 0,1,2,3).weave( ).trim( 0000, 0).trim( 0004, 0000).trim( 0, 003740) # v = "g:\caps\cap.AG-5710.to.D-R4.to.HVR-950Q.to.UT.5thelement.2.avi" # no audio delay ConvertToYUY2( interlaced=false ) ConvertToYV12 # with ..ToYUY2 because levels are borqed when suing with x265.exe and mpeg2enc encoders.
But, I don't see how I can use ffmpeg on the avs script above, unless I'm missing something to understand. I can be slow at these things, sometimes. Well, I got to get some sleep. Thanks for your help. -
Ok, I found a method. How blind was I. I thought ffmpeg didn't do avs scripts. Oh well.
Here is the parameter scripts I used to extract the audio, in various formats. All work except .ogg, it encodes to video and audio.
I believe this is pretty much what I was looking for, and simple
Code:ffmpeg -i "c:\tools\movie.avs" -acodec libmp3lame -y c:\videos\audio.mp3 ffmpeg -i "c:\tools\movie.avs" -acodec libvorbis -y c:\videos\audio.ogg ffmpeg -i "c:\tools\movie.avs" -acodec libfaac -y c:\videos\audio.aac ffmpeg -i "c:\tools\movie.avs" -acodec ac3 -y c:\videos\audio.ac3
-
Since you were complaining of too many steps... one step is probably fewer and definitely faster. You can combine the audio with everything else in the ffmpeg commandline (since you were using ffmpeg to mux anyways). You can even use libx265 in the same command. The only reason I can think of that you might not want to do that is if you were using some features not supported by ffmpeg libx265, only the x265 binary
-
Since you were complaining of too many steps... one step is probably fewer and definitely faster. You can combine the audio with everything else in the ffmpeg commandline (since you were using ffmpeg to mux anyways). You can even use libx265 in the same command. The only reason I can think of that you might not want to do that is if you were using some features not supported by ffmpeg libx265, only the x265 binary
Similar Threads
-
extract video and audio from avisynth ---> virtualdub
By marcorocchini in forum Newbie / General discussionsReplies: 2Last Post: 12th Aug 2014, 10:50 -
AviSynth: No Audio available for AVI-Files
By klischee in forum EditingReplies: 2Last Post: 18th May 2012, 07:22 -
how to extract audio from avi
By ShrinkDWorld in forum AudioReplies: 2Last Post: 2nd Feb 2012, 17:58 -
cannot see or extract audio from AVI
By Srivas in forum Video ConversionReplies: 6Last Post: 7th Dec 2011, 23:47 -
cannot see or extract audio from AVI
By Srivas in forum Video ConversionReplies: 1Last Post: 7th Dec 2011, 01:49