=WiW= wakeislandwarriors.eu

The True Battlefield Community



Go to WiW on Battlelog
Connect to WiW TS3

It is currently Apr 11th, '21, 02:37

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Dxtory: x264vfw / 2 sound tracks
Unread postPosted: Jan 3rd, '13, 04:22 
Offline
Commander
Commander
User avatar

Joined: Sep 18th, '11, 01:00
Posts: 3093
Location: JN57lb
Okay guys, I decided to write this down somewhere as i made myself two nice batch files to work easier with that amazing codec.
I do like H264 encoded videos myself but Sony Vegas does not like them since version 9 (i think?).
TBH i think sony vegas does not like any other file format than sony? at least i haven't found one format that i could use in dxtory that vegas can read... :\

ยป Proper settings for Dxtory and no workaround will be needed.

[s]Updated script (easier) in second post: http://wakeislandwarriors.com/bf3/modul ... 0552#20552
[/s]

In Dxtory you can record from more than just one sound device but the stream gets saved into its own stream within the encapsulated avi file. Every "normal" media player only plays the first audio stream (so you only hear the game sound but not your microphone).
Image

Image

Hence Sony Vegas (what i use) does not like the video codec it is impossible to edit that video (to merge the two audio streams within the file).

This is where I drag in another small video editor (for the command line; ffmpeg). It is about 20MB and you can use it without installing, just run it in your command line (shell).

As I use this myself I have written two scripts that easily split up the video and audio streams from my original recorded file.
Make sure to put both following *.bat files and the original video file and ffmpeg.exe into the same directory. Following that you're good to go in a few easy steps.

First file that extracts video stream and the two audio streams from our original recorded video file: youtube_extract.bat.
Code:
@REM Extract video and audio streams and save them separately
@REM Created on 2013-01-03 by Dominic Reich
@REM License: http://creativecommons.org/licenses/by-nc-sa/3.0/

@echo off
if not exist extracted goto NODIR_EXT
:CONTINUE
echo Extracting audio as 128kbps mp3 into finish folder...
ffmpeg -i %1 -map 0:1 -vn -c:a libmp3lame -b:a 128k "extracted\%~n1-audio-game.mp3"
ffmpeg -i %1 -map 0:2 -vn -c:a libmp3lame -b:a 128k "extracted\%~n1-audio-mikro.mp3"
echo.
echo Audio extraction complete. Now going to extract (copy) the video.
ffmpeg -i %1 -map 0:0 -an -c:v copy "extracted\video.mp4"
echo Video extraction complete.
echo Now you can merge the two audio streams into one single stream.
timeout /t 1
exit
:NODIR_EXT
mkdir extracted
goto CONTINUE
exit

Just drag the video file onto the file youtube_extract.bat. A command line window pops up and when the process finishes (depends on size of file!) it should close automaticly.

Now we have three new files in a new directory (extracted is the name of the new directory).
  • video.mp4 (the blank video file without any sounds / AC1 codec)
  • %OLDFILENAME%-audio-game.mp3 (the game sound)
  • %OLDFILENAME%-audio-mikro.mp3 (the sound from your microphone)

You can easily drop both *.mp3 files in sony vegas together (below) on the timeline. One file in one sound track.
[youtube]http://www.youtube.com/watch?v=SvXdPW92pnw[/youtube]

When put together you will save the new audio file in extracted folder with filename: audio.mp3 (very important - my script only looks for that filename!)

There you need the second file (all in the same directory as the first one (above). Call this file youtube_merge.bat
Code:
@REM Merge video and audio streams back into one single video file
@REM Created on 2013-01-03 by Dominic Reich <dominic>
@REM License: http://creativecommons.org/licenses/by-nc-sa/3.0/

@echo off
echo Merging video and audio files.
ffmpeg -i extracted\video.mp4 -i extracted\audio.mp3 -map 0:0 -c:v copy -map 1:0 -c:a copy -f mp4 YouTubeReady.avi
echo.
echo Files have been merged. You can now upload 'YouTubeReady.avi' to YouTube.
timeout /t 1
exit

Just doubleclick that file and it will copy back your original video stream and the newly created mp3 file from sony vegas (saved as audio.mp3 in extracted folder).

A new file will be created: YouTubeReady.avi
You can now rename that file to your needs and upload to youtube (all sound streams (game sound and microphone) are now in that video file together).

You might need this when you want to have the conversations from TeamSpeak or other communication software in your videos. Or for live comments whilst playing.

You can use of course any other tool to put the two audio files (PCM) together.
Bugs? Please report them if you encounter some errors and were able to fix them.
I recommend using G-Spot for looking into media files (tells you also what codec to use for decoding).

_________________
websiteyouthinkthisisfun?thisisnofun.
--... ...-- / -.. . / --- . --... -.. .-. -


Last edited by freefallcid on Jan 4th, '13, 23:42, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Dxtory: x264vfw / 2 sound tracks
Unread postPosted: Jan 4th, '13, 02:48 
Offline
Commander
Commander
User avatar

Joined: Sep 18th, '11, 01:00
Posts: 3093
Location: JN57lb
As the above one was way too complicated (will forget the way to do that when I don't need this for a longer period of time).
I wrote everything into one single file, which makes the whole process much easier to handle.

What you need:
a) ffmpeg(.exe) in the same directory as the script
b) original video file (1 video stream, 2 audio streams) in the same directory as the script
c) a tool to merge two audio files (mp3) - sony vegas, audacity should work too
b) a little bit of time (since the video does not get recoded it is a very fast process)

