[FFmpeg-user] How to set histogram size?

Pedro ffmpeg at 11.to
Tue Apr 7 13:06:56 CEST 2015


I solved my problem adding a scale value:

|scale=1280:100
|

|1280| being the width and |100| the height (output video is 1280x720)

The final code looked like this:

ffmpeg -y -report -i input.mp4 -vf 
"split[a][b];[a]format=gray,histogram=mode=waveform:waveform_mode=column,vflip,scale=1280:100,split[c][d];[b]pad=iw:ih+256[padded];[c]geq=g=1:b=1[red];[d]geq=r=1:b=1,crop=in_w:220:0:16[mid];[red][mid]overlay=0:16[wave];[padded][wave]overlay=0:H-h" 
output.mp4

Thank you Dave!


On 4/7/2015 02:01, Dave Rice wrote:
>> On Apr 6, 2015, at 4:32 PM, Pedro <ffmpeg at 11.to> wrote:
>>
>> I'm trying to add a waveform histogram to a video. I'm following this <https://trac.ffmpeg.org/wiki/FancyFilteringExamples#waveform> example but I'm having trouble setting the size of the histogram, this is code I'm using:
>>
>> *ffmpeg -y -report -i input.mp4 -vf "split[a][b];[a]format=gray,histogram=mode=waveform:waveform_mode=column,vflip,split[c][d];[b]pad=iw:ih+256[padded];[c]geq=g=1:b=1[red];[d]geq=r=1:b=1,crop=in_w:220:0:16[mid];[red][mid]overlay=0:16[wave];[padded][wave]overlay=0:H-h" output.mp4*
> Maybe unrelated, but you're forcing [a] to grayscale and then splitting that to [c] and [d], then using geq to extract red from [c] and green from [d]. Taking red and green from a grayscale image should give the same result. Can you explain what you are hoping to achieve?
> Dave Rice
>
>> I've tried to play around with the *|pad|***and *|crop|***values without luck.
>> How can I set the size of histogram to 100 pixels only?
>>
>> Thank you!
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



More information about the ffmpeg-user mailing list