Hello , i am trying to encode my videos to 3 different resolution in Parallel , i can copy the source for 3 times and then encode each of them with staxrip and i am doing it now , when i asked it from google i realized that i can use FFmpeg (See) but i prefer two pass bcz i care about the size and i couldnt use it with two pass and it didnt work
please help me how can i use ffmpeg multiple output in two pass encoding - 1 source to 3 different output in 1080p - 720p - 480p , thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
What do you mean by "it didn't work"? Always post the complete command you tried as well as the complete log.
In principle it shouldn't be difficult. Just set a different stats file (-passlogfile) for each output. For some encoders it may even be viable to create only one stats file in the first pass and then re-use it for all resolutions.
P.S.: What is the reason you are trying to use multiple outputs simultaneously instead of running one after another? Is the CPU not utilized enough? Heavy filtering/decoding? Often decoding time is negligible compared to encoding time. -
i have a powerfull cpu that i can use multiple outputs simultaneously bcz i can not use the whole the cpu for the 1 encode
ffmpeg -i input \
-s 1280x720 -acodec … -vcodec … output1 \
-s 640x480 -acodec … -vcodec … output2 \
-s 320x240 -acodec … -vcodec … output3
ffmpeg -i input \
-s 1280x720 -acodec … -vcodec … output1 \
-s 640x480 -acodec … -vcodec … output2 \
-s 320x240 -acodec … -vcodec … output3ffmpeg -y -i "..." -c:v libx264 ... mp4 NUL && ^
ffmpeg -i "..." -c:v libx264 ... output
ffmpeg -i input \
-s 1280x720 -acodec … -vcodec … mp4 NUL && ^
ffmpeg -i ".." -vcodec ... output1 ^
and again for the two outputs -
ffmpeg -y -i "..." ^
-s 1280x720 -filter:v "subtitles=..."-c:v libx264 -b:v 1200k -pass 1 -profile:v high -level 4.1 -c:a aac -b:a 96k -ac 2 -f mp4 NUL && ^
ffmpeg -i "..." -s 1280x720 -filter:v "subtitles=..."-c:v libx264 -b:v 1200k -pass 2 -profile:v high -level 4.1 -c:a aac -b:a 96k -ac 2 "1280p.mkv" ^
-s 854x480 -filter:v "subtitles=..."-c:v libx264 -b:v 600k -pass 1 -profile:v high -level 4.1 -c:a aac -b:a 64k -ac 2 -f mp4 NUL && ^
ffmpeg -i "..." -s 854x480 -filter:v "subtitles=..."-c:v libx264 -b:v 600k -pass 2 -profile:v high -level 4.1 -c:a aac -b:a 64k -ac 2 "854p.mkv" ^
-s 1920x1080 -filter:v "subtitles=..."-c:v libx264 -b:v 2400k -pass 1 -profile:v high -level 4.1 -c:a aac -b:a 128k -ac 2 -f mp4 NUL && ^
ffmpeg -i "..." -s 1920x1080 -filter:v "subtitles=..."-c:v libx264 -b:v 2400k -pass 2 -profile:v high -level 4.1 -c:a aac -b:a 128k -ac 2 "1080p.mkv"
libx264: Invalid argument -
Make sure you didn't forget any spaces. E.g. instead of:
Code:"subtitles=..."-c:v libx264
Code:"subtitles=..." -c:v libx264
-
Why are you doing this ?
If no additional processing is being done besides resize, subtitles, wouldn't it be faster just to use 3 separate simultaneous ffmpeg instances ?
The usual thinking is 1 read operation is better than more than 1, but decoding is rarely a bottleneck (assuming no I/O problems (slow storage, fragmented HDD), unless you're >UHD or maybe some unoptimized decoder (maybe some codecs in development AV-1 right now), and usually only a small fraction of CPU usage
480p version will encode much faster than 1080p version - but doing 1 read operation for multiple outputs will bottleneck the 480p encode . You will end up with lower CPU usage, slower FPS overall. You will end up encoding as slow as the slowest version. -
Cases where it might be faster/better/useful is where you have additional processing shared by all output versions e.g. some filters ; Then you "save" the additional processing for each version by only having to do it once instead of "n" times. You obviously can't share the resize operation (each requires separate)
I don't know how "slow" the ffmpeg subtitle filter is, but if it's applied before each resized output version, it might be possible to save that processing time. (applied once instead of 3 separate versions)
Similar Threads
-
FFMPEG Input and Output line for converting multiple videos
By Phillipj in forum Video ConversionReplies: 13Last Post: 10th May 2016, 16:23 -
ffmpeg multiple input (including pipeline) and single output
By z-machine95 in forum Video ConversionReplies: 9Last Post: 23rd Aug 2015, 18:52 -
How do I use FFMPEG to output an MPEG-TS file with multiple programs?
By Videogamer555 in forum Video ConversionReplies: 13Last Post: 31st Aug 2014, 06:45 -
Lossy output with FFMPEG JPEG 2000
By dmkr in forum Video ConversionReplies: 20Last Post: 24th Jul 2014, 15:49 -
FFMPEG - How to record multiple RTMP streams into multiple files
By wwwmaster2k in forum Capturing and VCRReplies: 1Last Post: 11th Jul 2014, 13:51