Hello there,
I have lot of MP4-videos (around 1000) and all of them have different width and height.
What I want to do is: Set a certain height (for example 320px) and resize all of them at once so all of them are 320px high after this. Aspect ratio should be kept so width should be set automatically.
After this, I want to add a logo/branding to all videos at once at a certain position (for example X = 0 and Y = 250).
It's important to me that the original quality and FPS of this videos will not be changed, only the size.
Is there any nice program to recommend? Free would be cool, but I'd also pay for it.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 23 of 23
Thread
-
-
You could probably make a ffmpeg batch script.
See:
https://trac.ffmpeg.org/wiki/Scaling%20%28resizing%29%20with%20ffmpeg
http://superuser.com/questions/683643/how-to-add-my-logo-for-the-first-30-seconds-in-a...eo-with-ffmpeg
And the command will look something like
Code:c:\ffmpeg\ffmpeg.exe -i c:\videos\input.mp4 -i c:\videos\logo.png -filter_complex "[0:v][1:v]overlay=0:250" -vf scale=-1:320 -c:v libx264 -c:a copy c:\videos\out.mp4
Or maybe can you find some ffmpeg frontend/gui with all those features.Last edited by Baldrick; 22nd Mar 2015 at 02:58.
-
Thank you so far. This looks really complicating, I have no knowledge in scripting, I need a finished program where I only have to select what I like.
-
I'm not sure you will find any program with all your features. But if you get the ffmpeg command working can I help with the bat script.
You download ffmpeg. Put ffmpeg.exe in c:/ffmpeg. Put your test input.mp4 video and logo.png in c:/videos. And last copy the code above and paste from windows start and run or from a command box.
Or maybe you have some computer geek/programmer that can help you directly. -
Assuming you know the output video format you want in detail and you are on a Windows system, you could use Hybrid:
(Hybrid doesn't support adding a Logo on Mac&Linux atm.)- Download and install Hybrid
- set 'Crop/Resize->Main->Resize->Picture Resize->AutoAdjust' to 'width'
- set the second parameter of 'Crop/Resize->Main->Resize->Picture Resize->Target resolution' to 320
- enable 'Crop/Resize->Misc->Misc->Keep resize for new source'
- If your files contain subtitle streams which should be kept, enable 'Config->Automation->Passthrough streams->Subtitle'
- drag&drop all your files into Hybrid (in the Main-tab); Hybrid will then analyse all of the input files
- enable 'Filtering->Avisynth->Others->Logo'
- use 'Filtering->Avisynth->Others->Logo->Select' to select the image you want to embed (make sure the logo is small enough)
- use the other settings to adjust position&co and use the 'Avisynth Preview' in the lower right corner to get a preview
- set 'Main->Handling->Audio handling' to 'passthrough all'
- configure the video settings the way you want/need them (I assume you know what output format you need)
- set a default output folder under 'Config->Path->Default output path'
- enable 'Main->Generate'
- create processing jobs by pressing 'Main->Add to queue' (button in the lower right corner)
- start the processing by pressing 'Jobs->Job Queue->Start' (the play-button)
- wait for Hybrid to process all your files.
Also:
Since you need to reencode to embed the logo you will always loose some quality, but depending on your video encoding settings they might not be visible during normal playback to most people.
Cu Selurusers currently on my ignore list: deadrats, Stears555 -
Really great help so far, thank you.
I want to try both methods to see which method gives me smaller filesize and/or better quality.
@Selur: In Hybrid I have problems adding a logo, the logo is .jpg, does it have to be .png? Because I click on Add logo and nothing happens.
To be exactly, it's not really a logo I need, I only want to write a URL on the video, so it's no graphic, only letters. Maybe there is a simple way for this?
@Baldrick: I tried it out and I receive the following error: "Filtergraph 'scale=-1:320' was specified through the -vf/-af/-filter option for output stream 0:0, which is fed from a complex filtergraph. -vf/-af/-filter and -filter_complex cannot be used together for the same stream.
What does this mean?
Information: I first want to resize the video, and after it is resized I want to add the logo. I don't want to add the logo before the video is resized, because then the logo will become too small and people can't read it anymore.
Regards. -
-
I just tried switching it but it still does not work.
If I only use the branding it works, and if I only use the resizing it says:
"width not divisible by 2"
and
"Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"
What I also wanted to ask is how can I say ffmpeg to keep the original bitrate and FPS? -
Last edited by pandy; 23rd Mar 2015 at 08:08.
-
@Selur: In Hybrid I have problems adding a logo, the logo is .jpg, does it have to be .png? Because I click on Add logo and nothing happens.
You need to:
0. make sure your image is small enough to fit onto your video (Hybrid will not resize the logo for your)
1. enabled Filtering->Avisynth->Other->Logo
2. Hit the 'Select'-Button and select your video
3. Hit the 'Avisynth Preview'-button, look at the video with the logo and adjust the Logo settings
b. got no problem here adding gif/jpeg/pngusers currently on my ignore list: deadrats, Stears555 -
-
Okay I finally managed to create a single video file how I want it to be with both methods.
The file created by Hybrid is much larger than the file created by ffmpeg so I will stick to ffmpeg.
Only problem here is that I still can't do resizing and adding logo in one encoding process because of this error: "-vf/-af/-filter and -filter_complex cannot be used together for the same stream."
If there is a possibility to do both in one step this would be awesome -
ffmpeg by default is probably using crf 23.
Code:ffmpeg.exe -y -i F:\Test-AC3-5.1.avi -i f:\cross.jpg -filter_complex "[0:v] scale=trunc(oh/a/2)*2:320 [src];[src][1:v] overlay=0:0" -c:v libx264 -c:a copy f:\test.mp4
users currently on my ignore list: deadrats, Stears555 -
@Baldrick: I used same CRF-value in Hybrid as in ffmpeg and still Hybrid file is much larger.
@Selur: Why isn't it right either, it works fine now, resizing and watermarking, both together
I used to resize my files with Avidemux, but even if I enter the same CRF value in ffmpeg I still think the quality is a little bit worse than in Avidemux. Filesize is around the same.
I just checked the x264 configuration in Avidemux and there are a lot of checkboxes activated and a lot of different settings.. is it somehow possible to increase the quality of my ffmpeg output beside of changing the CRF value? Or maybe there is a way just to copy the Avidemux x264 settings into ffmpeg console?
Here are checkboxes which I found activated on Avidemux:
"Fast First Pass"
"Macroblock-tree Rate control"
"Weighted Prediction for B-frames"
"8x8 DCT Spatial Transform"
"4x4, 4x8 and 8x4 P-frame Intra-predicted Blocks"
"8x8 Intra-predicted Blocks"
"4x4 Intra-predicted Blocks"
"CABAC"
"Mixed References"
"Chroma Motion Estimation"
"Trellis Quantization:Final Macroblock Only"
"Fast Skip Detection on P-frames"
"DCT Decimation on P-frames"
Which of them is making the quality better as in ffmpeg?
Regards.Last edited by Basher06; 24th Mar 2015 at 03:49.
-
Batch command to process all files with a logo and resize:
Code:for %%a in ("*.mp4") do C:\ffmpeg.exe -i "C:\Videos\%%a" -i C:\logo1.png -filter_complex "[0:v] scale=-2:320 [src];[src][1:v] overlay=0:0" -c:v libx264 -crf 25 -c:a copy "C:\Output\%%~na.mp4" pause
-
This is absolutely awesome, Baldrick! Thank you very much!
Last edited by Basher06; 24th Mar 2015 at 06:02.
-
second input or complex is not required - for me, this works OK*:
Code:-vf " ... [aaa] ; movie=picture.png [bbb]; [aaa] [bbb] overlay=W-w-16:H-h-64, ... "
*http://www.urbandictionary.com/define.php?term=works+for+me
btw use alpha channel for antialiasing - logo will be nicely overlayed with anitaliased edges over video plane -
@pandy: Nice, didn't know the movie-parameter.
users currently on my ignore list: deadrats, Stears555
Similar Threads
-
A Question On How To Calculate Frame Size When Resizing Vid for DVD
By hydrophonicaudio in forum Newbie / General discussionsReplies: 13Last Post: 21st Feb 2011, 07:53 -
Resizing (shrinking) Videos and Batch processing
By DVD_Noob in forum Authoring (DVD)Replies: 1Last Post: 12th Dec 2010, 16:07 -
Resizing videos and creating multiple DVDs in batch?
By DVD_Noob in forum Newbie / General discussionsReplies: 1Last Post: 8th Dec 2010, 01:40 -
mkvmerge is not splitting videos to dvd5 size+ rotating videos+resizing
By rocketman122 in forum EditingReplies: 2Last Post: 24th Aug 2010, 08:12 -
Question | Encoding and shrinking videos.
By Sarlula in forum Video ConversionReplies: 5Last Post: 18th May 2010, 12:36