First of all, thanks for your huge work ! AVConvert is a must have tool !!
Second, I'm heavily using OBS to screencast I configured OBS in a way that I got :
Track 1/2 => audio from my Mic
Track 3/4 => ReaRoute (audio from Reaper)
Track 5/6 => Audio from desktop (generaly backing track from youtube)
So, I'd like to be able to extract those 3 stereo tracks from my MKV file (generated by OBS) and so I made some tweak to your work to acheive this. Here is the result :
[...]
It perfectly work and fit to my needs, I don't know if you could be interested to add my modifications to your code but I'd be glad you could find some interests in this.
Of course feel free to adapt this in a way you could find more elegant or smart.
Regards
Thanks a lot, daeavelwyn! I'm very happy to hear you find AVConvert a "must have" tool
I can imagine the effort that you have put into your "extension" of AVConvert! There are a few issues, though, which I'd like to address:
Your batch command doesn't work on multiple selected files, just on one.
It doesn't feature automatic output file naming, risking possible file name collisions or maybe even inadverted file overwriting.
It won't work on videos containing 5.1 surround audio (which also have 6 audio channels but encoded and muxed differently).
Your channel mapping solution might work with your specific source files but the mapping command can be quite bitchy with some source files and your implementation might not work on other multi-audio files even if they have the same no. of audio streams.
I have spend the last few hours trying to figure out a compatible and convenient way to extract multiple audio streams from a video file. For me, the best way is to first extract all audio streams into a single multichannel wave file and then split that file into multiple stereo files in a second step if necessary or desired. This is due to the fact that AVConvert (and also ffmpeg) cannot guess in advance how many audio streams are present in a video file nor does it know the format. ffprobe must be used to acquire this information and can then pass it to ffmpeg but this will require to include ffprobe into AVConvert and I have no clue how this can be done - at least for now.
If your version works for you, then go ahead and have fun with it
Given the issues I mentioned above, I'm hesitating to include your code, I hope you don't mind - no offense!
As you can see in my post before this one I have already uploaded a new version which should do what you are looking for. In case you'd like to use this version (or any future version I release) you'd need to remove your own commands with an appropriate removal reg file. As usual, you should also remove my current version with its provided removal reg file (!) and then preferably delete the entire contents of the AVConvert folder prior to extracting and adding the new version.
Obvioulsy, I'd be interested in knowing if the features I just added accomplish what you want (it works over here). As mentioned above, for some reasons I decided to implement the option to first convert multiple audio streams from a video to a single multi-channel file. The user can then decide if he'd like to work on that one (Reaper handles them just fine and multichannel audio files have advantages compared to editing multiple separate files) of if he prefers to split them into separate stereo files in a second step. Everything happens so fast that no considerable time is lost.
If there's anything else that should be added, please let me know. I'll try to implement it.
show current AVConvert version when right-clicking a wave file and then clicking on "AVConvert version info"
added option to convert 3 stereo streams of mkv video files into a single 6-channel wave file (useful when working with multi-audio mkv video files like those created with OBS)
added option to split single 4-channel wave files into 2 stereo wave files
added option to split single 6-channel wave files into 3 stereo wave files
PS: As far as I can tell, your own custom reg entry should get removed by my removal reg file. My reg file removes entire reg branches (like "1AVConvertConvA") and all sub-entries of it with a single removal command.
PS: As far as I can tell, your own custom reg entry should get removed by my removal reg file. My reg file removes entire reg branches (like "1AVConvertConvA") and all sub-entries of it with a single removal command.
can't quite figure out how to make my own presets and I'm afraid to mess around with it too much. I'll just ask here
Sometimes I record on more than two channels in OBS. It would be nice to have the Extract Audio with AVConvert > M4A Audio (3rd stream), M4A Audio (4th stream).
conversion from mp4 to left channel mono stream 1 WAV would save me a few steps as well.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
can't quite figure out how to make my own presets and I'm afraid to mess around with it too much. I'll just ask here
Sometimes I record on more than two channels in OBS. It would be nice to have the Extract Audio with AVConvert > M4A Audio (3rd stream), M4A Audio (4th stream).
conversion from mp4 to left channel mono stream 1 WAV would save me a few steps as well.
The word "stream" refers to a 2-channel/stereo signal. Do you mean extracting a 3rd and a 4th stereo signal from a video? This would imply that your video has 8 separate audio channels in total. Currently, you can extract stereo 1 and stereo 2. I can definitely add extraction for a 3rd and 4th stereo channel. Just wanted to clarify first.
The word "stream" refers to a 2-channel/stereo signal. Do you mean extracting a 3rd and a 4th stereo signal from a video? This would imply that your video has 8 separate audio channels in total. Currently, you can extract stereo 1 and stereo 2. I can definitely add extraction for a 3rd and 4th stereo channel. Just wanted to clarify first.
.
yes OBS can do up to 6 separate stereo streams. The most I've used is 4.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
I couldn't actually test the new extraction feature because I don't have any mp4 video files with 4 stereo audio streams. Please report back if both new features work as expected.
I couldn't actually test the new extraction feature because I don't have any mp4 video files with 4 stereo audio streams. Please report back if both new features work as expected.
.
seems to work!
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
@SonicAxiom : So, regarding the problems you mentioned in a earlier post, I spent a it of time to figure out how I could acheive this.
And I finally found a way, not yet polished as it could, but really efficient to extract stereo wav from any kind of media file.
So my script now take any numbers of files you want to passed to
I now use your convention to name file created
It now works with file contained etheir multiple tracks OR on track with multpile channels
BUT there are some downside (of course ^_^').
-First of all, to get numbers of channel / tracks from a file, I need to use ffprobe.exe which is bundled with ffmpeg.exe but in our version you only use ffmpeg.exe so I had to add a version of ffprobe.exe. Actually I took the zip from github and just unzip the total bundle, but I guess this part could be optimized to avoid 37Mo of every FFMPEG stuff.
-Second point, I actually can't figure out how to avoid batch to ask to hit a key to continue for every new file it has to encode. I guess there is a trick but can't figure out.
@echo off
:: Get all arguments passed, so mainly all selected files
echo %*
pause
:: start iterate on files properties
:loop
echo Converting %1
:: set ffprobe to find the number of channels of a file
:: source : https://stackoverflow.com/questions/47905083/how-to-check-number-of-channels-in-my-audio-wav-file-using-ffmpeg-command
C:\AVConvert\ffmpeg\bin\ffprobe.exe -i "%~1" -show_entries stream=channels -select_streams a:0 -of compact=p=0:nk=1 -v 0 > tmp
:: put result in a variable
SET /p var=<tmp
:: echo %var% :: DEBUG
:: Windows BATCH syntax is a PITA...
:: well so, if var content is GTReater than 2 extract channels to stereo files else extract tracks to stereo files
:: we can't get a better presentation of the code since windows doesn't allow line breaks.
IF /I %var% GTR 2 ("C:\AVConvert\ffmpeg.exe" -i "%~1" -map_channel 0.0.0 -map_channel 0.0.1? "%~d1\%~p1\%~n1 - stereo 1.wav" -map_channel 0.0.2? -map_channel 0.0.3? "%~d1\%~p1\%~n1 - stereo 2.wav" -map_channel 0.0.4? -map_channel 0.0.5? "%~d1\%~p1\%~n1 - stereo 3.wav") ELSE ("C:\AVConvert\ffmpeg.exe" -i "%~1" -map 0:1? "%~d1\%~p1\%~n1 - stereo 1.wav" -map 0:2? "%~d1\%~p1\%~n1 - stereo 2.wav" -map 0:3? "%~d1\%~p1\%~n1 - stereo 3.wav" -map 0:4? "%~d1\%~p1\%~n1 - stereo 4.wav" -map 0:5? "%~d1\%~p1\%~n1 - stereo 5.wav" -map 0:6? "%~d1\%~p1\%~n1 - stereo 6.wav")
:: Remove tmp file created fo put var value
:: and yes, it's a lame but windows batch need to write a file to stock and use values from command....
DEL tmp
shift
if not [%1]==[] goto :Loop
:: pause :: can be uncomment to ask user to hit a key to continue
@SonicAxiom : So, regarding the problems you mentioned in a earlier post, I spent a it of time to figure out how I could acheive this.
And I finally found a way, not yet polished as it could, but really efficient to extract stereo wav from any kind of media file.
So my script now take any numbers of files you want to passed to
I now use your convention to name file created
It now works with file contained etheir multiple tracks OR on track with multpile channels
BUT there are some downside (of course ^_^').
-First of all, to get numbers of channel / tracks from a file, I need to use ffprobe.exe which is bundled with ffmpeg.exe but in our version you only use ffmpeg.exe so I had to add a version of ffprobe.exe. Actually I took the zip from github and just unzip the total bundle, but I guess this part could be optimized to avoid 37Mo of every FFMPEG stuff.
-Second point, I actually can't figure out how to avoid batch to ask to hit a key to continue for every new file it has to encode. I guess there is a trick but can't figure out.
@echo off
:: Get all arguments passed, so mainly all selected files
echo %*
pause
:: start iterate on files properties
:loop
echo Converting %1
:: set ffprobe to find the number of channels of a file
:: source : https://stackoverflow.com/questions/47905083/how-to-check-number-of-channels-in-my-audio-wav-file-using-ffmpeg-command
C:\AVConvert\ffmpeg\bin\ffprobe.exe -i "%~1" -show_entries stream=channels -select_streams a:0 -of compact=p=0:nk=1 -v 0 > tmp
:: put result in a variable
SET /p var=<tmp
:: echo %var% :: DEBUG
:: Windows BATCH syntax is a PITA...
:: well so, if var content is GTReater than 2 extract channels to stereo files else extract tracks to stereo files
:: we can't get a better presentation of the code since windows doesn't allow line breaks.
IF /I %var% GTR 2 ("C:\AVConvert\ffmpeg.exe" -i "%~1" -map_channel 0.0.0 -map_channel 0.0.1? "%~d1\%~p1\%~n1 - stereo 1.wav" -map_channel 0.0.2? -map_channel 0.0.3? "%~d1\%~p1\%~n1 - stereo 2.wav" -map_channel 0.0.4? -map_channel 0.0.5? "%~d1\%~p1\%~n1 - stereo 3.wav") ELSE ("C:\AVConvert\ffmpeg.exe" -i "%~1" -map 0:1? "%~d1\%~p1\%~n1 - stereo 1.wav" -map 0:2? "%~d1\%~p1\%~n1 - stereo 2.wav" -map 0:3? "%~d1\%~p1\%~n1 - stereo 3.wav" -map 0:4? "%~d1\%~p1\%~n1 - stereo 4.wav" -map 0:5? "%~d1\%~p1\%~n1 - stereo 5.wav" -map 0:6? "%~d1\%~p1\%~n1 - stereo 6.wav")
:: Remove tmp file created fo put var value
:: and yes, it's a lame but windows batch need to write a file to stock and use values from command....
DEL tmp
shift
if not [%1]==[] goto :Loop
:: pause :: can be uncomment to ask user to hit a key to continue
Hi daeavelwyn, congrats on your achievements which required some considerable effort to get it to work, I guess. I'll have a closer look at your approach asap. In the meantime, I hope you don't mind releasing your AVConvert fork under a different name to avoid confusion between our two versions. No offence! I'm thinking about integrating the functionality you added into the "official" AVConvert release (provided your permission, of course!) when I find the time. Really apprechiate your efforts!
I won't release my version, I let you integrate my proposition if you which and I won't be offense if you think it's not appropriate regarding your project.
I've made it because I needed it and once it was done, I just thought others could need it too. My code can be really improved (in fact it must...) specialiy about the downsides I mentioned in my previous post to fit better integrated in AVConvert design and I'd enjoy to hear your comment about it.
Feel free to make what you want with the code, humanity gets better when people collaborate. I use AVConvert alsmost everyday so if I can help to improve it, it's a pleasure !
I won't release my version, I let you integrate my proposition if you which and I won't be offense if you think it's not appropriate regarding your project.
I've made it because I needed it and once it was done, I just thought others could need it too. My code can be really improved (in fact it must...) specialiy about the downsides I mentioned in my previous post to fit better integrated in AVConvert design and I'd enjoy to hear your comment about it.
Feel free to make what you want with the code, humanity gets better when people collaborate. I use AVConvert alsmost everyday so if I can help to improve it, it's a pleasure !
Thanks for your kind words! I absolutely apprechiate your work and effort! I'm 100% with you regarding people combining their energy to reach higher goals. I'll think about how I can possibly integrate your functionality which will surely be a step up for AVConvert. Feel free to get in touch with me via PM.
Thanks much Sonic! I really appreciate your work. This will be handy for sure, and I never knew about that media info thing. I'll swing you a donation as soon as I'm able. Between obsolete computers and unsupported interfaces I'm currently hooped for dough lol.
Thanks much Sonic! I really appreciate your work. This will be handy for sure, and I never knew about that media info thing. I'll swing you a donation as soon as I'm able. Between obsolete computers and unsupported interfaces I'm currently hooped for dough lol.
Glad you like it! Hope you will see better times soon!
added conversion of MOV and MKV video files to MKV 2160 (4k), AAC audio; creates key frames every half a second and on scene changes in the output video file; this allows you make lossless edits on the resulting video with 0.5 s precision and also on scene changes
A bit of context regarding this new feature:
When I copy the original 4k video files from my camera they are obviously very large due to the high resolution and also due to the PCM audio stream which is the only available audio format. To avoid recompression of the video footage, which degrades image quality, I tend to use Avidemux to cut out scenes I don't like because Avidemux is capable of doing these edits losslessly provided they are made on key frames. Those key frames usually occur every 2 seconds in the video stream which restricts editing precision to two seconds which is a bit too coarse. Therefore, I decided to convert the video once using a special AVConvert conversion profile that will insert key frames every 0.5 s and also on every scene change. I'm basically sacrificing a bit of image quality as a result of a single conversion process but I'm gaining lossless editing precision for all future edits in return. Key frames now occur often enough to make precise (lossless) edits. Also, during the same conversion process, the PCM audio is converted to M4A (encapsulated AAC) which makes the resulting audio stream 10 times smaller.
Video bit rate is reduced by 1/3 (from 100 MBit to 36 MBit) so the resulting video stream is 1/3 of the original video's size with only minimal loss in image quality.
This is a rather significant update since AVConvert now offers (batch-)muxing capabilities!
added option to (batch-)mux MKV videos with AAC, M4A, MP3, OPUS, WAV or WebM audio (of the same file name)
added option to (batch-)mux MP4 videos with AAC, M4A, MP3, OPUS, WAV or WebM audio (of the same file name)
added option to (batch-)mux WebM videos with M4A or OPUS audio (of the same file name)
With all three muxing features you can choose between two variants:
a) add new audio stream to existing audio stream(s) in the video ("add" feature)
b) replace existing audio stream(s) with new audio ("replace" feature)
added option to sample rate convert WV 44.1k to 48k and vice-versa
added option to extract AC3 audio from MKV video
added capability to retain BWF metadata when converting WV to WAV
added capability to retain BWF metadata when changing bit depth of WAV files (16 bit <-> 24 bit)
added option to reorder audio channels in multi-channel AC3 and WAV files (experimental)
re-designed console windows which now show the current process in the window's title
Among other benefits, the new muxing options allow for fast batch re-muxing of separately downloaded video and audio files (Youtube et al.). In contrast to other AVConvert conversion/extraction options, the (batch-)muxing options will be performed on ALL videos of the right-clicked video's file type in a folder regardless how many of them had actually been highlighted!
.
ffmpeg processes will now be performed with lowest CPU priority keeping the computer more responsive during longer or multiple processes
2021-12-06:
added option to create 4-channel true-stereo impulse response files from regular stereo WAV impulse files (L-R channel layout -> L-R-L-R channel layout). This option creates new files containing the source file's original channel(s) plus a duplicate of them: Stereo source file -> 4-channel L-R-L-R file (true-stereo if the convolution plugin supports true-stereo mode). In case you run this option on a mono source file, you will get a stereo file with the original audio on both channels (still mono-sounding but now a 2-channel file)
menu entry icons of video processing options (conversion, muxing) now show AVConvert video icons for consistency
this is another rather significant AVConvert update!
ffmpeg x64 updated to version 4.4.1
added video resizing options for MKV, MOV and MP4 files (to 720p, 1080p, 2k and 4k) which simultaneously add a custom logo/watermark and also add key frames every 0.5 seconds and at scene changes; Audio is converted to AAC at the same time. Note: The new 4k options cannot be used to upscale smaller videos to 4k! All other options do provide upscaling functionality
video files of the same file type saved in the same folder can now be concatenated losslessly into a single video file with one click! This works for MKV, MOV and MP4 files separately (see help file in "standalone BATs" subfolder)
AVConvert 32 bit version is no longer provided; for anyone continuing using AVConvert on 32 bit Windows, it is possible to manually replace the provided 64 bit ffmpeg.exe with the 32 bit version
added option to (batch-)mux MOV video files with AAC, MP3, or WAV audio files of the same file name; new audio can either replace existing audio in the video file or be added as an additional stream
added option to losslessly concatenate multiple video files (MKV, MOV or MP4) which feature the exact same media properties (frame rate, width, height, ect.). You can determin the order of the concatenation via a simple TXT file.
added option to losslessly speed up / slow down MKV, MOV or MP4 video (any frame rate pull-up / pull-down conversion between 23.976 fps, 24 fps, 25 fps, 29,97 fps, 30 fps and 50 fps). Some of the resulting files may not play back perfectly smooth depending on the amonut of frame rate change they underwent
coming soon: option to set AVConvert video conversion quality to high (default) or low to be able to get smaller output files if desired (implementation in progress)
fixed minor error in muxing batch file that prevented a WebM audio file from being added to a video as an additional audio stream in AVConvert video/audio muxing menu
By now, AVConvert provides a fairly comprehensive set of conversion options for both audio and video. Notably, I'd like to highlight the numerous lossless video manipulation otions. Besides keeping the original quality unaltered, hence, avoiding generation loss, a lossless process will also complete much faster compared to a process that involves video re-compression since video data is only copied from the source file to the target file. For instance, losslessly concatenating several GB worth of video clips will only take a few seconds to complete on an SSD. If you then decide to change the order of the concatenation, the creation of the new video file is only a matter of another few seconds.
added option to losslessly crop top and bottom of videos by 284 px, 220 px, 164 px, 140 px, 124 px, 100 px, 80 px or 60 px to achieve various wide, cinematic looks
logo overlay batch files changed to make logo overlay positions relative to video size
fixed error in english "add AVConvert" reg file that prevented the creation of MOV and MP4 video file list using the concat feature (due to the error, MKV video file list was created regardless the right-clicked video format)
Please execute the english removal reg file of the version you are currently using to uninstall AVConvert, then delete the contents of the AVConvert folder incl. the sub-folders, download the new version and extract the zip contents into the existing AVConvert folder. Finally, double-click the new "add AVConvert reg file and hit OK two times.