IDE-3D: Interactive Disentangled Editing for High-Resolution 3D-aware Portrait Synthesis
Existing 3D-aware facial generation methods face a dilemma in quality ver- sus editability: they either generate editable results in low resolution, or high quality ones with no editing flexibility. In this work, we propose a new approach that brings the best of both worlds together. Our system consists of three major components: (1) a 3D-semantics-aware generative model that produces view-consistent, disentangled face images and semantic masks; (2) a hybrid GAN inversion approach that initialize the latent codes from the semantic and texture encoder, and further optimized them for faithful reconstruction; and (3) a canonical editor that enables efficient manipulation of semantic masks in canonical view and producs high quality editing re- sults. Our approach is competent for many applications, e.g. free-view face drawing, editing and style control. Both quantitative and qualitative results show that our method reaches the state-of-the-art in terms of photorealism, faithfulness and efficiency.
Here’s a small collection of scripts i’ve made, downloaded, modified, etc to compress, edit, add, remux video files as well as converting mkv files without the need of re-rendering.
Copy the code and save as a .bat file, save it on your ffmpeg bin folder or any command line if ffmpeg was installed with its environment path.
To use the scripts, just drag and drop your video file on the .bat file you created.
Browse in the archive up to the bin subfolder containing ffmpeg, ffprobe and ffplay executables. Uncompress the bin folder (in this example we’ll use C:\ffmpeg\bin)
Register ffmpeg, ffprobe & ffplay to environment variables
Through command lines: Hit the windows key, write down cmd and press Enter and enter the following command, line after line:
set ffmpeg=C:\ffmpeg\bin set ffprobe=C:\ffmpeg\bin set ffplay=C:\ffmpeg\bin
You can draw the frame number on top of the video and render it as a new file.
rem @echo off
:again
cd /D %~p1
ffmpeg ^
-i "%~nx1" ^
-vf "drawtext=fontfile=/Windows/Fonts/courbd.ttf: text='Frame \: %%{eif\:n\:d\:2}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: fontsize=40: box=1: boxcolor=black@0.4: boxborderw=8" ^
-c:a copy ^
"%~p1%~n1_framenumbered.mov"
pause
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
Convert Any Video to a 100MB File
Reduce the size of your video to match a 100MB limit.
@echo off
:again
cd /D %~p0
SET output=%~p1%~n1_100MB.mp4
set cmd="ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %1 "
FOR /F "tokens=*" %%i IN (' %cmd% ') DO SET seconds=%%i
echo aaaa
echo aaaa
SET /A "totalBitrate=500000/seconds"
SET overheadBitrate=100
SET audioBitrate=96
SET /A "videoBitrate=totalBitrate-audioBitrate-overheadBitrate"
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 1 -b:a %audioBitrate%k ^
-f mp4 NUL && \
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 2 ^
-b:a %audioBitrate%k "%output%"
del /q ffmpeg2pass-*.log ffmpeg2pass-*.mbtree
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
Convert Video to Discord File Size Limits
Reduce the video size to match Discord limit.
@echo off
:again
cd /D %~p0
SET output=%~p1%~n1_Discorded.mp4
set cmd="ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %1 "
FOR /F "tokens=*" %%i IN (' %cmd% ') DO SET seconds=%%i
echo aaaa
echo aaaa
SET /A "totalBitrate=64000/seconds"
SET overheadBitrate=100
SET audioBitrate=96
SET /A "videoBitrate=totalBitrate-audioBitrate-overheadBitrate"
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 1 -b:a %audioBitrate%k ^
-f mp4 NUL && \
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 2 ^
-b:a %audioBitrate%k "%output%"
del /q ffmpeg2pass-*.log ffmpeg2pass-*.mbtree
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
Convert Video to Facebook File Size Limits
Reduce the video size to match Facebook limit.
@echo off
:again
cd /D %~p0
SET output=%~p1%~n1_Messengered.mp4
set cmd="ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %1 "
FOR /F "tokens=*" %%i IN (' %cmd% ') DO SET seconds=%%i
echo aaaa
echo aaaa
SET /A "totalBitrate=160000/seconds"
SET overheadBitrate=100
SET audioBitrate=96
SET /A "videoBitrate=totalBitrate-audioBitrate-overheadBitrate"
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 1 -b:a %audioBitrate%k ^
-f mp4 NUL && \
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 2 ^
-b:a %audioBitrate%k "%output%"
del /q ffmpeg2pass-*.log ffmpeg2pass-*.mbtree
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
Convert Video to Whatsapp File Size Limits
Reduce the video size to match Whatsapp limit.
@echo off
:again
cd /D %~p0
SET output=%~p1%~n1_Whatsapped.mp4
set cmd="ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %1 "
FOR /F "tokens=*" %%i IN (' %cmd% ') DO SET seconds=%%i
echo aaaa
echo aaaa
SET /A "totalBitrate=260000/seconds"
SET overheadBitrate=100
SET audioBitrate=96
SET /A "videoBitrate=totalBitrate-audioBitrate-overheadBitrate"
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 1 -b:a %audioBitrate%k ^
-f mp4 NUL && \
ffmpeg ^
-i %1 ^
-c:v libx264 ^
-b:v %videoBitrate%k ^
-pass 2 ^
-b:a %audioBitrate%k "%output%"
del /q ffmpeg2pass-*.log ffmpeg2pass-*.mbtree
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
MKV 5.1 audio to Stereo without rendering (Useful when source audio cannot be played on your TV)
Downmix 5.1 audio to Stereo for MKV files with 5.1 audio that can’t be played.
@echo off
cd /D %~p0
echo Convert Audio to Stereo ...
for %%i in (%*) do if not exist "%~p1%%~ni_Stereo.mkv" (
ffmpeg.exe -i "%%~i" -map 0 -c copy -c:a aac -ac 2 "%~p1%%~ni_Stereo.mkv"
)
popd
echo Done..
Extract Audio Track #2 from MKV video and export it as an mp4 audio file
This script extracts the audio track #2 from the mkv you drop, if you need to extract track #1 then modify the “-map 0:a:1” to “-map 0:a:0” (track begin at 0 instead of 1)
@echo off
cd /D %~p0
echo Extracting audio track 2 ...
for %%i in (%*) do if not exist "%~p1%%~ni_Audio.mp4" (
ffmpeg -i "%%~i" -map 0:a:1 -c copy -c:a aac -ac 2 "%~p1%%~ni_Audio.mp4"
)
popd
echo Done..
Offset Audio by 1.4 seconds without re-encoding
@echo off
cd /D %~p0
echo Delay audio by 1.4 seconds ...
for %%i in (%*) do if not exist "%~p1%%~ni_delayed.mp4" (
ffmpeg.exe -i "%%~i" -itsoffset 1.4 -i "%%~i" -map 0:v -map 1:a -c copy "%~p1%%~ni_delayed.mp4"
)
popd
echo Done..
Video to instagram size and blurred background fitting
@echo off
:again
:: To change the resolution, change the SquareSize value above (just after the =). Default is 600.
set SquareSize=600
ffmpeg -i "%~1" ^
-c:v libx264 -crf 23 -filter_complex "[0:v]split=2[blur][vid];[blur]scale=%SquareSize%:%SquareSize%:force_original_aspect_ratio=increase,crop=%SquareSize%:%SquareSize%,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[vid]scale=%SquareSize%:%SquareSize%:force_original_aspect_ratio=decrease[ov];[bg][ov]overlay=(W-w)/2:(H-h)/2" -profile:v baseline -level 3.0 -pix_fmt yuv420p -preset faster -tune fastdecode ^
-c:a aac -ac 2 -b:a 128k ^
-movflags faststart ^
"%~p1%~n1_Instagramized.mp4" -y
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 10 seconds.[0m
timeout /t 10
Convert any OGV file to an MP4 with fast conversion and using h264, just drag and drop the file into the script.
@echo off
setlocal enabledelayedexpansion
REM Check if FFmpeg is installed
where ffmpeg >nul 2>nul
if %errorlevel% neq 0 (
echo FFmpeg is not installed or not in the system PATH. Please install FFmpeg and try again.
pause
exit /b 1
)
REM Check if a file is provided
if "%~1" == "" (
echo Please drag and drop an OGV file onto this script.
pause
exit /b 1
)
REM Input and output file paths with quotes
set "inputFile=%~1"
set "outputFile=%~dpn1.mp4"
REM Run FFmpeg command with quotes around file paths
ffmpeg -i "!inputFile!" -c:v libx264 -crf 22 -c:a aac -b:a 128k -strict -2 "!outputFile!"
REM Check FFmpeg exit code
if !errorlevel! neq 0 (
echo An error occurred during conversion.
pause
exit /b 1
)
echo Conversion successful. Output file: "!outputFile!"
pause
CONVERT ANY VIDEO TO A TIMELAPSE MP4
Convert any video to a timelapse by using every 15th frames.
@echo off
setlocal enabledelayedexpansion
REM Check if FFmpeg is installed
where ffmpeg >nul 2>nul
if %errorlevel% neq 0 (
echo FFmpeg is not installed or not in the system PATH. Please install FFmpeg and try again.
pause
exit /b 1
)
REM Check if a file is provided
if "%~1" == "" (
echo Please drag and drop an OGV file onto this script.
pause
exit /b 1
)
REM Input and output file paths with quotes
set "inputFile=%~1"
set "outputFile=%~dpn1_timelapse.mp4"
REM Run FFmpeg command with quotes around file paths
ffmpeg -i "!inputFile!" -vf framestep=15,setpts=N/60/TB -r 60 -vcodec libx264 -an "!outputFile!"
REM Check FFmpeg exit code
if !errorlevel! neq 0 (
echo An error occurred during conversion.
pause
exit /b 1
)
echo Conversion successful. Output file: "!outputFile!"
pause
CONVERT ANYTHING TO 720p MP4
Downscale video to match 720p resolution.
@echo off
setlocal enabledelayedexpansion
REM Check if FFmpeg is installed
where ffmpeg >nul 2>nul
if %errorlevel% neq 0 (
echo FFmpeg is not installed or not in the system PATH. Please install FFmpeg and try again.
pause
exit /b 1
)
REM Check if a file is provided
if "%~1" == "" (
echo Please drag and drop an OGV file onto this script.
pause
exit /b 1
)
REM Input and output file paths with quotes
set "inputFile=%~1"
set "outputFile=%~dpn1_720p.mp4"
REM Run FFmpeg command with quotes around file paths
ffmpeg -i "!inputFile!" -vf scale=1280:720 -preset slow -crf 18 "!outputFile!"
REM Check FFmpeg exit code
if !errorlevel! neq 0 (
echo An error occurred during conversion.
pause
exit /b 1
)
echo Conversion successful. Output file: "!outputFile!"
pause
VIDEO TO JPG SEQUENCE
Convert any video to a jpg sequence.
@echo off
setlocal EnableExtensions DisableDelayedExpansion
REM Check if the batch file is called with at least one non-empty argument string.
if "%~1" == "" echo INFO: Drag an MP4 file onto this script to begin frame extraction.& pause & exit /B
set "inputFile=%~1"
REM Create the subdirectory input in the directory named after the video file.
md "%~dpn1\input" 2>nul
if not exist "%~dpn1\input\" echo ERROR: Could not create the directory: "%~dpn1\input"& pause & exit /B 2
REM Extract frames from the MP4 file.
ffmpeg.exe -i "%~1" -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 "%~dpn1\input\image%%03d.jpg"
if errorlevel 1 rd "%~dpn1\input" 2>nul & echo ERROR: Failed to extract the frames from: "%~1"& pause & exit /B 1
echo Extraction complete.
pause
endlocal
Creating thumbnail from video and saving it as a PNG
You can choose a specific frame from the video manually by specifying its timestamp. If you want to capture the frame at 00:15, add -ss 00:00:15 before your input video to take a screenshot at the 15th second of the video.
@echo off
setlocal enabledelayedexpansion
REM Check if FFmpeg is installed
where ffmpeg >nul 2>nul
if %errorlevel% neq 0 (
echo FFmpeg is not installed or not in the system PATH. Please install FFmpeg and try again.
pause
exit /b 1
)
REM Check if a file is provided
if "%~1" == "" (
echo Please drag and drop an OGV file onto this script.
pause
exit /b 1
)
REM Input and output file paths with quotes
set "inputFile=%~1"
set "outputFile=%~dpn1.png"
REM Run FFmpeg command with quotes around file paths
ffmpeg -ss 00:00:05 -i "!inputFile!" -frames:v 1 "!outputFile!"
REM Check FFmpeg exit code
if !errorlevel! neq 0 (
echo An error occurred during conversion.
pause
exit /b 1
)
echo Conversion successful. Output file: "!outputFile!"
pause
CONVERT IMG SEQUENCE TO MP4
@echo off
REM Input and output file paths with quotes
:: The script expects the first parameter to be the image file.
set "imageFile=%~1"
:: Extract the filename without extension for the output video name.
for %%A in ("%imageFile%") do set "filename=%%~nA"
set "inputFile=%filename%.jpg"
set "outputFile=%filename%.mp4"
ffmpeg ^
-framerate 24 ^
-start_number 1 ^
-i "TURN_%%04d.jpg" ^
-c:v libx264 -pix_fmt yuv420p -crf 17 ^
-preset faster -tune fastdecode ^
"TURNTABLE.mp4"
if NOT ["%errorlevel%"]==["0"] goto:error
echo [92m%~n1 Done![0m
shift
if "%~1" == "" goto:end
goto:again
:error
echo [93mThere was an error. Please check your input file or report an issue on github.com/L0Lock/FFmpeg-bat-collection/issues.[0m
pause
exit 0
:end
cls
echo [92mEncoding succesful. This window will close after 2 seconds.[0m
timeout /t 2
So I have to cross this from my bucketlist, Canicas is part of the selection for the LALIF 2022, and thatnks to them our work is featured among others on animation magazine!!!!!!
So I was at the Banamex Museum for a walk and found this around 2021, forgot to capture the full info on the dates and authors but this is the first time i’ve seen any representation of Mexico City being a walled city with bridges that spawned all the way from Iztapalapa.
So if you’re having problems with Keyframe Pro/MP not starting, or the app hanging, and not launching at all, specially when it was launching previously, there are two options.
a) Disable the Hardware Acceleration on Keyframe PRO/MP, since the app cannot be launched you’ll have to do this by modifying the file ” keyframe_mp.ini” located at C:\Users\<user>\Documents\keyframe_mp\config\keyframe_mp.ini
Going to hardwareAcceleratedPlayback and setting it to false
Setting hardwareAcceleratedPlayback to false
b) Disable NahimicService located on your Task Manager / Services
Right click and select Disable
Then relaunch Keyframe MP/PRO, it should run as before with any of those two options.
Stumbled across this collection from stacks.stanford.edu, where Muybridge travelled to Mexico and Central America during the late 1870’s. Amazing to see through the eyes of an explorer an analyst of the human motion, some architecture specially from the land where we grew in. A trip to the past, vast and populated at a times lonesome and isolated, lot’s of fishermen, nature and habitants that built the cities we live in this days.
So after all this round of censorship, found this amazing protocol/app that works for a P2P based video streaming. Pretty much like if Youtube and Napster had a baby and it’s called LBRY.
With normal client and web browser
Basically the protocol which is based on the blockchain (torrent, bitcoin) works as a CDN with two main providers, one is the Uploader then The host website which is Odysee. Whenever you upload a video it stays on your computer and the CDN host, then whoever watches it, stores it as well. So when the access is blocked (copyright, DMCA, censorship) since the company is based in the US, they have to block the access but they do not delete the files, just render them unaccessible by traditional means, meaning that if you get your hands on a modified client, you can still access all the blocked content.
This content cannot be removed so basically is censorship, copyright free CDN video protocol.