whyamibeer
New member
Problem:
These sites use speex as the audio codec, but this isn't supported by most video players. You need to re-encode the audio in order for it to play through VLC. VirtualDub/Handbrake don't detect the audio, so you'll need to use ffmpeg to make the audio audible.
Overview:
This script is written with powershell. It will process an entire folders worth of recordings so you don't need to do each file, one at a time. Just drop your FLV files with the SPEEX codex into its input folder, run the script, and it will re-encode the videos for you. This method will copy the video stream, not reencode it, so there will be 0 quality or disk space loss. This tutorial is for how to do it on Windows.
The script is probably the exact same thing as tubedigger's convert screen's "Fix FLV" option, but this will handle as many files as you put in the input folder (instead of 1 at a time). Just like the fix FLV option, you can't have the audio muted in tubedigger. It seems if it's muted in tubedigger, the audio will cut out when you mute it. The way around this is to mute the audio for tubedigger with windows (click sound, then go to the mixer. mute all running tubdigger programs there and make sure the audio isnt muted in MFC in tubedigger).
Software required:
Powershell - This should be installed on windows 7 by default, but executing scripts with it is disabled by default. My powershell script will temporally enable it, then set it back to its original state when it's finished. Unfortunately this requires you to run powershell as an admin. It's a fairly simple script so you should be able to tell it doesn't have any viruses in it.
FFMPEG - It's an open source video/audio tool that allows you compress/decompress/transcode videos. I got mine from here: http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140712-git-ca671be-win32-static.7z Grab the 32bit static version from that site.
A brain - I've simplified this quite a bit, but you'll need to be computer literate to execute these steps.
Hardware requirements: Windows. Only tested on windows 7, but it will probably work on any version of windows which has powershell installed.
Steps:
If the script doesn't work for you, you can do this one file at a time with ffmpeg. To do this, drop the file you want to fix into the bin folder. Click the ff-prompt.bat file in the bin folder's parent directory. It brings up its own version of a command prompt. You can type the following to fix 1 file: ffmpeg.exe -i [filename] -vcodec copy [filename with mp4 extension]
Example:
ffmpeg -i mfc_101786698.flv -vcodec copy mfc_101786698.mp4
This has worked for most of my recordings, but I've only been using the script for a few hours now.
Known issues:
For one of my recordings, the source file tubedigger saved was messed up more than usual (unfixable). For this file, it ended up leaving a 174kb video file (original was about a gig) in the output folder... Take this warning to heart. Don't blindly replace your original files with what was in the output directory. Check their file sizes first and test anything that looks too small.
Also, if tubedigger randomly kills itself like it always seems to do for me, the file might be messed up. Check it carefully after running it through the script.
These sites use speex as the audio codec, but this isn't supported by most video players. You need to re-encode the audio in order for it to play through VLC. VirtualDub/Handbrake don't detect the audio, so you'll need to use ffmpeg to make the audio audible.
Overview:
This script is written with powershell. It will process an entire folders worth of recordings so you don't need to do each file, one at a time. Just drop your FLV files with the SPEEX codex into its input folder, run the script, and it will re-encode the videos for you. This method will copy the video stream, not reencode it, so there will be 0 quality or disk space loss. This tutorial is for how to do it on Windows.
The script is probably the exact same thing as tubedigger's convert screen's "Fix FLV" option, but this will handle as many files as you put in the input folder (instead of 1 at a time). Just like the fix FLV option, you can't have the audio muted in tubedigger. It seems if it's muted in tubedigger, the audio will cut out when you mute it. The way around this is to mute the audio for tubedigger with windows (click sound, then go to the mixer. mute all running tubdigger programs there and make sure the audio isnt muted in MFC in tubedigger).
Software required:
Powershell - This should be installed on windows 7 by default, but executing scripts with it is disabled by default. My powershell script will temporally enable it, then set it back to its original state when it's finished. Unfortunately this requires you to run powershell as an admin. It's a fairly simple script so you should be able to tell it doesn't have any viruses in it.
FFMPEG - It's an open source video/audio tool that allows you compress/decompress/transcode videos. I got mine from here: http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140712-git-ca671be-win32-static.7z Grab the 32bit static version from that site.
A brain - I've simplified this quite a bit, but you'll need to be computer literate to execute these steps.
Hardware requirements: Windows. Only tested on windows 7, but it will probably work on any version of windows which has powershell installed.
Steps:
- First off, create a new folder. Name it whatever you want. Mine is called "reencode".
- Download FFMPEG from the link above. Extract it and copy/paste the "ffmpeg.exe" file from the bin folder to your reencode folder.
- Create a new file called "script.ps1". Make sure the extension is actually ps1, not txt
- Open the .ps1 file in notepad and copy/paste the following into it:
Code:function Get-ScriptDirectory { $Invocation = (Get-Variable MyInvocation -Scope 1).Value; if($Invocation.PSScriptRoot) { $Invocation.PSScriptRoot; } Elseif($Invocation.MyCommand.Path) { Split-Path $Invocation.MyCommand.Path } else { $Invocation.InvocationName.Substring(0,$Invocation.InvocationName.LastIndexOf("\")); } } #enable powershell $origPolicy = Get-ExecutionPolicy $policyChanged = 0 if($origPolicy -ne "Unrestricted") { #not running as unrestricted... if we are not an admin, we can't set it to unrestricted so the script can run. If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { #User is not running as admin, request admin rights from the user. if they accept, pass the current arguments into a new powershell process $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments #break quits the program Break } Set-ExecutionPolicy Unrestricted #set this to 1 so we know we need to put it back to its original value. $policyChanged=1 } #get the base directory $baseDir = Get-ScriptDirectory #input directory $inputDir = $baseDir + "\input" #output directory $outputDir = $baseDir + "\output" #make the output directory if it does not exist New-Item -ItemType Directory -Force -Path $outputDir #get the flv files in the input directory. $files = Get-ChildItem $inputDir -Filter *.flv ForEach($file in $files) { #make command line string to reencode the audio in the video $strToExecute = """" + $baseDir + "\ffmpeg.exe" + """" + " -i " + """" + $inputDir + "\" + $file + """" + " -vcodec copy " + """" + $outputDir + "\" + $file.Name.Split(".")[0] + ".mp4" + """" #write it to the screen Write-Host $strToExecute #kick it off Invoke-Expression "& $strToExecute" } #if we changed the execution policy, put it back to what it was before. if($policyChanged -eq 1) { Set-ExecutionPolicy $origPolicy }
- Note: if you quit in the middle of this, it will leave your execution policy to unrestricted. that would allow any powershell script to run on your pc whenever they want (bad..) You can reset it to restricted by opening powershell as an admin and typing Set-ExecutionPolicy Restricted. If you're on a 64bit machine you'll need to do this once for the 64bit powershell and another time for the 32bit powershell.
- Create a .bat file to kick off the powershell script with the following in it:
Code:powershell.exe -command "& .\script.ps1" pause
- Create a folder named "input" in your reencode folder.
- Drop the broken flv files into the input folder.
- To run the script, you should only have to click the .bat file you made.
- You should see a massive amount of text start scrolling by from the ffmpeg.exe's output.
- The fixed files should be in the new output directory.
If the script doesn't work for you, you can do this one file at a time with ffmpeg. To do this, drop the file you want to fix into the bin folder. Click the ff-prompt.bat file in the bin folder's parent directory. It brings up its own version of a command prompt. You can type the following to fix 1 file: ffmpeg.exe -i [filename] -vcodec copy [filename with mp4 extension]
Example:
ffmpeg -i mfc_101786698.flv -vcodec copy mfc_101786698.mp4
This has worked for most of my recordings, but I've only been using the script for a few hours now.
Known issues:
For one of my recordings, the source file tubedigger saved was messed up more than usual (unfixable). For this file, it ended up leaving a 174kb video file (original was about a gig) in the output folder... Take this warning to heart. Don't blindly replace your original files with what was in the output directory. Check their file sizes first and test anything that looks too small.
Also, if tubedigger randomly kills itself like it always seems to do for me, the file might be messed up. Check it carefully after running it through the script.