source code
Code:
@REM A script to help you split your video into video and audio tracks
@REM After audio transformation you can re-merge the merged audio track
@REM with your original video track.
@REM Created on 2013-01-04 by Dominic Reich
@REM License: http://creativecommons.org/licenses/by-nc-sa/3.0/

@echo off
echo * Extracting streams...
ffmpeg -i %1 -map 0:1 -vn -c:a libmp3lame -b:a 128k -y "audio-game.mp3" > NUL 2>&1
ffmpeg -i %1 -map 0:2 -vn -c:a libmp3lame -b:a 128k -y "audio-speech.mp3" > NUL 2>&1
echo.
echo * Audio extraction finished - please now merge both mp3 files
echo * 'audio-game.mp3' and 'audio-speech.mp3' into one single
echo * mp3 file called 'audio.mp3'
echo * ONLY PROCEED WHEN FILE 'audio.mp3' IS SAVED ALREADY!
echo.
pause
:FILETEST
if not exist audio.mp3 goto DONTPROCEED
echo.
echo * 'audio.mp3' found, proceeding...
ffmpeg -i %1 -map 0:0 -an -c:v copy -y "video.mp4" > NUL 2>&1
echo * Merging final video...
ffmpeg -i video.mp4 -i audio.mp3 -map 0:0 -c:v copy -map 1:0 -c:a copy -f mp4 -y "%~n1-final.avi" > NUL 2>&1
echo * Deleting temporary files...
DEL audio-game.mp3 audio-speech.mp3 video.mp4 audio.mp3 > NUL 2>&1
echo * Ok, all done. Enjoy your video!
echo.
timeout /t 5
exit
:DONTPROCEED
echo.
echo.
echo.
echo SAVE YOUR MERGED AUDIO TRACK AS 'audio.mp3'!
echo We only continue with a merged audio file!
echo.
pause
goto FILETEST


Also to help a bit a short video on the usage
[youtube]http://www.youtube.com/watch?v=b6Zjlm2IgvE[/youtube]

_________________
websiteyouthinkthisisfun?thisisnofun.
--... ...-- / -.. . / --- . --... -.. .-. -


Top
 Profile  
 
 Post subject: Re: Dxtory: x264vfw / 2 sound tracks
Unread postPosted: Jan 4th, '13, 05:53 
Offline
=WiW= General of the Army
=WiW= General of the Army
User avatar

Joined: Sep 1st, '11, 01:00
Posts: 1642
Looks like the shit cid, nice one fella, what is it ?

:)):  :)):

_________________
Image

Not missing the snow at all :)


Top
 Profile  
 
 Post subject: Re: Dxtory: x264vfw / 2 sound tracks
Unread postPosted: Jan 4th, '13, 13:57 
Offline
Major
Major
User avatar

Joined: Aug 29th, '11, 01:00
Posts: 734
Location: West Mids, UK
You should search for the avi fix for vegas to be able to use it sony aswell.

_________________
Image
Daily Gaming News & Reviews
Twitch - Musicgamesandvideo


Top
 Profile  
 
 Post subject: Re: Dxtory: x264vfw / 2 sound tracks
Unread postPosted: Dec 6th, '14, 15:59 
Offline
Commander
Commander
User avatar

Joined: Sep 18th, '11, 01:00
Posts: 3093
Location: JN57lb
lol soul its the result of me playing around with that stuff finding a workaround.

symon you made my day, thanks.

i searched before but with the wrong words. found lot of avi fixes but now i finally found avic tool to change FourCC (not really needed, but it showed me interesting stuff when i tried different settings).
Took me a while to findout that changing them both to x264 works flawless with vegas.

So all to use is a correct video recording setting in dxtory:
Image

Image

http://x264vfw.sourceforge.net/

_________________
websiteyouthinkthisisfun?thisisnofun.
--... ...-- / -.. . / --- . --... -.. .-. -


Last bumped by freefallcid on Dec 6th, '14, 15:59.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Represa Hosting.
© =WiW= 2006-2018
Thanks to Levi / Sy.