HI cats
please consider this 2 commandline
my target is achieving the output.wav : I don't want the the video partCode:ffmpeg.exe -i InputVideo.avs -i InputAudio.MP4 -map 0:v -map 1:a -vcodec mjpeg -shortest -af apad -c:a pcm_s16le output.AVI ffmpeg.exe -i output.avi -acodec copy output.wav
inputVideo.avs is a audio/video file
inputAudio.MP4 is a audio/video file
This 2 commandlines "fit" the final audio duration as the video duration: the target (output.wav) is only the audio part of the InputAudio.MP4 that have a duration, a lenght, of the inputVideo.avs (with silence, if necessary)
FFMPEG don't allow me to encode directly the output.wav in the first commandline so I'm force to generate a video embedded in the avi - in mjpeg - which then it is processed in the second line but trashed
So I wonder if exist a way to do a minimal encoding [of the output.avi] so that the video part become reduced at the minimum to avoiding overload of cpu and an unnecessary use of disk space
Thanks
ps: if there is a way to generate a black video or null video in the output.avi OR if there is a way to encode directly the output.wav in a unique commandline I would be a happy cat
+ Reply to Thread
Results 1 to 23 of 23
-
Last edited by marcorocchini; 18th Mar 2016 at 03:07.
-
-
ah ok thanks but concretely what I can use in my commandline? how have a do? ^^
-
Oh, examples are there but i'm currently quite busy and i can't provide working solution - if you will wait few days then i should be less busy.
But from my perspective approach like:
- create multiple outputs (independent video and audio)
- copy video to null
- output audio to wav -
If you only want wav, that means you only want audio (as wav is audio-only format). If you only want audio, why are you including video in you input stream selection?
Scott -
Try
Code:ffmpeg.exe -i InputVideo.avs -i InputAudio.MP4 -map 0:v -map 1:a -vcodec rawvideo -shortest -af apad -c:a pcm_s16le -f tee "[f=null]-|[select=a]output.wav"
-
-
-
Again, map only the audio stream!
(plus, most encoders are terribly inefficient at the very bottom end of their scale, to say nothing of the very strong possibility that some encoders cannot/wouldn't allow 1x1 sizes).
Maybe you're not being clear what you really are wanting to do.
Scott -
He wants to pad/shorten the audio to the length of the video so he cannot not map it even if he does not need it.
-
Actually, better than scale would be crop i.e. -vf crop=1:1. And rawvideo is not an encoder. It's, depending on the output pixel format, outputting uncompressed planar or interleaved pixmaps. With crop feeding it 1 pixel, this should proceed even faster.
-
Code:
:Make_File_Other <VCF_FILENAME> <AVS_FILENAME> <FILENAME> <ORG_FILENAME> color d Set "AudioVolume=1.0" cls echo *** ____ MP4gopro ____ varie risoluzioni ma a 50fps a .AVS HD 1920 x 1080 *** echo *** l'eventuale filtro di resize da applicare può essere solo IResize e non LanczosResize *** cls if exist "%~n1_HDavs.avs" del "%~n1_HDavs.avs" echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ ³ echo ³ others ³ echo ³ ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ echo. if not "%FPSforVirtualdub%"=="0" (set /a "newFPSforVirtualdub=%FPSforVirtualdub%-1") else (set "newFPSforVirtualdub=0") rem Set "LancZosFilter=0" rem cscript //NOLOGO //T:2 "v:\automazioneclip\core\CHOICE.vbs" /C:yn /T:y,2 " PREMI y PER INDURIRE I CONTORNI " rem if %errorlevel% == 0 echo prompt timed out! :: this is the default! rem if %errorlevel% == 1 Set "LancZosFilter=1" rem *** TRY to test if input file have or not audio *** if exist "%WorkFolder%\TESTonly.wav" del "%WorkFolder%\TESTonly.wav" v:\automazioneclip\core\ffmpeg.exe -loglevel fatal -y -i %4 -ss 00:00:00 -t 00:00:10 -filter_complex "[0:1] volume=%AudioVolume%" "%WorkFolder%\TESTonly.wav" for %%v in ("TESTonly.wav") do ( if %%~zv LSS 128 ( del "%WorkFolder%\TESTonly.wav" ) ) Set "TokenS=0" Set "audioInsideFileExist=0" if exist "%WorkFolder%\TESTonly.wav" set "audioInsideFileExist=1" del "%WorkFolder%\TESTonly.wav" IF "%audioInsideFileExist%"=="1" set "AudioFile=%4" if not "%FPSforVirtualdub%"=="0" (set /a "newFPSforVirtualdub=%FPSforVirtualdub%-1") else (set "newFPSforVirtualdub=0") echo Blankclip^(length=%newFPSforVirtualdub%, fps=50, stereo=true, audio_rate=48000^)>"%~dp1%~n1_blank.avs" IF NOT "%audioInsideFileExist%"=="1" (v:\automazioneclip\core\ffmpeg.exe -y -i "%~dp1%~n1_blank.avs" -filter_complex "[0:1] volume=1.0" -c:a pcm_s16le "%~n1_blank.wav") IF NOT "%audioInsideFileExist%"=="1" set "AudioFile=%~n1_blank.wav" echo PROCESSING %4 rem v:\automazioneclip\core\ffmpeg.exe -n -i %4 -filter_complex "[0:1] [0:2] amerge,volume=%AudioVolume%" -c:a pcm_s16le "%DestFolder%\%~n1_HD.wav" rem v:\automazioneclip\core\ffmpeg.exe -n -i %4 -filter_complex "[0:3] [0:4] amerge,volume=%AudioVolume%" -c:a pcm_s16le "%DestFolder%\%~n1_HDch3ch4.wav" rem ***Make The .avs Script File *** echo SetMemoryMax^(%SetMemoryMaxValue%^)>"%~n1_HDavs.avs" echo Import^("v:\automazioneclip\avisynth\plugins\IResize.avsi"^)>>"%~n1_HDavs.avs" echo LoadPlugin^("v:\automazioneclip\avisynth\plugins\LSMASHSource.dll"^)>>"%~n1_HDavs.avs" echo LoadCPlugin("v:\automazioneclip\core\yadif.dll")>>"%~n1_HDavs.avs" echo isMP4 assume %isMP4% echo Ch_Sub422 assume %Ch_Sub422% echo progressive assume %PROGRESSIVE% echo fullHD assume %fullHD% echo IMXorDCAM assume %IMXorDCAM% IF "%isMP4%"=="1" echo LSMASHVideoSource^(%4^)>>"%~n1_HDavs.avs" IF NOT "%isMP4%"=="1" echo LWLibavVideoSource^(%4^)>>"%~n1_HDavs.avs" if NOT "%Ch_Sub422%"=="yes" if "%PROGRESSIVE%"=="1" echo ConvertToYUY2^(interlaced=false^)>>"%~n1_HDavs.avs" if NOT "%Ch_Sub422%"=="yes" if NOT "%PROGRESSIVE%"=="1" echo ConvertToYUY2^(interlaced=true^)>>"%~n1_HDavs.avs" if "%IMXorDCAM%"=="yes" echo colorMatrix^(mode="Rec.601->Rec.709"^)>>"%~n1_HDavs.avs" if NOT "%fullHD%"=="1" echo IResize^(1920,1080^)>>"%~n1_HDavs.avs" echo ### ATTENZIONE l'uso dei filtri ColorYUV rende difficile il playback in realtime ###>>"%~n1_HDavs.avs" echo #ColorYUV^(levels="PC->TV"^)>>"%~n1_HDavs.avs" echo #ColorYUV^(gamma_y=-7, gamma_u=-7, gamma_v=-7^)>>"%~n1_HDavs.avs" echo #colorMatrix^(mode="Rec.709->Rec.601"^)>>"%~n1_HDavs.avs" if NOT "%fps25%"=="yes" if NOT "%fps50%"=="yes" echo SmoothFPS2^(50000,1000^)>>"%~n1_HDavs.avs" if NOT "%fps25%"=="yes" if NOT "%fps50%"=="yes" echo AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()>>"%~n1_HDavs.avs" if "%fps50%"=="yes" echo AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()>>"%~n1_HDavs.avs" IF "%visualDeinterlace%"=="1" echo bob^(^).SelectEven^(^)>>"%~n1_HDavs.avs" rem echo AssumeFPS^(25^)>>"%~n1_HDavs.avs" rem v:\automazioneclip\core\ffmpeg.exe -n -i "%~n1_HDavs.avs" -filter_complex "[0:1] volume=%AudioVolume%" -c:a pcm_s16le "%~dp1%~n1_HDavs.wav" rem v:\automazioneclip\core\ffmpeg.exe -n -i "%~n1_HDavs.avs" -i %4 -af "pan=stereo:c0=c0:c1=c1,volume=%AudioVolume%" -map 0:v -map 1:a -vcodec mjpeg -shortest -af apad -c:a pcm_s16le -ar 48000 "%~dp1%~n1_HDavs.avi" rem v:\automazioneclip\core\ffmpeg.exe -n -i "%~dp1%~n1_HDavs.avi" -acodec copy "%~dp1%~n1_HDavs.wav" v:\automazioneclip\core\ffmpeg.exe -n -i "%~n1_HDavs.avs" -i %4 -vf crop=2:2 -af "pan=stereo:c0=c0:c1=c1,volume=%AudioVolume%" -map 0:v -map 1:a -vcodec rawvideo -shortest -af apad -c:a pcm_s16le -ar 48000 -f tee "[f=null]-|[select=a]%~dp1%~n1_HDavs.avi" del "%~dp1%~n1_blank.wav" del "%~dp1%~n1_blank.avs" rem del "%~n1_HDavs.avs" if exist "%~dp1tempNaming.txt" del "%~dp1tempNaming.txt" echo %~dp1%~n1_HDavs>tempNaming.txt v:\automazioneclip\system\fart.exe "%~dp1tempNaming.txt" : _ v:\automazioneclip\system\fart.exe "%~dp1tempNaming.txt" \ _ set /p newPath=<"%~dp1tempNaming.txt" if exist "%~n1_HDavs_%newPath%.avs" del "%~n1_HDavs_%newPath%.avs" ren "%~n1_HDavs.avs" "%~n1_HDavs_%newPath%.avs" pfm unmount "%~dp1%~n1_HDavs_%newPath%.avs" pfm mount "%~dp1%~n1_HDavs_%newPath%.avs" IF NOT "%windowsXP%"=="1" findstr /c:"%~dp1%~n1_HDavs_%newPath%.avs" "C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\AVSavvio.bat" IF NOT "%windowsXP%"=="1" IF ERRORLEVEL 1 (echo pfm mount "%~dp1%~n1_HDavs_%newPath%.avs">>"C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\AVSavvio.bat") IF "%windowsXP%"=="1" findstr /c:"%~dp1%~n1_HDavs_%newPath%.avs" "C:\Documents and Settings\Administrator\Menu Avvio\Programmi\Esecuzione automatica\AVSavvio.bat" IF "%windowsXP%"=="1" IF ERRORLEVEL 1 (echo pfm mount "%~dp1%~n1_HDavs_%newPath%.avs">>"C:\Documents and Settings\Administrator\Menu Avvio\Programmi\Esecuzione automatica\AVSavvio.bat") for /f delims^=^" %%a in ('pfm flush "%~dp1%~n1_HDavs_%newPath%.avs"') do set "flushed1=%%a" set "flushed=%flushed1%\%~n1_HDavs_%newPath%.avi" if exist "%~dp1%~n1_HDavs.avi" del "%~dp1%~n1_HDavs.avi" v:\automazioneclip\core\mklink.exe /s "%~dp1%~n1_HDavs.avi" "%flushed%" if exist "%~dp1tempNaming.txt" del "%~dp1tempNaming.txt" goto :eof
-
In the highlighted line, the apad has no effect. You should have only one filterchain i.e.
-af "pan=stereo:c0=c0:c1=c1,volume=%AudioVolume%,a pad"
(Anyway, what's the point of the pan? You aren't changing anything) -
Now it becomes clear!
You could do a 2-step process: Trim (w/Vid) - using uncompressed cropped small (but keep the framerate for finer time resolution), then Map-only-audio.
Scott -
-
Code:
ffmpeg.exe -i InputVideo.avs -i InputAudio.MP4 -map 0:v -map 1:a -vcodec libx264 -shortest -af apad -c:a pcm_s16le -f tee "[select=v]video.mkv|[select=a]output.wav"
Similar Threads
-
Video size reduction with minimal quality loss?
By johnrichards in forum Newbie / General discussionsReplies: 7Last Post: 26th Feb 2015, 01:31 -
VHS to DVD with minimal encoding advice.
By zoink187 in forum Newbie / General discussionsReplies: 18Last Post: 3rd Jun 2013, 17:56 -
libfaac encoding with ffmpeg
By chicken264 in forum Video ConversionReplies: 31Last Post: 20th Dec 2012, 08:04 -
Splicing / editing H264 with zero or minimal re-encoding?
By Asterra in forum Video ConversionReplies: 8Last Post: 12th Apr 2012, 13:25 -
ffmpeg output 2gb limit? Is there one? ffmpeg stops encoding h264 @ 2gb
By BrainiakZ in forum Video ConversionReplies: 14Last Post: 30th Mar 2011, 12:04