Re: [FFmpeg-user] Video in video not from start

2024-01-05 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Cecil Westerhof via ffmpeg-user  writes:
>
>> Ferdi Scholten  writes:
>>
>>> I want to play a video in a video from a certain point. I understood I
>>>> could do something like:
>>>>  ffmpeg  \
>>>>-i input1.mp4 \
>>>>-i input2.mp4 \
>>>>-filter_complex "
>>>>  [0:v][1:v] overlay=25:25:
>>>>  enable='between(t,8,20)'
>>>>" \
>>>>-pix_fmt yuv420p  \
>>>>-c:a copy \
>>>>output.mp4
>>>>
>>>> But this starts input2.mp4 from the start of input2.mp4 on the 8
>>>> second, for twelve seconds.
>>>> Is it possible to let input2.mp4 not start from second 0, but from
>>>> second 17?
>>>>
>>> Try putting -ss 17 between the two inputs.
>>
>> I was thinking about that. But that means that if I want to use
>> input2.mp4 several times, I should use input2.mp4 several times with
>> the correct -ss. Not really a problem, but I had hoped for a more
>> efficient way. But I will use it like this for the moment then.
>> Thanks.
>
> At the moment I have:
> ffmpeg -y   \
>   -to 30-i "${inputFile}"   \
>   -ss 11 -to 28 -i "${overlayFile}" \
>   -filter_complex "
> [0:v][1:v] overlay=main_w-(overlay_w+10):10:
> enable='between(t,8,25)'
>   " \
>   -pix_fmt yuv420p  \
>   -acodec libmp3lame\
>   -vcodec libx264   \
>   -preset veryfast  \
>   -crf 26   \
>   "${outputFile}"
>
> It works, but I have a question and found a problem.

…

> In my search to find this solution, I think I saw a method to scale
> the overlay file. But I cannot find it anymore. :'-(
> Am I mistaken, or is it possible? I would like to scale the overlay
> file to 640:-2.

I found the solution I think:
ffmpeg -y   \
  -to 30-i "${inputFile}"   \
  -ss 11 -to 28 -i "${overlayFile}" \
  -filter_complex "
[1:v]   scale=960:-2[scaled:v],
[0:v][scaled:v] overlay=main_w-(overlay_w+10):10:
enable='between(t,8,25)'
  " \
  -pix_fmt yuv420p  \
  -acodec libmp3lame\
  -vcodec libx264   \
  -preset veryfast  \
  -crf 26   \
  "${outputFile}"

I needed another scale as I thought.

It looks like the end part of the overlay is not displayed correctly,
but I will look into that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Video in video not from start

2024-01-05 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Ferdi Scholten  writes:
>
>> I want to play a video in a video from a certain point. I understood I
>>> could do something like:
>>>  ffmpeg  \
>>>-i input1.mp4 \
>>>-i input2.mp4 \
>>>-filter_complex "
>>>  [0:v][1:v] overlay=25:25:
>>>  enable='between(t,8,20)'
>>>" \
>>>-pix_fmt yuv420p  \
>>>-c:a copy \
>>>output.mp4
>>>
>>> But this starts input2.mp4 from the start of input2.mp4 on the 8
>>> second, for twelve seconds.
>>> Is it possible to let input2.mp4 not start from second 0, but from
>>> second 17?
>>>
>> Try putting -ss 17 between the two inputs.
>
> I was thinking about that. But that means that if I want to use
> input2.mp4 several times, I should use input2.mp4 several times with
> the correct -ss. Not really a problem, but I had hoped for a more
> efficient way. But I will use it like this for the moment then.
> Thanks.

At the moment I have:
ffmpeg -y   \
  -to 30-i "${inputFile}"   \
  -ss 11 -to 28 -i "${overlayFile}" \
  -filter_complex "
[0:v][1:v] overlay=main_w-(overlay_w+10):10:
enable='between(t,8,25)'
  " \
  -pix_fmt yuv420p  \
  -acodec libmp3lame\
  -vcodec libx264   \
  -preset veryfast  \
  -crf 26   \
  "${outputFile}"

It works, but I have a question and found a problem.

In most cases you will not encounter the problem, but because I am
testing I did encounter it.
First I used for the overlay file only '-ss 11'. But I needed the to
also, otherwise the video would freeze and keep playing.
But in a strange way. The overlay file is 60 seconds long. When
subtracting 11 seconds that leaves 49 seconds. The resulting video
would become 49 seconds long instead of 30 seconds. I would prefer 30
seconds of-course, but I do not understand the 49 seconds. The overlay
file starts at 8 seconds, so I find it strange that the file does not
continue to 57 seconds (49 + 8). This seems a double bug to me. (Not
using the length of the main file and using the length from the
overlay file without consideration when it starts.)


In my search to find this solution, I think I saw a method to scale
the overlay file. But I cannot find it anymore. :'-(
Am I mistaken, or is it possible? I would like to scale the overlay
file to 640:-2.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Video in video not from start

2024-01-05 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 05.01.2024 um 10:26 schrieb Cecil Westerhof via ffmpeg-user:
>> Ferdi Scholten  writes:
>>
>>> I want to play a video in a video from a certain point. I understood I
>>>> could do something like:
>>>>   ffmpeg  \
>>>> -i input1.mp4 \
>>>> -i input2.mp4 \
>>>> -filter_complex "
>>>>   [0:v][1:v] overlay=25:25:
>>>>   enable='between(t,8,20)'
>>>> " \
>>>> -pix_fmt yuv420p  \
>>>> -c:a copy \
>>>> output.mp4
>>>>
>>>> But this starts input2.mp4 from the start of input2.mp4 on the 8
>>>> second, for twelve seconds.
>>>> Is it possible to let input2.mp4 not start from second 0, but from
>>>> second 17?
>>>>
>>> Try putting -ss 17 between the two inputs.
>> I was thinking about that. But that means that if I want to use
>> input2.mp4 several times, I should use input2.mp4 several times with
>> the correct -ss. Not really a problem, but I had hoped for a more
>> efficient way.
>
> You can cut off the beginning of the second stream with the "trim"
> filter, but then you must also use the "atrim" filter for audio. "-ss"
> is easier, but can only make a cut at a keyframe, if I remember right.

For the moment being I will keep at -ss, but I will look into it
later.

I do have a little problem with the functionality. I make it a bit
more clear and start a new thread about it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Video in video not from start

2024-01-05 Thread Cecil Westerhof via ffmpeg-user
Ferdi Scholten  writes:

> I want to play a video in a video from a certain point. I understood I
>> could do something like:
>>  ffmpeg  \
>>-i input1.mp4 \
>>-i input2.mp4 \
>>-filter_complex "
>>  [0:v][1:v] overlay=25:25:
>>  enable='between(t,8,20)'
>>" \
>>-pix_fmt yuv420p  \
>>-c:a copy \
>>output.mp4
>>
>> But this starts input2.mp4 from the start of input2.mp4 on the 8
>> second, for twelve seconds.
>> Is it possible to let input2.mp4 not start from second 0, but from
>> second 17?
>>
> Try putting -ss 17 between the two inputs.

I was thinking about that. But that means that if I want to use
input2.mp4 several times, I should use input2.mp4 several times with
the correct -ss. Not really a problem, but I had hoped for a more
efficient way. But I will use it like this for the moment then.
Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Video in video not from start

2024-01-04 Thread Cecil Westerhof via ffmpeg-user
I want to play a video in a video from a certain point. I understood I
could do something like:
ffmpeg  \
  -i input1.mp4 \
  -i input2.mp4 \
  -filter_complex "
[0:v][1:v] overlay=25:25:
enable='between(t,8,20)'
  " \
  -pix_fmt yuv420p  \
  -c:a copy \
  output.mp4

But this starts input2.mp4 from the start of input2.mp4 on the 8
second, for twelve seconds.
Is it possible to let input2.mp4 not start from second 0, but from
second 17?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Change only video

2023-10-16 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 16.10.2023 um 13:50 schrieb Cecil Westerhof via ffmpeg-user:
>> For example: if I have a video where I want to change for a short
>> while only the video, but not the audio.
>> Say I have a video A of five minutes B of 3 seconds and C of 5
>> seconds.
>> At 2:12 I want to use the video of video B instead of video A, but
>> keep the sound of video A.
>> And at 3:41 I want to do the same thing with video C.
>> How would I do that?
>
> There is an example in chapter 2.64 in my book:
> http://www.astro-electronic.de/FFmpeg_Book.pdf

I will look into it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] How to extend this page about screen recording

2023-10-16 Thread Cecil Westerhof via ffmpeg-user
Ulf Zibis  writes:

> Am 12.10.23 um 11:51 schrieb Cecil Westerhof via ffmpeg-user:
>> I just found this:
>>  https://trac.ffmpeg.org/wiki/Capture/Desktop
>>
>> Very interesting indeed.
>>
>> I have two monitors. I could write something about how to use this
>> with two monitors (or more). Would that be appreciated? If yes, how to
>> get my contribution into that page?
>
> If you understand German or are able to translate, here are some
> interesting hints from experience:
> https://wiki.ubuntuusers.de/Screencasts/#FFmpeg

My German is not very good, but I can always try. ;-)

It would be nice to have the possibility to give something back. :-D

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Change only video

2023-10-16 Thread Cecil Westerhof via ffmpeg-user
I have started with creating YouTube videos. A lot to learn. I want to
use ffmpeg to help me and it does. :-D
But there are a lot of things I do not know at the moment.
For example: if I have a video where I want to change for a short
while only the video, but not the audio.
Say I have a video A of five minutes B of 3 seconds and C of 5
seconds.
At 2:12 I want to use the video of video B instead of video A, but
keep the sound of video A.
And at 3:41 I want to do the same thing with video C.
How would I do that?

And what if I want to switch the video and merge the audio?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] How to extend this page about screen recording

2023-10-16 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 12.10.2023 um 11:51 schrieb Cecil Westerhof via ffmpeg-user:
>> I just found this:
>>  https://trac.ffmpeg.org/wiki/Capture/Desktop
>>
>> Very interesting indeed.
>>
>> I have two monitors. I could write something about how to use this
>> with two monitors (or more). Would that be appreciated? If yes, how to
>> get my contribution into that page?
>
> Afer you have registered, you can edit the wiki page. At the bottom of
> the page is a "Edit this page" button.

Thank you. I will do that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] How to extend this page about screen recording

2023-10-12 Thread Cecil Westerhof via ffmpeg-user
I just found this:
https://trac.ffmpeg.org/wiki/Capture/Desktop

Very interesting indeed.

I have two monitors. I could write something about how to use this
with two monitors (or more). Would that be appreciated? If yes, how to
get my contribution into that page?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Can transpose and between done in one command

2023-09-26 Thread Cecil Westerhof via ffmpeg-user
Moritz Barsnick  writes:

>> In principle that would lead to a little better output video I think,
>> because it is processed one time less. Or would it not make much
>> difference?
>
> Oh, yes, absolutely it would make a difference. Each (lossy) reencoding
> is a loss in quality. Also, you could save a lot of time.

I do not see a difference, but maybe I have not the sharpest eye.
Beside: if there is now not a visible difference, it will not mean
that there will never be a visible difference.

There is certainly a difference: the old way generates a video of
89.9 MB while the combined way in both cases give a video of 105.2 MB.


> As the ffmpeg-filters docs say,
>> Filters in the same linear chain are separated by commas, [...]
>
> You're already doing this with "select,(a)setpts".
>
> I would suggest selecting first, then transposing (which saves you from
> transposing content which is later discarded), but it shouldn't matter.

I have run it the old way, then first transposing and then first
selecting. The results are (in my opinion) a bit strange.

Values are real time, user time and sys time. (User time is higher as
real time because several cores are used.)

The old way:
transpose:  2:34 6:08 0:04
select: 1:38 4:04 0:03

transpose first:1:34 4:06 0:03
select first:   1:32 4:05 0:03

At this moment there is no difference between transpose first and
select first. (But I keep the select first.)
But what I find very strange is the following:
Original transpose took 50% more time as the select. But when the
select and the transpose are combined it takes about as much time the
select on the transposed file took.
How is this possible?


By the way I do not need the transpose before selecting the parts to
be used. For mpv I added to input.conf:
r cycle_values video-rotate  90 180 270 0
R cycle_values video-rotate 270 180  90 0

and now I can rotate in mpv and do not need a rotated video anymore.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Can transpose and between done in one command

2023-09-26 Thread Cecil Westerhof via ffmpeg-user
Moritz Barsnick  writes:

> Hi Cecil,
>
>> In principle that would lead to a little better output video I think,
>> because it is processed one time less. Or would it not make much
>> difference?
>
> Oh, yes, absolutely it would make a difference. Each (lossy) reencoding
> is a loss in quality. Also, you could save a lot of time.

OK, I was not kidding myself. :-D

Saving time probably not in my case. Before I define the times by
looking at the video, I have to transpose it already.


> As the ffmpeg-filters docs say,
>> Filters in the same linear chain are separated by commas, [...]
>
> You're already doing this with "select,(a)setpts".

That is the problem with copying from the internet: you (or better
said I) do not really know what you are (I am) doing. :'-(


> I would suggest selecting first, then transposing (which saves you from
> transposing content which is later discarded), but it shouldn't matter.

I will try to do both. Just to satisfy my curiosity. ;-)


> I'm just not sure whether the t's in your select filter need to be
> adapted, because you changed the video timestamps in the original
> "first" step.

That is the problem with the copy paste. Most of my videos I had to
cut several parts out of the video. But the last one was taken in one
go so I only needed to transpose and take a part from it.
There was an exit after the first ffmpeg and the output file was
outputVideo instead of inputVideoTurned.

Sloppy of me. %-{


>> -vf "transpose=cclock"  \
>
>> -vf "
>>  select='between(t,   0.7,  13.0) +
>>  between(t,  26.0,  67.0) +
>>  between(t,  82.0,  87.2)',
>>   setpts=N/FRAME_RATE/TB
>> "   \
>> -af "
>> aselect='between(t,   0.7,  13.0) +
>>  between(t,  26.0,  67.0) +
>>  between(t,  82.0,  87.2)',
>>  asetpts=N/SR/TB
>> "   \
>
>
> So ultimately, your filters would be:
>
> -vf "
>  select='between(t,   0.7,  13.0) +
>  between(t,  26.0,  67.0) +
>  between(t,  82.0,  87.2)',
>  setpts=N/FRAME_RATE/TB,
>  transpose=cclock
> "   \
> -af "
> aselect='between(t,   0.7,  13.0) +
>  between(t,  26.0,  67.0) +
>  between(t,  82.0,  87.2)',
>  asetpts=N/SR/TB
> "

Thank you. I am going to try it out.


> I'm not sure how you manage to collect content from 82.0 to 87.2 in a
> 59 second long video, but I may be missing something. ;-)

My stupidity. It was parts of two different scripts. I have to polish
my workflow, but at the moment I copy the script and change it. I have
to make it data driven.


By the way in my long way to get here it seamed that the
inputVideoTurned was best to be a .ts file. The inputVideo is a .mts
file. First I used .mkv instead of .ts. Could that really have been a
problem, or was I led astray?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Can transpose and between done in one command

2023-09-26 Thread Cecil Westerhof via ffmpeg-user
At the moment I have:
time nice -n 10 ionice -c3  \
ffmpeg -y   \
-ss  1.5\
-to 60.8\
-i "${inputVideo}"  \
-acodec copy\
-vcodec libx264 \
-preset veryfast\
-crf 26 \
-vf "transpose=cclock"  \
"${inputVideoTurned}"

time nice -n 10 ionice -c3  \
ffmpeg -threads 2 -y\
-i "${inputVideoTurned}"\
-acodec aac \
-vcodec libx264 \
-preset veryfast\
-crf 26 \
-vf "
 select='between(t,   0.7,  13.0) +
 between(t,  26.0,  67.0) +
 between(t,  82.0,  87.2)',
  setpts=N/FRAME_RATE/TB
"   \
-af "
aselect='between(t,   0.7,  13.0) +
 between(t,  26.0,  67.0) +
 between(t,  82.0,  87.2)',
 asetpts=N/SR/TB
"   \
"${outputVideo}"

Would it be possible to get the transpose merged into the between
statement? In principle that would lead to a little better output
video I think, because it is processed one time less. Or would it not
make much difference?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Drawtext problem

2022-12-09 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> With the drawtext filter I wanted to use:
> text = '13:30 tot 17:30/18:00':
>
> But this gives:
> Both text and text file provided. Please provide only one
>
> Strangely enough this does not give an error:
> text = '13:30 tot 17:30/18':
>
> I solved it by using:
> text   = '13:30 tot 17:30/18\:00':

No, I did not solve it. I just did not get an error message anymore.
This displayed:
30/18:00

I needed to escape all : like this:
 text   = '13\:30 tot 17\:30/18\:00':


> But I do not understand why the first two do not have to be escaped
> and the third does.
>
> I use ffmpeg in a bash script.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Drawtext problem

2022-12-09 Thread Cecil Westerhof via ffmpeg-user
With the drawtext filter I wanted to use:
text = '13:30 tot 17:30/18:00':

But this gives:
Both text and text file provided. Please provide only one

Strangely enough this does not give an error:
text = '13:30 tot 17:30/18':

I solved it by using:
text   = '13:30 tot 17:30/18\:00':

But I do not understand why the first two do not have to be escaped
and the third does.

I use ffmpeg in a bash script.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Change fps from 50 to 25

2022-11-14 Thread Cecil Westerhof via ffmpeg-user
Carl Eugen Hoyos  writes:

> Am Sa., 12. Nov. 2022 um 13:57 Uhr schrieb Cecil Westerhof via
> ffmpeg-user :
>>
>> Michael Koch  writes:
>>
>> > Am 12.11.2022 um 12:39 schrieb Cecil Westerhof via ffmpeg-user:
>> >> I have a few videos that have a 50 fps. But the computer I am playing
>> >> them on cannot handle that properly. Can I use ffmpeg to change the
>> >> fps to 25? While still having the same length.
>> >>
>> >
>> > sure, that's easy:
>> > ffmpeg -i in.mp4 -r 25 out.mp4
>>
>> That really is easy. :-D
>>
>> I should add a '-preset veryfast'. That makes it go about three times
>> as fast (on my system).
>>
>> But that still takes a lot of time. Maybe I ask something stupid, but
>> would it be possible to drop every other frame and copy the rest?
>
> Unfortunately not if your input is h264, that is technically not possible.

That will be the case with most of them. :'-(

But it is mostly a problem with videos I download from YouTube. To
circumvent this problem I can just use:
bestvideo[fps<=30]

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Change fps from 50 to 25

2022-11-12 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 12.11.2022 um 12:39 schrieb Cecil Westerhof via ffmpeg-user:
>> I have a few videos that have a 50 fps. But the computer I am playing
>> them on cannot handle that properly. Can I use ffmpeg to change the
>> fps to 25? While still having the same length.
>>
>
> sure, that's easy:
> ffmpeg -i in.mp4 -r 25 out.mp4

That really is easy. :-D

I should add a '-preset veryfast'. That makes it go about three times
as fast (on my system).

But that still takes a lot of time. Maybe I ask something stupid, but
would it be possible to drop every other frame and copy the rest?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Change fps from 50 to 25

2022-11-12 Thread Cecil Westerhof via ffmpeg-user
I have a few videos that have a 50 fps. But the computer I am playing
them on cannot handle that properly. Can I use ffmpeg to change the
fps to 25? While still having the same length.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] How to concat two videos with same size but different source?

2022-10-22 Thread Cecil Westerhof via ffmpeg-user
Rohit Gupta via ffmpeg-user  writes:

> Thanks for the reply but i want to concat video and apply xfades between
> them.

A while back I have had a lot of trouble with multiple xfades. If I
remember well I could not do more as about 12 xfades in one run and I
needed 26. After a lot of experimenting I wrote a bash script that I
use to do this for me with reasonable results.
If interested I could share it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Combining xfade and drawtext

2022-09-12 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> I am using xfade and drawtext without problems. But now I want to use
> both. But combining the two goes wrong.
>
> I use:
> ffmpeg -ss 308 -t 4 -i 00011-00016.MTS -ss 329 -to 374 -i 00011-00016.MTS 
> -pix_fmt yuv420p -vcodec libx264 -crf 26 -acodec libmp3lame -qscale:a 9 
> -preset veryfast -filter_complex 
> 'xfade=transition=hlslice:duration=4:offset=0;acrossfade=d=4,drawtext=
> box= 1: boxborderw = 
> 6: boxcolor   = black@0.2: fontcolor  
> = white@0.4: fontfile   = FreeSerifBold.ttf: fontsize 
>   = 32:text   = © 2022 Cecil Westerhof - 
> ce...@decebal.nl: x  = ((main_w - text_w) / 2):   y   
>= main_h - (text_h * 2)' xfadeMusicalTestTemp/accordeonmuziek.ts

I should have thought a little longer. :'-(

Found something that works:
ffmpeg -ss 308 -t 4 -i 00011-00016.MTS -ss 329 -to 374 -i 00011-00016.MTS 
-pix_fmt yuv420p -vcodec libx264 -crf 26 -acodec libmp3lame -qscale:a 9 -preset 
veryfast -filter_complex '
[0:v][1:v] xfade=transition=hlslice:
 duration=4:
 offset=0   
[v01];
[0:a][1:a] acrossfade=d=4   
[a01];
[v01]  drawtext=
   box= 1:
   boxborderw = 6:
   boxcolor   = black@0.2:
   fontcolor  = white@0.4:
   fontfile   = FreeSerifBold.ttf:
   fontsize   = 32:
   text   = © 2022 Cecil Westerhof - ce...@decebal.nl:
   x  = ((main_w - text_w) / 2):
   y  = main_h - (text_h * 2)   
[v02]
 ' -map '[v02]' -map '[a01]' xfadeMusicalTestTemp/accordeonmuziek.ts


It looks and sounds OK to me. But I do get:
[h264 @ 0x56182acb1a00] reference picture missing during reorder
[h264 @ 0x56182acb1a00] Missing reference picture, default is 2147483647
[h264 @ 0x56182aca9140] Found reference and non-reference fields in the same 
frame, which is not implemented. Update your FFmpeg version to the newest one 
from Git. If the problem still occurs, it means that your file has a feature 
which has not been implemented.
[h264 @ 0x56182aca9140] If you want to help, upload a sample of this file to 
https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. 
(ffmpeg-de...@ffmpeg.org)
[h264 @ 0x56182aca9140] decode_slice_header error
[h264 @ 0x56182add8340] reference picture missing during reorder
[h264 @ 0x56182add8340] Missing reference picture, default is 2147483647
[h264 @ 0x56182acb1a00] reference picture missing during reorder
[h264 @ 0x56182acb1a00] Missing reference picture, default is 2147483647
[h264 @ 0x56182aca9140] mmco: unref short failure
[h264 @ 0x56182ae6a4c0] mmco: unref short failure
[h264 @ 0x56182b03f880] reference picture missing during reorder
[h264 @ 0x56182b03f880] Missing reference picture, default is 2147483647
[h264 @ 0x56182b031280] Found reference and non-reference fields in the same 
frame, which is not implemented. Update your FFmpeg version to the newest one 
from Git. If the problem still occurs, it means that your file has a feature 
which has not been implemented.
[h264 @ 0x56182b031280] If you want to help, upload a sample of this file to 
https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. 
(ffmpeg-de...@ffmpeg.org)
[h264 @ 0x56182b031280] decode_slice_header error
[h264 @ 0x56182aca4080] reference picture missing during reorder
[h264 @ 0x56182aca4080] Missing reference picture, default is 2147483647
[h264 @ 0x56182b6ba1c0] reference picture missing during reorder
[h264 @ 0x56182b6ba1c0] Missing reference picture, default is 2147483647
[h264 @ 0x56182b031280] mmco: unref short failure
[h264 @ 0x56182b03f880] mmco: unref short failure


Is this something to worry about?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Combining xfade and drawtext

2022-09-12 Thread Cecil Westerhof via ffmpeg-user
I am using xfade and drawtext without problems. But now I want to use
both. But combining the two goes wrong.

I use:
ffmpeg -ss 308 -t 4 -i 00011-00016.MTS -ss 329 -to 374 -i 00011-00016.MTS 
-pix_fmt yuv420p -vcodec libx264 -crf 26 -acodec libmp3lame -qscale:a 9 -preset 
veryfast -filter_complex 
'xfade=transition=hlslice:duration=4:offset=0;acrossfade=d=4,drawtext=  
  box= 1: boxborderw = 6:   
  boxcolor   = black@0.2: fontcolor  = 
white@0.4: fontfile   = FreeSerifBold.ttf: fontsize   = 
32:text   = © 2022 Cecil Westerhof - 
ce...@decebal.nl: x  = ((main_w - text_w) / 2):   y 
 = main_h - (text_h * 2)' xfadeMusicalTestTemp/accordeonmuziek.ts

But this gives:
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened 
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu 
--arch=amd64 --enable-gpl --disable-stripping --enable-avresample 
--disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom 
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca 
--enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite 
--enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme 
--enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa 
--enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse 
--enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine 
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt 
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab 
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp 
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq 
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl 
--enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx 
--enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint 
--enable-frei0r --enable-libx264 --enable-shared
  libavutil  56. 51.100 / 56. 51.100
  libavcodec 58. 91.100 / 58. 91.100
  libavformat58. 45.100 / 58. 45.100
  libavdevice58. 10.100 / 58. 10.100
  libavfilter 7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale  5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc55.  7.100 / 55.  7.100
Input #0, mpegts, from '00011-00016.MTS':
  Duration: 01:31:13.52, start: 1.44, bitrate: 16005 kb/s
  Program 1 
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 
tbc
Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 
fltp, 256 kb/s
Input #1, mpegts, from '00011-00016.MTS':
  Duration: 01:31:13.52, start: 1.44, bitrate: 16005 kb/s
  Program 1 
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #1:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 
tbc
Stream #1:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 
fltp, 256 kb/s
[Parsed_drawtext_2 @ 0x56143c223540] Using 
"/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"
[Parsed_acrossfade_1 @ 0x56143c5f9880] Media type mismatch between the 
'Parsed_acrossfade_1' filter output pad 0 (audio) and the 'Parsed_drawtext_2' 
filter input pad 0 (video)
[AVFilterGraph @ 0x56143c54a500] Cannot create the link acrossfade:0 -> 
drawtext:0
Error initializing complex filters.
Invalid argument
Command exited with non-zero status 1


What am I doing wrong?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] -threads 1 seems not work

2022-09-12 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On 9/12/22, Cecil Westerhof via ffmpeg-user  wrote:
>> Paul B Mahol  writes:
>>
>>> On 9/12/22, Cecil Westerhof via ffmpeg-user 
>>> wrote:
>>>> For a certain conversion I use '-threads 1'. As I understand it ffmpeg
>>>> should then only use one CPU. I see that the CPU usage is lower as
>>>> without this parameter, but it goes up to 180%. So clearly it is using
>>>> at least two CPU's.
>>>> Or am I understanding this parameter wrongly?
>>>>
>>>> I am using ffmpeg version 4.3.4-0+deb11u1. (Debian always lags a
>>>> little bit behind to be more stable.)
>>>>
>>>
>>> threads can be used for input decoding, output encoding and filtering.
>>>
>>> You need to use threads = 1 for all 3 of them.
>>
>> I see:
>> -filter_threads
>> -filter_complex_threads
>>
>> But nothing for input decoding and output decoding.
>>
>>
>> By the way: does this mean that ffmpeg can always use 4 CPU's?
>> (input, output, filtering and complex filtering)
>
> No, ffmpeg may use sometimes only 1 or sometimes all available CPUs.
> That depends on many factors.

OK. But that  still means it can use  three CPU's if it wants  to if I
have set all three to one?

> -threads is both input and output option.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] -threads 1 seems not work

2022-09-12 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On 9/12/22, Cecil Westerhof via ffmpeg-user  wrote:
>> For a certain conversion I use '-threads 1'. As I understand it ffmpeg
>> should then only use one CPU. I see that the CPU usage is lower as
>> without this parameter, but it goes up to 180%. So clearly it is using
>> at least two CPU's.
>> Or am I understanding this parameter wrongly?
>>
>> I am using ffmpeg version 4.3.4-0+deb11u1. (Debian always lags a
>> little bit behind to be more stable.)
>>
>
> threads can be used for input decoding, output encoding and filtering.
>
> You need to use threads = 1 for all 3 of them.

I see:
-filter_threads
-filter_complex_threads

But nothing for input decoding and output decoding.


By the way: does this mean that ffmpeg can always use 4 CPU's?
(input, output, filtering and complex filtering)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] -threads 1 seems not work

2022-09-12 Thread Cecil Westerhof via ffmpeg-user
For a certain conversion I use '-threads 1'. As I understand it ffmpeg
should then only use one CPU. I see that the CPU usage is lower as
without this parameter, but it goes up to 180%. So clearly it is using
at least two CPU's.
Or am I understanding this parameter wrongly?

I am using ffmpeg version 4.3.4-0+deb11u1. (Debian always lags a
little bit behind to be more stable.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] What am I doing wrong with xfade

2022-09-10 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Paul B Mahol  writes:
>
>> On 9/10/22, Cecil Westerhof via ffmpeg-user  wrote:
>>> I have to concatenate about 30 videos together with xfade. Because I
>>> did not mange to find a way to do that in one command I wrote a script
>>> that does 1 and 2 to 1-2, 3 and 4 to 3-4, 4 and 5 to 5-6, …
>>> Then 1-2 and 3-4 to 1-4, 5-6 and 7-8 to 5-8, …
>>> Etcetera.
>>>
>>> But it seems that in every iteration the audio goes out of sync with
>>> about one second.
>>>
>>> Example of one of the commands:
>>> nice -n 10 ionice -c3 time ffmpeg -y \
>>>   -i snellerDanDeWind.mkv\
>>>   -i deFinale.mkv\
>>>   -vcodec libx264\
>>>   -crf 26\
>>>   -acodec libmp3lame \
>>>   -qscale:a 9\
>>>   -preset veryfast   \
>>>   -filter_complex
>>> 'xfade=transition=slidedown:duration=4:offset=126.083000;acrossfade=d=4'
>>> \
>>
>> Offset should be first video duration minus xfade duration.
>> Assuming that audio is not longer than video.
>
>>>   DURATION: 00:02:10.08300
>
> But that is the case.
> 02:10.08300 -> 130.083
> 130.083 - 4 = 126.083
>
> Audio and video off the first file are the same.
> Strangely the video of the second file is 0.44 seconds longer as the
> audio. But that should not be a problem?

Strangely enough I see that in several of the videos the length of the
video and audio is not the same. But they where all cut with ffmpeg
out of a bigger one with something like:
ffmpeg -y  \
  -ss $1 -to $2\
  -i ${input}  \
  -pix_fmt yuv420p \
  -vcodec libx264  \
  -crf 26  \
  -preset veryfast \
  $3.mkv

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] What am I doing wrong with xfade

2022-09-10 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On 9/10/22, Cecil Westerhof via ffmpeg-user  wrote:
>> I have to concatenate about 30 videos together with xfade. Because I
>> did not mange to find a way to do that in one command I wrote a script
>> that does 1 and 2 to 1-2, 3 and 4 to 3-4, 4 and 5 to 5-6, …
>> Then 1-2 and 3-4 to 1-4, 5-6 and 7-8 to 5-8, …
>> Etcetera.
>>
>> But it seems that in every iteration the audio goes out of sync with
>> about one second.
>>
>> Example of one of the commands:
>> nice -n 10 ionice -c3 time ffmpeg -y \
>>   -i snellerDanDeWind.mkv\
>>   -i deFinale.mkv\
>>   -vcodec libx264\
>>   -crf 26\
>>   -acodec libmp3lame \
>>   -qscale:a 9\
>>   -preset veryfast   \
>>   -filter_complex
>> 'xfade=transition=slidedown:duration=4:offset=126.083000;acrossfade=d=4'
>> \
>
> Offset should be first video duration minus xfade duration.
> Assuming that audio is not longer than video.

>>   DURATION: 00:02:10.08300

But that is the case.
02:10.08300 -> 130.083
130.083 - 4 = 126.083

Audio and video off the first file are the same.
Strangely the video of the second file is 0.44 seconds longer as the
audio. But that should not be a problem?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] What am I doing wrong with xfade

2022-09-10 Thread Cecil Westerhof via ffmpeg-user
I have to concatenate about 30 videos together with xfade. Because I
did not mange to find a way to do that in one command I wrote a script
that does 1 and 2 to 1-2, 3 and 4 to 3-4, 4 and 5 to 5-6, …
Then 1-2 and 3-4 to 1-4, 5-6 and 7-8 to 5-8, …
Etcetera.

But it seems that in every iteration the audio goes out of sync with
about one second.

Example of one of the commands:
nice -n 10 ionice -c3 time ffmpeg -y \
  -i snellerDanDeWind.mkv\
  -i deFinale.mkv\
  -vcodec libx264\
  -crf 26\
  -acodec libmp3lame \
  -qscale:a 9\
  -preset veryfast   \
  -filter_complex
'xfade=transition=slidedown:duration=4:offset=126.083000;acrossfade=d=4' \
snellerDanDeWind-deFinale.mkv

What am I doing wrong?

The first part of the log for this command:
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu 
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl 
--disable-stripping --enable-avresample --disable-filter=resample 
--enable-gnutls --enable-ladspa --enable-libaom --enable-libass 
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio 
--enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig 
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm 
--enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg 
--enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq 
--enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy 
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh 
--enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis 
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 
--enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 
--enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm 
--enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 
--enable-shared
  libavutil  56. 51.100 / 56. 51.100
  libavcodec 58. 91.100 / 58. 91.100
  libavformat58. 45.100 / 58. 45.100
  libavdevice58. 10.100 / 58. 10.100
  libavfilter 7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale  5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'snellerDanDeWind.mkv':
  Metadata:
ENCODER : Lavf58.45.100
  Duration: 00:02:10.08, start: 0.00, bitrate: 4829 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 
1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
  ENCODER : Lavc58.91.100 libx264
  DURATION: 00:02:10.08300
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
  ENCODER : Lavc58.91.100 libvorbis
  DURATION: 00:02:10.00300
Input #1, matroska,webm, from 'deFinale.mkv':
  Metadata:
ENCODER : Lavf58.45.100
  Duration: 00:12:10.44, start: 0.00, bitrate: 3210 kb/s
Stream #1:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 
1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
  ENCODER : Lavc58.91.100 libx264
  DURATION: 00:12:10.44300
Stream #1:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
  ENCODER : Lavc58.91.100 libvorbis
  DURATION: 00:12:10.00300
Stream mapping:
  Stream #0:0 (h264) -> xfade:main
  Stream #0:1 (vorbis) -> acrossfade:crossfade0
  Stream #1:0 (h264) -> xfade:xfade
  Stream #1:1 (vorbis) -> acrossfade:crossfade1
  xfade -> Stream #0:0 (libx264)
  acrossfade -> Stream #0:1 (libmp3lame)
Press [q] to stop, [?] for help
[libx264 @ 0x55f112f35200] using SAR=1/1
[libx264 @ 0x55f112f35200] using cpu capabilities: MMX2 SSE2Fast SSSE3 
SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x55f112f35200] profile High 4:4:4 Predictive, level 4.0, 4:4:4, 
8-bit
[libx264 @ 0x55f112f35200] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: 
cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 
deadzone=21,11 fast_pskip=1 chroma_qp_offset=6 threads=6 lookahead_threads=2 
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 

Re: [FFmpeg-user] Remove chapters when cutting a part out of a video

2022-09-07 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Cecil Westerhof via ffmpeg-user  writes:
>
>> I need to cut a part out of a video. This video contains chapters and
>> I want to remove this data. I try this with:
>> ffmpeg -y   \
>>-ss ${startTime} -to ${endTime}  \
>>-i ${inputFile}  \
>>-map_metadata -1 \
>>-fflags +bitexact\
>>-acodec copy -vcodec copy\
>>-avoid_negative_ts 1 \
>>${outputFile}
>>
>> But this only removes the name of the chapters. They all become
>> unnamed. And the chapters are not even part of what I cut out of the
>> video.
>> What do I need to do to get a video without chapters?
>
> Found it:
> ffmpeg -y   \
>-ss ${startTime} -to ${endTime}  \
>-i ${inputFile}  \
>-map_metadata -1 \
>-map_chapters -1 \
>-acodec copy -vcodec copy\
>-avoid_negative_ts 1 \
>${outputFile}

The following is a little bit better:
ffmpeg -y   \
   -ss ${startTime} \
   -to ${endTime}   \
   -i ${inputFile}  \
   -map_metadata -1 \
   -map_chapters -1 \
   -metadata title="${title}"   \
   -acodec copy \
   -vcodec libx264 -crf 26  \
   -pix_fmt yuv420p \
   -preset veryfast \
   ${outputFile}

Some people could not play it and I also wanted to add a title.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Remove chapters when cutting a part out of a video

2022-09-05 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> I need to cut a part out of a video. This video contains chapters and
> I want to remove this data. I try this with:
> ffmpeg -y   \
>-ss ${startTime} -to ${endTime}  \
>-i ${inputFile}  \
>-map_metadata -1 \
>-fflags +bitexact\
>-acodec copy -vcodec copy\
>-avoid_negative_ts 1 \
>${outputFile}
>
> But this only removes the name of the chapters. They all become
> unnamed. And the chapters are not even part of what I cut out of the
> video.
> What do I need to do to get a video without chapters?

Found it:
ffmpeg -y   \
   -ss ${startTime} -to ${endTime}  \
   -i ${inputFile}  \
   -map_metadata -1 \
   -map_chapters -1 \
   -acodec copy -vcodec copy\
   -avoid_negative_ts 1 \
   ${outputFile}

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Remove chapters when cutting a part out of a video

2022-09-05 Thread Cecil Westerhof via ffmpeg-user
I need to cut a part out of a video. This video contains chapters and
I want to remove this data. I try this with:
ffmpeg -y   \
   -ss ${startTime} -to ${endTime}  \
   -i ${inputFile}  \
   -map_metadata -1 \
   -fflags +bitexact\
   -acodec copy -vcodec copy\
   -avoid_negative_ts 1 \
   ${outputFile}

But this only removes the name of the chapters. They all become
unnamed. And the chapters are not even part of what I cut out of the
video.
What do I need to do to get a video without chapters?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Information needed

2022-07-06 Thread Cecil Westerhof via ffmpeg-user
Okolie Raymond  writes:

> I have an old installation of ffmpeg installed over two years ago on an
> ubuntu server and would like to know if and how I can update / upgrade the
> installation and keep the settings that exist already . here are some of

Become root and run:
apt update
apt upgrade

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple xfade in one run

2022-07-04 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Mon, Jul 4, 2022 at 11:30 PM Michael Koch 
> wrote:
>
>> Am 04.07.2022 um 18:46 schrieb Cecil Westerhof via ffmpeg-user:
>> > Paul B Mahol  writes:
>> >
>> >> On Mon, Jul 4, 2022 at 6:15 PM Cecil Westerhof via ffmpeg-user <
>> >> ffmpeg-user@ffmpeg.org> wrote:
>> >>
>> >>> Some time ago I was experimenting with xfade. I wanted to know how to
>> >>> use several in one run. Now I really needed it, so I did some digging
>> >>> and found this:
>> >>>   ffmpeg -y  \
>> >>>-i input0.mkv \
>> >>>-i input1.mkv \
>> >>>-i input2.mkv \
>> >>>-i input3.mkv \
>> >>>-i input4.mkv \
>> >>>-i input5.mkv \
>> >>>-i input6.mkv \
>> >>>-i input7.mkv \
>> >>>-i input8.mkv \
>> >>>-i input9.mkv \
>> >>>-vcodec libx264   \
>> >>>-crf26\
>> >>>-preset veryfast  \
>> >>>-filter_complex "
>> >>>  [0:a][1:a] acrossfade=d=4[a1];
>> >>>  [0:v][1:v] xfade=transition=hlslice:
>> >>>duration=4:
>> >>>offset=308[v1];
>> >>>
>> >>>  [a1][2:a] acrossfade=d=4[a2];
>> >>>  [v1][2:v] xfade=transition=vertopen:
>> >>>duration=4:
>> >>>offset=357[v2];
>> >>>
>> >>>  [a2][3:a] acrossfade=d=4[a3];
>> >>>  [v2][3:v] xfade=transition=circlecrop:
>> >>>duration=4:
>> >>>offset=533[v3];
>> >>>
>> >>>  [a3][4:a] acrossfade=d=4[a4];
>> >>>  [v3][4:v] xfade=transition=rectcrop:
>> >>>duration=4:
>> >>>offset=1016[v4];
>> >>>
>> >>>  [a4][5:a] acrossfade=d=4[a5];
>> >>>  [v4][5:v] xfade=transition=slideup:
>> >>>duration=4:
>> >>>offset=1158[v5];
>> >>>
>> >>>  [a5][6:a] acrossfade=d=4[a6];
>> >>>  [v5][6:v] xfade=transition=wiperight:
>> >>>duration=4:
>> >>>offset=1473[v6];
>> >>>
>> >>>  [a6][7:a] acrossfade=d=4[a7];
>> >>>  [v6][7:v] xfade=transition=horzclose:
>> >>>duration=4:
>> >>>offset=1661[v7];
>> >>>
>> >>>  [a7][8:a] acrossfade=d=4[a8];
>> >>>  [v7][8:v] xfade=transition=diagbl:
>> >>>duration=4:
>> >>>offset=2082[v8];
>> >>>
>> >>>  [a8][9:a] acrossfade=d=4[a9];
>> >>>  [v8][9:v] xfade=transition=slideright:
>> >>>duration=4:
>> >>>offset=2211[v9]
>> >>>" \
>> >>>-map '[v9]' -map '[a9]'   \
>> >>>output.mkv
>> >>>
>> >>> I hope there are better ways, because there are some problems with it.
>> >>> For example it needs a lot of memory. (24 GB)
>> >>>
>> >> Could use (a)movie filters and only use such filter when actually
>> needed in
>> >> graph.
>> > I am concerning ffmpeg still a newbie. What do you mean by this?
>> >
>>
>> I also didn't understand it.
>>
>
> Before each new input to xfade use movie filter to set input file.
> Similar for audio.

I will try to figure that out.


> Your current solution is problematic because it starts decoding everything
> from start and that used lots of memory
> to keep timestamps in sync when they are not really needed.

That was what I was thinking that happened, but this was the only
solution I found,

Probably it is also not good for the quality of the video: decoding
multiple times.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple xfade in one run

2022-07-04 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Mon, Jul 4, 2022 at 6:15 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> wrote:
>
>> Some time ago I was experimenting with xfade. I wanted to know how to
>> use several in one run. Now I really needed it, so I did some digging
>> and found this:
>>  ffmpeg -y  \
>>   -i input0.mkv \
>>   -i input1.mkv \
>>   -i input2.mkv \
>>   -i input3.mkv \
>>   -i input4.mkv \
>>   -i input5.mkv \
>>   -i input6.mkv \
>>   -i input7.mkv \
>>   -i input8.mkv \
>>   -i input9.mkv \
>>   -vcodec libx264   \
>>   -crf26\
>>   -preset veryfast  \
>>   -filter_complex "
>> [0:a][1:a] acrossfade=d=4[a1];
>> [0:v][1:v] xfade=transition=hlslice:
>>   duration=4:
>>   offset=308[v1];
>>
>> [a1][2:a] acrossfade=d=4[a2];
>> [v1][2:v] xfade=transition=vertopen:
>>   duration=4:
>>   offset=357[v2];
>>
>> [a2][3:a] acrossfade=d=4[a3];
>> [v2][3:v] xfade=transition=circlecrop:
>>   duration=4:
>>   offset=533[v3];
>>
>> [a3][4:a] acrossfade=d=4[a4];
>> [v3][4:v] xfade=transition=rectcrop:
>>   duration=4:
>>   offset=1016[v4];
>>
>> [a4][5:a] acrossfade=d=4[a5];
>> [v4][5:v] xfade=transition=slideup:
>>   duration=4:
>>   offset=1158[v5];
>>
>> [a5][6:a] acrossfade=d=4[a6];
>> [v5][6:v] xfade=transition=wiperight:
>>   duration=4:
>>   offset=1473[v6];
>>
>> [a6][7:a] acrossfade=d=4[a7];
>> [v6][7:v] xfade=transition=horzclose:
>>   duration=4:
>>   offset=1661[v7];
>>
>> [a7][8:a] acrossfade=d=4[a8];
>> [v7][8:v] xfade=transition=diagbl:
>>   duration=4:
>>   offset=2082[v8];
>>
>> [a8][9:a] acrossfade=d=4[a9];
>> [v8][9:v] xfade=transition=slideright:
>>   duration=4:
>>   offset=2211[v9]
>>   " \
>>   -map '[v9]' -map '[a9]'   \
>>   output.mkv
>>
>> I hope there are better ways, because there are some problems with it.
>> For example it needs a lot of memory. (24 GB)
>>
>
> Could use (a)movie filters and only use such filter when actually needed in
> graph.

I am concerning ffmpeg still a newbie. What do you mean by this?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Multiple xfade in one run

2022-07-04 Thread Cecil Westerhof via ffmpeg-user
Some time ago I was experimenting with xfade. I wanted to know how to
use several in one run. Now I really needed it, so I did some digging
and found this:
 ffmpeg -y  \
  -i input0.mkv \
  -i input1.mkv \
  -i input2.mkv \
  -i input3.mkv \
  -i input4.mkv \
  -i input5.mkv \
  -i input6.mkv \
  -i input7.mkv \
  -i input8.mkv \
  -i input9.mkv \
  -vcodec libx264   \
  -crf26\
  -preset veryfast  \
  -filter_complex "
[0:a][1:a] acrossfade=d=4[a1];
[0:v][1:v] xfade=transition=hlslice:
  duration=4:
  offset=308[v1];

[a1][2:a] acrossfade=d=4[a2];
[v1][2:v] xfade=transition=vertopen:
  duration=4:
  offset=357[v2];

[a2][3:a] acrossfade=d=4[a3];
[v2][3:v] xfade=transition=circlecrop:
  duration=4:
  offset=533[v3];

[a3][4:a] acrossfade=d=4[a4];
[v3][4:v] xfade=transition=rectcrop:
  duration=4:
  offset=1016[v4];

[a4][5:a] acrossfade=d=4[a5];
[v4][5:v] xfade=transition=slideup:
  duration=4:
  offset=1158[v5];

[a5][6:a] acrossfade=d=4[a6];
[v5][6:v] xfade=transition=wiperight:
  duration=4:
  offset=1473[v6];

[a6][7:a] acrossfade=d=4[a7];
[v6][7:v] xfade=transition=horzclose:
  duration=4:
  offset=1661[v7];

[a7][8:a] acrossfade=d=4[a8];
[v7][8:v] xfade=transition=diagbl:
  duration=4:
  offset=2082[v8];

[a8][9:a] acrossfade=d=4[a9];
[v8][9:v] xfade=transition=slideright:
  duration=4:
  offset=2211[v9]
  " \
  -map '[v9]' -map '[a9]'   \
  output.mkv

I hope there are better ways, because there are some problems with it.
For example it needs a lot of memory. (24 GB)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Using multiple overlays

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> To overlay a picture on a video I use at the moment:
> ffmpeg -y   \
>-ss 21:50 -to 24:30 -i input.MTS \
>-i Photos/Shrinked/input1.jpg\
>-i Photos/Shrinked/input2.jpg\
>-filter_complex "
>[0:v][1:v] overlay=10:10:enable='between(t,  5,  85)',
>   
> colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]
> "   \
> -map '[out]' -map 0:a   \
> -pix_fmt yuv420p -vcodec libx264 -crf 26\
> -preset veryfast\
> output.mp4
>
> This works great and input1.jpg is (transparently) overlaid on the
> video from 5 until 85.
> But I want to overlay input2.jpg from 85 until 155. But I cannot find
> how to do this. How can I overlay several photos (transparently) on
> the video at different time intervals?

Found it:
ffmpeg -y   \
   -ss 21:50 -to 24:30 -i 7-00010.MTS   \
   -i Photos/Shrinked/8AEsmee__Blankestijn.jpg  \
   -i Photos/Shrinked/8AEsmée_van_der_Molen.jpg \
   -filter_complex "
 [0:v] [1:v] overlay=10:10:enable='between(t,  5,  85)',
 
colorkey=0xFF\:0.01[ckout1];[0:v][ckout1]overlay[out1];
 [out1][2:v] overlay=10:10:enable='between(t, 85, 157)',
 
colorkey=0xFF\:0.01[ckout2];[0:v][ckout2]overlay[out2]
"   \
-map '[out2]' -map 0:a  \
-pix_fmt yuv420p -vcodec libx264 -crf 26\
-preset veryfast\
twee.mkv

Maybe I do not understand what is happening.
The fps is significantly lower as with the previous one. (Less as
half.)
But there is at the most one overlay active. So why does it become so
much slower?


I also want to display text with the picture, but I think I found
something for that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Using multiple overlays

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
To overlay a picture on a video I use at the moment:
ffmpeg -y   \
   -ss 21:50 -to 24:30 -i input.MTS \
   -i Photos/Shrinked/input1.jpg\
   -i Photos/Shrinked/input2.jpg\
   -filter_complex "
   [0:v][1:v] overlay=10:10:enable='between(t,  5,  85)',
  
colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]
"   \
-map '[out]' -map 0:a   \
-pix_fmt yuv420p -vcodec libx264 -crf 26\
-preset veryfast\
output.mp4

This works great and input1.jpg is (transparently) overlaid on the
video from 5 until 85.
But I want to overlay input2.jpg from 85 until 155. But I cannot find
how to do this. How can I overlay several photos (transparently) on
the video at different time intervals?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Bouke / Videotoolshed  writes:

> Pff, make it an option.

You probably would tell a homeless person that is hungry and cold:
just put on clothes and eat something.
(Without providing him anything.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
> The problem of merging the two parts is solved:
>  ffmpeg -y -ss 21:50 -to 23:20 -i input.MTS -i Photos/output.jpg  
>   \
> -filter_complex "[0:v][1:v] overlay=10:10:enable='between(t, 5, 
> 85)',   \
> 
> colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]"\
> -map '[out]'  
>   \
> -pix_fmt yuv420p -c:a:0 copy -vcodec libx264 -preset veryfast 
> -crf 26   \
> -t 30 greenScreen.mp4
>
> How can I get the audio into the output?

Found it. I just need to use:
-map 0:a

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Cecil Westerhof via ffmpeg-user  writes:
>
>> Paul B Mahol  writes:
>>
>>> On Wed, Jun 29, 2022 at 10:05 AM Bouke / Videotoolshed <
>>> bo...@videotoolshed.com> wrote:
>>>
>>>> On 29 Jun 2022, at 01:48, Cecil Westerhof via ffmpeg-user <
>>>> ffmpeg-user@ffmpeg.org> wrote:
>>>> >
>>>> >
>>>> > The background of the photo is white. Would it be possible to make
>>>> > that transparent? (So where there is white, I do not see white, but
>>>> > the video.)
>>>>
>>>> This is called Luma (or Luminance) key.
>>>>
>>>> Yes, it is possible, yes, it will be ugly unless you know what you are
>>>> doing, and IMHO, FFmpeg is not the tool for this.
>>>> (But someone recently mentioned a GUI for filters, that might help you big
>>>> time on this one.)
>>>>
>>>>
>>> Use colorkey filter, and set color as white.
>>
>> I will look it up.
>> I realise that I have a problem, because in some photos not only the
>> background is white. :'-(
>
> I tried the following:
>  ffmpeg -y -ss 21:50 -to 23:20 -i 7-00010.MTS -i Photos/output.jpg
>   \
> -filter_complex 
> '[1:v]colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]'  \
> -map '[out]'  
>   \
> -pix_fmt yuv420p -acodec copy -vcodec libx264 -preset veryfast 
> -crf 26  \
> -t 30 greenScreen.mp4
>
> It really does not look that bad. (But in this photo there is no
> white.)
> It does take some time to be generated,
>
> I have two challenges:
> - There is no audio.
> - How do I merge the two filters? (The picture should only displayed
>   for a short while.)

The problem of merging the two parts is solved:
 ffmpeg -y -ss 21:50 -to 23:20 -i input.MTS -i Photos/output.jpg
\
-filter_complex "[0:v][1:v] overlay=10:10:enable='between(t, 5, 
85)',   \

colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]"\
-map '[out]'
\
-pix_fmt yuv420p -c:a:0 copy -vcodec libx264 -preset veryfast -crf 
26   \
-t 30 greenScreen.mp4

How can I get the audio into the output?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Bouke / Videotoolshed  writes:

>> On 29 Jun 2022, at 12:54, Cecil Westerhof via ffmpeg-user 
>>  wrote:
>> 
>> Bouke / Videotoolshed  writes:
>> 
>>> No, sorry. But, hire an editor / designer to do this for you,
>>> results will be better / less pain.
>>> If you want to have it done for free, be my guest, but don’t ask my
>>> help, do not expect any half decent results.
>> 
>> I am doing it for a school (musical) , so I cannot spend money on it.
>
> What do you want me to say? What is your point?

You tell me to hire an editor/designer. I explain why that is not an
option.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Paul B Mahol  writes:
>
>> On Wed, Jun 29, 2022 at 10:05 AM Bouke / Videotoolshed <
>> bo...@videotoolshed.com> wrote:
>>
>>> On 29 Jun 2022, at 01:48, Cecil Westerhof via ffmpeg-user <
>>> ffmpeg-user@ffmpeg.org> wrote:
>>> >
>>> >
>>> > The background of the photo is white. Would it be possible to make
>>> > that transparent? (So where there is white, I do not see white, but
>>> > the video.)
>>>
>>> This is called Luma (or Luminance) key.
>>>
>>> Yes, it is possible, yes, it will be ugly unless you know what you are
>>> doing, and IMHO, FFmpeg is not the tool for this.
>>> (But someone recently mentioned a GUI for filters, that might help you big
>>> time on this one.)
>>>
>>>
>> Use colorkey filter, and set color as white.
>
> I will look it up.
> I realise that I have a problem, because in some photos not only the
> background is white. :'-(

I tried the following:
 ffmpeg -y -ss 21:50 -to 23:20 -i 7-00010.MTS -i Photos/output.jpg  
\
-filter_complex 
'[1:v]colorkey=0xFF\:0.01[ckout];[0:v][ckout]overlay[out]'  \
-map '[out]'
\
-pix_fmt yuv420p -acodec copy -vcodec libx264 -preset veryfast -crf 
26  \
-t 30 greenScreen.mp4

It really does not look that bad. (But in this photo there is no
white.)
It does take some time to be generated,

I have two challenges:
- There is no audio.
- How do I merge the two filters? (The picture should only displayed
  for a short while.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Bouke / Videotoolshed  writes:

> No, sorry. But, hire an editor / designer to do this for you,
> results will be better / less pain.
> If you want to have it done for free, be my guest, but don’t ask my
> help, do not expect any half decent results.

I am doing it for a school (musical) , so I cannot spend money on it.


But I got a bit farther. While not perfect, it certainly is not bad.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Wed, Jun 29, 2022 at 10:05 AM Bouke / Videotoolshed <
> bo...@videotoolshed.com> wrote:
>
>> On 29 Jun 2022, at 01:48, Cecil Westerhof via ffmpeg-user <
>> ffmpeg-user@ffmpeg.org> wrote:
>> >
>> >
>> > The background of the photo is white. Would it be possible to make
>> > that transparent? (So where there is white, I do not see white, but
>> > the video.)
>>
>> This is called Luma (or Luminance) key.
>>
>> Yes, it is possible, yes, it will be ugly unless you know what you are
>> doing, and IMHO, FFmpeg is not the tool for this.
>> (But someone recently mentioned a GUI for filters, that might help you big
>> time on this one.)
>>
>>
> Use colorkey filter, and set color as white.

I will look it up.
I realise that I have a problem, because in some photos not only the
background is white. :'-(

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Make white of photo transparant

2022-06-29 Thread Cecil Westerhof via ffmpeg-user
Bouke / Videotoolshed  writes:

> On 29 Jun 2022, at 01:48, Cecil Westerhof via ffmpeg-user 
>  wrote:
>> 
>> 
>> The background of the photo is white. Would it be possible to make
>> that transparent? (So where there is white, I do not see white, but
>> the video.)
>
> This is called Luma (or Luminance) key.
>
> Yes, it is possible, yes, it will be ugly unless you know what you are
> doing, and IMHO, FFmpeg is not the tool for this.

A long time ago I tried to work with GUI programs, but I found them to
bothersome. Ffmpeg was in my case easier. Maybe because I do not edit
videos often enough. ;-)


> (But someone recently mentioned a GUI for filters, that might help you big 
> time on this one.)

Do you remember the GUI?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Make white of photo transparant

2022-06-28 Thread Cecil Westerhof via ffmpeg-user
I am still experimenting with ffmpeg.
At the moment I have the folowing:
 ffmpeg -y -ss 21:50 -to 23:20 -i input.MTS -i Photos/output.jpg
\
-filter_complex "[0:v][1:v] overlay=0:-10:enable='between(t, 5, 
85)'"   \
-pix_fmt yuv420p -acodec copy -vcodec libx264 -preset veryfast -crf 
26  \
output.mp4

The background of the photo is white. Would it be possible to make
that transparent? (So where there is white, I do not see white, but
the video.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Problem with videos not playing in mobile browser

2022-06-28 Thread Cecil Westerhof via ffmpeg-user
"Dr Mark A. Garlick"  writes:

> Dear all
>
> I am new to this forum.
>
> I have noticed that some of my videos, encoded with ffmpeg and uploaded
> to my websites, do not play on mobile web browsers, but they work 
> perfectly well on desktop browsers on my Linux machine. I get either a
> message saying 'file is corrupted' or no message at all (just a blank 
> video) depending on the browser. I've tried Brave, Firefox and Chrome,
> on an iPhone, a Samsung tablet and a Samsung Galaxy s10 plus. The 'bad' 
> videos consistently fail to play on mobile devices.

Try it with:
-pix_fmt yuv420p

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Using several audios after each-other in a video

2022-06-16 Thread Cecil Westerhof via ffmpeg-user
Thanks for the very speedy reply. :-D

Michael Koch  writes:

> Am 16.06.2022 um 13:11 schrieb Cecil Westerhof via ffmpeg-user:
>> At the moment I am making a slideshow like the following:
>>  
>> zoompan=zoompan=d=3:fps=.333:s=1280x960,framerate=25:interp_start=0:interp_end=255:scene=100
>>  ffmpeg -y  \
>> -i   %03d.jpg   \
>> -i   ${audio}   \
>> -to  $to\
>> -vf  ${zoompan} \
>> -pix_fmt yuv420p\
>> ${outputFile}
>>
>> Until now I found audios that had the right length, but now I need to
>> put several audios together for the generated video.
>> I could create an audio from several audios every time.
>> A slightly better option would be a variant of:
>>  -itsoffset 10 -i audio1.mp3 -itsoffset 15 -i audio2.mp3
>>
>> But is there a way to just let the audios be put after each-other?
>
> You can use the concat filter.
> ffmpeg -i audio1.mp3 -i audio2.mp3 -lavfi [0][1]concat=n=2:v=0:a=1 out.mp3
>
> v=0 is important because the default is v=1.

That is probably better as the way I just did it:
ffmpeg -f concat -safe 0 -i audioList -c copy audio.mp3


Not that it is not doable, but in this way I need to do two things. I
was just wondering if there would be a way to use several audio
without first creating another audio.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Using several audios after each-other in a video

2022-06-16 Thread Cecil Westerhof via ffmpeg-user
At the moment I am making a slideshow like the following:

zoompan=zoompan=d=3:fps=.333:s=1280x960,framerate=25:interp_start=0:interp_end=255:scene=100
ffmpeg -y  \
   -i   %03d.jpg   \
   -i   ${audio}   \
   -to  $to\
   -vf  ${zoompan} \
   -pix_fmt yuv420p\
   ${outputFile}

Until now I found audios that had the right length, but now I need to
put several audios together for the generated video.
I could create an audio from several audios every time.
A slightly better option would be a variant of:
-itsoffset 10 -i audio1.mp3 -itsoffset 15 -i audio2.mp3

But is there a way to just let the audios be put after each-other?

This does not work:
   -i   ${audio1}  \
   -i   ${audio2}  \

I only get the first audio.


But the same happens with -itsoffset I am afraid.

I used:
ffmpeg -y -i %03d.jpg -i /home/cecil/Audio/YouTube/Habanera_by_Bizet.mp3 
-itsoffset 120 -i /home/cecil/Audio/YouTube/Wedding_Invitation.mp3 -vf 
zoompan=d=3:fps=.333:s=1280x960,framerate=25:interp_start=0:interp_end=255:scene=100
 -pix_fmt yuv420p sander2.mp4

I only here the first audio.

Output from ffmpeg:
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
 
  built with gcc 10 (Debian 10.2.1-6)   
 
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened 
--libdir=/usr/lib/x86_64-li
nux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl 
--disable-stripping --enable-avr
esample --disable-filter=resample --enable-gnutls --enable-ladspa 
--enable-libaom --enable-libass --enabl
e-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio 
--enable-libcodec2 --enable-libdav1d --ena
ble-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi 
--enable-libgme --enable-lib
gsm --enable-libjack --enable-libmp3lame --enable-libmysofa 
--enable-libopenjpeg --enable-libopenmpt --en
able-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg 
--enable-librubberband --enable-libs
hine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt 
--enable-libssh --enable-libth
eora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx 
--enable-libwavpack --ena
ble-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq 
--enable-libzvbi --enable-
lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 
--enable-pocketsphinx --en
able-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 
--enable-chromaprint --enable-frei0r 
--enable-libx264 --enable-shared
 
  libavutil  56. 51.100 / 56. 51.100
 
  libavcodec 58. 91.100 / 58. 91.100
 
  libavformat58. 45.100 / 58. 45.100
 
  libavdevice58. 10.100 / 58. 10.100
 
  libavfilter 7. 85.100 /  7. 85.100
 
  libavresample   4.  0.  0 /  4.  0.  0
 
  libswscale  5.  7.100 /  5.  7.100
 
  libswresample   3.  7.100 /  3.  7.100
 
  libpostproc55.  7.100 / 55.  7.100
 
Input #0, image2, from '%03d.jpg':  
 
  Duration: 00:00:02.20, start: 0.00, bitrate: N/A  
 
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, 
bt470bg/unknown/unknown), 1280x960 [SAR 180:180 DA
R 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc  
 
Input #1, mp3, from '/home/cecil/Audio/YouTube/Habanera_by_Bizet.mp3':  
 
  Metadata: 
 
title   : Habanera (by Bizet)   
 
genre   : Classical 
 
artist  : Bizet 
 
album   : YouTube Audio Library 
 
encoder : Lavf55.19.104 
 
  Duration: 00:02:00.03, start: 0.025057, 

Re: [FFmpeg-user] deprecated pixel format used

2022-06-15 Thread Cecil Westerhof via ffmpeg-user
Carl Zwanzig  writes:

> On 6/14/2022 4:24 PM, Cecil Westerhof via ffmpeg-user wrote:
>> What is happening here?
>
> What's happening is that you're not posting the complete command output,
> and possibly not using the most current ffmpeg.

fmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers 

  built with gcc 10 (Debian 10.2.1-6)   
   configuration: --prefix=/usr 
--extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-li
nux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl 
--disable-stripping --enable-avresample --disable-filter=resample 
--enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enabl
e-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio 
--enable-libcodec2 --enable-libdav1d --ena
ble-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi 
--enable-libgme --enable-lib
gsm --enable-libjack --enable-libmp3lame --enable-libmysofa 
--enable-libopenjpeg --enable-libopenmpt --en
able-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg 
--enable-librubberband --enable-libs
hine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt 
--enable-libssh --enable-libth
eora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx 
--enable-libwavpack --ena
ble-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq 
--enable-libzvbi --enable-
lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 
--enable-pocketsphinx --en
able-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 
--enable-chromaprint --enable-frei0r 
--enable-libx264 --enable-shared
 
  libavutil  56. 51.100 / 56. 51.100
 
  libavcodec 58. 91.100 / 58. 91.100
 
  libavformat58. 45.100 / 58. 45.100
 
  libavdevice58. 10.100 / 58. 10.100
 
  libavfilter 7. 85.100 /  7. 85.100
 
  libavresample   4.  0.  0 /  4.  0.  0
 
  libswscale  5.  7.100 /  5.  7.100
 
  libswresample   3.  7.100 /  3.  7.100
 
  libpostproc55.  7.100 / 55.  7.100
 
Input #0, image2, from '%03d.jpg':
  Duration: 00:00:01.08, start: 0.00, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, 
bt470bg/unknown/unknown), 1280x720 [SAR 180:180 DA
R 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mp3, from 
'/home/cecil/Audio/YouTube/Ride_of_the_Valkyries_by_Wagner.mp3':
  Metadata:
title   : Ride of the Valkyries (by Wagner)
genre   : Classical
artist  : Wagner
album   : YouTube Audio Library
encoder : Lavf55.19.104
  Duration: 00:05:20.03, start: 0.025057, bitrate: 128 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[image2 @ 0x55c860b3cf40] Thread message queue blocking; consider raising the 
thread_queue_size option (c
urrent value: 8)
[Parsed_framerate_1 @ 0x55c860c270c0] time base:1000/333 -> 1/8325 exact:1
[Parsed_framerate_1 @ 0x55c860c270c0] fps -> fps:25/1 scene score:100.00 
interpolate start:0 end:255
[swscaler @ 0x55c860c2fc40] deprecated pixel format used, make sure you did set 
range correctly
[swscaler @ 0x55c860cec540] deprecated pixel format used, make sure you did set 
range correctly
[libx264 @ 0x55c860b54000] using SAR=1/1
[libx264 @ 0x55c860b54000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 
AVX XOP FMA3 BMI1
[libx264 @ 0x55c860b54000] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x55c860b54000] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2020 - h
ttp://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 
analyse=0x3:0x113 me=hex subme=7 
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 
cqm=0 deadzone=21,11 fast_p
skip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 
decimate=1 interlaced=0 bl
uray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 
direct=1 weightb=1 open_gop=0 
weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 
rc=crf mbtree=1 crf=23.0 q

Re: [FFmpeg-user] Video file often not recognised

2022-06-15 Thread Cecil Westerhof via ffmpeg-user
Reindl Harald  writes:

> Am 15.06.22 um 16:25 schrieb Cecil Westerhof via ffmpeg-user:
>> Lately I am doing a lot with ffmpeg again.
>> But I have a strange problem.
>> Sometimes I send mp4 through WhatsApp.
>> Sometimes I see the thumbnail, sometimes I do not.
>> Today WhatsApp thinks my mp4 is not a video.
>> So I send it as an ordinary file.
>> On some places it can be played fine.
>> On another it plays only audio.
>> And another it cannot be played.
>> What can be happening here?
>> And could I do something about it by changing the parameters I use for
>> ffmpeg?
>
> god knows when you don't find it logical to post said parameters -
> crystal balls are out of order

The strange thing is that sometimes it worked and sometimes it did
not. With a multiple of scripts. And I thought it could be a generic
problem. (And I think it was.)

One example is:
 
zoompan=zoompan=d=4:fps=.333:s=852x640,framerate=25:interp_start=0:interp_end=255:scene=100
 ffmpeg -y  \
-i   %03d.jpg   \
-i   ${audio}   \
-to  $to\
-vf  ${zoompan} \
${outputFile}

But then I remembered something about a problem with windows. After
some searching I changed it to:
 
zoompan=zoompan=d=4:fps=.333:s=852x640,framerate=25:interp_start=0:interp_end=255:scene=100
 ffmpeg -y  \
-i   %03d.jpg   \
-i   ${audio}   \
-to  $to\
-vf  ${zoompan} \
-pix_fmt yuv420p\
${outputFile}

So I added '-pix_fmt yuv420p' and it looks like my problems are
resolved.
But I am sure I never used that before.

With this parameter my output files are 5 to 15 percent smaller.


Still strange that sometimes it worked and sometimes it did not. Just
make sure I edit all my scripts to use yuv420p,

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Video file often not recognised

2022-06-15 Thread Cecil Westerhof via ffmpeg-user
Lately I am doing a lot with ffmpeg again.
But I have a strange problem.
Sometimes I send mp4 through WhatsApp.
Sometimes I see the thumbnail, sometimes I do not.
Today WhatsApp thinks my mp4 is not a video.
So I send it as an ordinary file.
On some places it can be played fine.
On another it plays only audio.
And another it cannot be played.

What can be happening here?
And could I do something about it by changing the parameters I use for
ffmpeg?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] deprecated pixel format used

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Still playing with ffmpeg and getting nice results.

At the moment I am using the following:
ffmpeg -y -i %03d.jpg -vf 
zoompan=d=4:fps=.5:s=852x639,framerate=25:interp_start=0:interp_end=255:scene=100
 output.mp4

The video I get looks correct, but I get a lot of times the following message:
deprecated pixel format used, make sure you did set range
correctly

What is happening here?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Get the file size in advance when encoding from one another format

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Sendex Six  writes:

> I've created a simple wrapper for FFmpeg using java and use this in a
> spring boot web application, and everything works fine. But the problem is
> I have this requirement that I need to get the file size of any media
> format in advance from encoding to another format because I need to set the
> Header Content-Length.
>
> I did already search it online. Some of those are confusing, and the others
> don't make sense.
>
> Please help me do this; How do I get the file size in advance if I encode
> any media format to another format so that I can set the Header
> Content-Length in the header. What is the formula for this? I'm new to
> FFMpeg.

I think this is impossible. The best you can get is an indication.
(Which can be way of.)
For example I use a script to make videos smaller. In my experience
the new file size can be between 1/6 and 1/14 of the file size of the
input file.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Use concat filter with a fade

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 14.06.2022 um 15:33 schrieb Cecil Westerhof via ffmpeg-user:
>> Michael Koch  writes:
>>
>>> Am 14.06.2022 um 13:47 schrieb Cecil Westerhof via ffmpeg-user:
>>>> Sometimes I have to cut parts out of a video. I now use for this (bash on 
>>>> Debian):
>>>>   ffmpeg -y\
>>>>  -ss ${videoStart} -to ${cutStart} -i ${inputFile} \
>>>>  -ss ${cutEnd} -to ${videoEnd} -i ${inputFile} \
>>>>  -vcodec libx264   \
>>>>  -crf26\
>>>>  -acodec libmp3lame -qscale:a 9\
>>>>  -preset veryfast  \
>>>>  -lavfi "concat=n=2:v=1:a=1"   \
>>>>  -an ${outputFile}
>>>>
>>>> But the cut from one part to another is a bit abrupt. Is there a
>>>> possibility to smooth it with something like a fade?
>>> you can use the xfade filter. :
>>> https://www.ffmpeg.org/ffmpeg-all.html#xfade
>>> https://trac.ffmpeg.org/wiki/Xfade
>> I am now using:
>>  offset=$((${cutStart} - ${videoStart} - ${duration}))
>>  xfade=xfade=transition=slideleft:duration=${duration}:offset=${offset}
>>  time ffmpeg -y \
>>-ss ${videoStart} -to ${cutStart} -i ${inputFile}\
>>-ss ${cutEnd} -to ${videoEnd} -i ${inputFile}\
>>-vcodec libx264  \
>>-crf26   \
>>-acodec libmp3lame -qscale:a 9   \
>>-preset veryfast \
>>-filter_complex ${xfade} \
>>${outputFile}
>>
>> But I have a major and minor problem.
>> The major problem is that I do not have audio from the second part of
>> the video.
>
> Audio has its own filter: acrossfade

This seems to work:

xfade="xfade=transition=slideleft:duration=${duration}:offset=${offset};acrossfade=d=${duration}"


>> The minor problem is that I have to calculate the offset. It would be
>> nice if I could use -duration, but that does not work sadly.
>
> As far as I know this isn't yet implemented.

That sounds like it is going to be implemented. Or do I read to much
in this sentence?


>> By the way: how should I do it when I want to use five parts of the video?
>
> I haven't tested this, but I think you must build a binary tree:
> [0:v][1:v]xfade[a];[2:v][3:v]xfade[b];[a][b]xfade

OK, at the moment it is needed I have a starting point.


Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Use concat filter with a fade

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 14.06.2022 um 13:47 schrieb Cecil Westerhof via ffmpeg-user:
>> Sometimes I have to cut parts out of a video. I now use for this (bash on 
>> Debian):
>>  ffmpeg -y\
>> -ss ${videoStart} -to ${cutStart} -i ${inputFile} \
>> -ss ${cutEnd} -to ${videoEnd} -i ${inputFile} \
>> -vcodec libx264   \
>> -crf26\
>> -acodec libmp3lame -qscale:a 9\
>> -preset veryfast  \
>> -lavfi "concat=n=2:v=1:a=1"   \
>> -an ${outputFile}
>>
>> But the cut from one part to another is a bit abrupt. Is there a
>> possibility to smooth it with something like a fade?
>
> you can use the xfade filter. :
> https://www.ffmpeg.org/ffmpeg-all.html#xfade
> https://trac.ffmpeg.org/wiki/Xfade

I am now using:
offset=$((${cutStart} - ${videoStart} - ${duration}))
xfade=xfade=transition=slideleft:duration=${duration}:offset=${offset}
time ffmpeg -y \
  -ss ${videoStart} -to ${cutStart} -i ${inputFile}\
  -ss ${cutEnd} -to ${videoEnd} -i ${inputFile}\
  -vcodec libx264  \
  -crf26   \
  -acodec libmp3lame -qscale:a 9   \
  -preset veryfast \
  -filter_complex ${xfade} \
  ${outputFile}

But I have a major and minor problem.
The major problem is that I do not have audio from the second part of
the video.
The minor problem is that I have to calculate the offset. It would be
nice if I could use -duration, but that does not work sadly.


By the way: how should I do it when I want to use five parts of the video?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Use concat filter with a fade

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Sometimes I have to cut parts out of a video. I now use for this (bash on 
Debian):
ffmpeg -y\
   -ss ${videoStart} -to ${cutStart} -i ${inputFile} \
   -ss ${cutEnd} -to ${videoEnd} -i ${inputFile} \
   -vcodec libx264   \
   -crf26\
   -acodec libmp3lame -qscale:a 9\
   -preset veryfast  \
   -lavfi "concat=n=2:v=1:a=1"   \
   -an ${outputFile}

But the cut from one part to another is a bit abrupt. Is there a
possibility to smooth it with something like a fade?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-06-14 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Michael Koch  writes:
>
>> Am 31.05.2022 um 18:43 schrieb Cecil Westerhof via ffmpeg-user:
>>> Michael Koch  writes:
>>>
>>>> I have a short example in chapter 2.57 of my book:
>>>> http://www.astro-electronic.de/FFmpeg_Book.pdf
>>> Just to make sure I understand it, I should do something like:
>>>  ffmpeg -ss %S1% -t %L1% -i %I1% \
>>> -ss %S2% -t %L2% -i %I1% \
>>> -ss %S3% -t %L3% -i %I1% \
>>> -lavfi "concat=n=3:v=1:a=0"  \
>>> -an %OUT%
>>>
>>> But if I understand it well, this works on the iframes, would it not
>>> be better (but longer) to use:
>>>  ffmpeg -i %I1% -ss %S1% -t %L1% \
>>> -i %I1% -ss %S2% -t %L2% \
>>> -i %I1% -ss %S3% -t %L3% \
>>> -lavfi "concat=n=3:v=1:a=0"  \
>>> -an %OUT%
>>
>> I think that won't work. If you write the options after the input file,
>> then they are applied to the next input file, and the options in the 
>> third line are applied to the output file.
>> The concat filter does also work with audio. I just didn't need audio in
>> my example.
>
> But if you put them before the input file they are not precise, but
> work on the iframe level. This can give quit extensive differences. (I
> was bitten by that in the past.) Or is that not the case in this
> specific scenario?

That is not the case anymore.

I am using (bash on Debian):
ffmpeg -y\
   -ss ${videoStart} -to ${cutStart} -i ${inputFile} \
   -ss ${cutEnd} -to ${videoEnd} -i ${inputFile} \
   -vcodec libx264   \
   -crf26\
   -acodec libmp3lame -qscale:a 9\
   -preset veryfast  \
   -lavfi "concat=n=2:v=1:a=1"   \
   -an ${outputFile}

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] reference picture missing during reorder

2022-06-13 Thread Cecil Westerhof via ffmpeg-user
While running ffmpeg I got the following:
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened 
--libdir=/usr/lib/x86_64-li
nux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl 
--disable-stripping --enable-avr
esample --disable-filter=resample --enable-gnutls --enable-ladspa 
--enable-libaom --enable-libass --enabl
e-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio 
--enable-libcodec2 --enable-libdav1d --ena
ble-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi 
--enable-libgme --enable-lib
gsm --enable-libjack --enable-libmp3lame --enable-libmysofa 
--enable-libopenjpeg --enable-libopenmpt --en
able-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg 
--enable-librubberband --enable-libs
hine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt 
--enable-libssh --enable-libth
eora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx 
--enable-libwavpack --ena
ble-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq 
--enable-libzvbi --enable-
lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 
--enable-pocketsphinx --en
able-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 
--enable-chromaprint --enable-frei0r
--enable-libx264 --enable-shared
  libavutil  56. 51.100 / 56. 51.100
  libavcodec 58. 91.100 / 58. 91.100
  libavformat58. 45.100 / 58. 45.100
  libavdevice58. 10.100 / 58. 10.100
  libavfilter 7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale  5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc55.  7.100 / 55.  7.100
Input #0, mpegts, from 'Original/00233-00239.MTS':
  Duration: 01:25:33.44, start: 1.44, bitrate: 21922 kb/s
  Program 1
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(top first), 1920x1080 [SAR 1
:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 
fltp, 256 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (ac3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[h264 @ 0x5579d050d600] reference picture missing during reorder
[h264 @ 0x5579d050d600] Missing reference picture, default is 2147483647
[h264 @ 0x5579d0875500] Found reference and non-reference fields in the same 
frame, which is not implemen
ted. Update your FFmpeg version to the newest one from Git. If the problem 
still occurs, it means that yo
ur file has a feature which has not been implemented.
[h264 @ 0x5579d0875500] If you want to help, upload a sample of this file to 
https://streams.videolan.org
/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-de...@ffmpeg.org)
[h264 @ 0x5579d0875500] decode_slice_header error
[h264 @ 0x5579d0347240] reference picture missing during reorder
[h264 @ 0x5579d0347240] Missing reference picture, default is 2147483647
[h264 @ 0x5579d034c8c0] reference picture missing during reorder
[h264 @ 0x5579d034c8c0] Missing reference picture, default is 2147483647
[h264 @ 0x5579d0875500] mmco: unref short failure
[h264 @ 0x5579d050d600] mmco: unref short failure
[libx264 @ 0x5579d0596bc0] using SAR=1/1


The generate video looks OK.
Is this something to worry about, or not?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Better way to cut parts out of a long video?

2022-06-13 Thread Cecil Westerhof via ffmpeg-user
Rob Hallam  writes:

> On Mon, 13 Jun 2022 at 11:26, Cecil Westerhof via ffmpeg-user
>  wrote:
>> That could very seldom work, but is certainly not a general solution.
>> In the past I was told to do it like this because it was faster. Then
>> I got problems with the output and was told how iframes work.
>
> What problems, exactly? Do they still occur with modern versions of
> ffmpeg, and with the inputs and outputs you are using?

It seems not anymore. All three files are correct and the chance that
they where all three on an iframe is quite small. So I think problem
solved. :-D
The sizes are a bit different, but I do not see any difference.

I am now using this function:
function doConvert {
echo "Convert $1 to $2"
time nice -n 19 ionice -c3 \
  ffmpeg -y -ss $3 -i $1 -to $(($4 - $3)) \
 -vcodec libx264 -crf 26  \
 -acodec libmp3lame -qscale:a 9   \
 -preset veryfast $2
}

And it takes about 1/20 of the time. I am happy.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Better way to cut parts out of a long video?

2022-06-13 Thread Cecil Westerhof via ffmpeg-user
Rob Hallam  writes:

> On Mon, 13 Jun 2022 at 11:26, Cecil Westerhof via ffmpeg-user
>  wrote:
>> That could very seldom work, but is certainly not a general solution.
>> In the past I was told to do it like this because it was faster. Then
>> I got problems with the output and was told how iframes work.
>
> What problems, exactly? Do they still occur with modern versions of
> ffmpeg, and with the inputs and outputs you are using?

I am not sure. I think I had the problem about half a year ago.
Because I use Debian the version of ffmpeg would have been a little
older.

There where two problems:
- The created video started most of the time to early.
- Sometimes the timestamps where incorrect.

I could try again of-course.


> I wrote a small script a while ago to "find the nearest keyframe in
> the input video before the point I want the output video to start" so
> that ti could be used for input seeking. However, that was a long time
> ago, and for the purposes of stream-copied (ie not re-encoded) output.
> I have not had any reason to use it recently.

I try the other options, but if that does not work for me, would you
be willing to share it?


> You could try 'combined seeking':
> https://trac.ffmpeg.org/wiki/Seeking#Combinedseeking

That looks very interesting and is what I was asking about. :-D


> My understanding is that seeking after input requires reading (and
> decoding?) frames, which is why it is much slower.

Yes, that is the problem. But if that is the price I have to pay for a
right cut …


Thanks for the hints.


-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Better way to cut parts out of a long video?

2022-06-13 Thread Cecil Westerhof via ffmpeg-user
Rob Hallam  writes:

> On Mon, 13 Jun 2022 at 10:40, Cecil Westerhof via ffmpeg-user
>  wrote:
>> I know that because of iframes you need to put the inputfile before
>> the start and to parameters if you want to sure that the start time is
>> correctly used. Because of this I defined the following function.
>
> (snip)
>
> Have you tried seeking (-ss) before input to test if it is accurate
> enough for you? It would certainly be faster.

That could very seldom work, but is certainly not a general solution.
In the past I was told to do it like this because it was faster. Then
I got problems with the output and was told how iframes work.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Better way to cut parts out of a long video?

2022-06-13 Thread Cecil Westerhof via ffmpeg-user
I know that because of iframes you need to put the inputfile before
the start and to parameters if you want to sure that the start time is
correctly used. Because of this I defined the following function.
function doConvert {
echo "Convert $1 to $2"
time nice -n 19 ionice -c3  \
  ffmpeg -y -i $1   \
-ss $3 -to $4   \
-vcodec libx264 -crf 26 \
-acodec libmp3lame  \
-qscale:a 9 \
-preset veryfast $2
}

Normally this is not a problem: I do not have to cut from a video very
often and mostly the video is not very long. But this weekend I needed
to cut three parts out of a long video and this took more as 1½ hour
and my processor was (on my system) completly hogged:
doConvert Original/00233-00239.MTS improvisatieVoorEnTegenDeTienGeboden.mkv 
2658 2748
doConvert Original/00233-00239.MTS improvisatieWelOfNietOntbijten.mkv   
2757 2846
doConvert Original/00233-00239.MTS improvisatieWatWeetJeOverIjsheiligen.mkv 
4620 4682

The time output was (the first one I find a bit strange):
real45m33.66s
user63m9.35s
sys 1m0.51s
perc140.83


real23m18.92s
user60m39.46s
sys 0m52.01s
perc263.88

real29m36.04s
user88m38.41s
sys 1m4.94s
perc303.11

This is because ffmpeg spends all its time seeking the start of the
video. In the last case that is more as 1¼ hour into the video.
I am not using ffmpeg that much so maybe I am asking something stupid.
Would it not be possible to skip to the last iframe before the start?
Or should I be doing things completly differently?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-31 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 31.05.2022 um 18:43 schrieb Cecil Westerhof via ffmpeg-user:
>> Michael Koch  writes:
>>
>>> I have a short example in chapter 2.57 of my book:
>>> http://www.astro-electronic.de/FFmpeg_Book.pdf
>> Just to make sure I understand it, I should do something like:
>>  ffmpeg -ss %S1% -t %L1% -i %I1% \
>> -ss %S2% -t %L2% -i %I1% \
>> -ss %S3% -t %L3% -i %I1% \
>> -lavfi "concat=n=3:v=1:a=0"  \
>> -an %OUT%
>>
>> But if I understand it well, this works on the iframes, would it not
>> be better (but longer) to use:
>>  ffmpeg -i %I1% -ss %S1% -t %L1% \
>> -i %I1% -ss %S2% -t %L2% \
>> -i %I1% -ss %S3% -t %L3% \
>> -lavfi "concat=n=3:v=1:a=0"  \
>> -an %OUT%
>
> I think that won't work. If you write the options after the input file,
> then they are applied to the next input file, and the options in the 
> third line are applied to the output file.
> The concat filter does also work with audio. I just didn't need audio in
> my example.

But if you put them before the input file they are not precise, but
work on the iframe level. This can give quit extensive differences. (I
was bitten by that in the past.) Or is that not the case in this
specific scenario?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-31 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> I have a short example in chapter 2.57 of my book:
> http://www.astro-electronic.de/FFmpeg_Book.pdf

Just to make sure I understand it, I should do something like:
ffmpeg -ss %S1% -t %L1% -i %I1% \
   -ss %S2% -t %L2% -i %I1% \
   -ss %S3% -t %L3% -i %I1% \
   -lavfi "concat=n=3:v=1:a=0"  \
   -an %OUT%

But if I understand it well, this works on the iframes, would it not
be better (but longer) to use:
ffmpeg -i %I1% -ss %S1% -t %L1% \
   -i %I1% -ss %S2% -t %L2% \
   -i %I1% -ss %S3% -t %L3% \
   -lavfi "concat=n=3:v=1:a=0"  \
   -an %OUT%

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-29 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Sun, May 29, 2022 at 12:27 PM Cecil Westerhof  wrote:
>
>  Paul B Mahol  writes:
>
>  > On Sat, May 28, 2022 at 9:46 PM Cecil Westerhof via ffmpeg-user 
>  wrote:
>  >
>  >  Paul B Mahol  writes:
>  >
>  >  > On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user 
>  wrote:
>  >  >
>  >  >  When I just want to have a certain part of a video, I can do something
>  >  >  like:
>  >  >  ffmpeg -y -i input.MTS \
>  >  > -ss 00:08   \
>  >  > -to 00:17   \
>  >  > -acodec copy\
>  >  > -vcodec libx264 \
>  >  > -preset veryfast\
>  >  > output.mp4
>  >  >
>  >  >  But what if I want several parts of a video in my video?
>  >  >  Do I need to cut the different parts out of the video and concatenate
>  >  >  them, or is it possible to do it with one command?
>  >  >
>  >  > Using concat filter.
>  >
>  >  That is exactly what I already know: cutting the different parts.
>  >  Probably one command for each part and then concatenate them.
>  >  So n + 1 commands.
>  >  My question was: can it be done with one command?
>  >
>  > This IS ONE command with concat FILTER.
>
>  I am going to ignore you. You do not read my question and when I say
>  that your reply does not answer my question you double down to 'prove'
>  you are right.
>
>  Before I CAN USE concat I have the create the n cuts I need to put
>  into the concat.
>
> And that can be used already, just specify  -ss for all inputs you gonna use.
> So you create cuts with ffmpeg all into single commad. Note that -c:a(v) copy 
> does not work precisely with most of lossy
> codecs.
> So best and precise cut can be done inside all of libavfilter, by
> using (a)trim filters.

It seems I completely misunderstood you. My excuses about that.


> I'm really sorry if you gonna ignore my constructive help.

I eat my words.


> If you want to still use -c copy with lossy codecs, than you have
> opened a can of worms.

Should not do that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Generate numbers when concatenating videos

2022-05-29 Thread Cecil Westerhof via ffmpeg-user
Carl Zwanzig  writes:

> On 5/28/2022 12:57 PM, Paul B Mahol wrote:
>> Use concat filter and drawtext on color filter source.
>
> Or create a set of videos  with the numbers and pull them in- depends on
> how complex a command line you'll work with and other factors we don't
> know.

Maybe I should not make it to difficult for myself. At the moment I
need to cut every file out of another file. While doing that I could
put the number in the cut video. Is maybe even a better solution: you
do not have to remember the number, because you see it.

But it is certainly an option for later.
Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-29 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 28.05.2022 um 21:17 schrieb Cecil Westerhof via ffmpeg-user:
>> Paul B Mahol  writes:
>>
>>> On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user 
>>>  wrote:
>>>
>>>   When I just want to have a certain part of a video, I can do something
>>>   like:
>>>   ffmpeg -y -i input.MTS \
>>>  -ss 00:08   \
>>>  -to 00:17   \
>>>  -acodec copy\
>>>  -vcodec libx264 \
>>>  -preset veryfast\
>>>  output.mp4
>>>
>>>   But what if I want several parts of a video in my video?
>>>   Do I need to cut the different parts out of the video and concatenate
>>>   them, or is it possible to do it with one command?
>>>
>>> Using concat filter.
>> That is exactly what I already know: cutting the different parts.
>> Probably one command for each part and then concatenate them.
>> So n + 1 commands.
>> My question was: can it be done with one command?
>>
>
> Please have a look at
> https://trac.ffmpeg.org/wiki/Concatenate
>
> "Concat demuxer", "Concat protocol" and "Concat filter" are three
> different things.
> You did use the concat demuxer. Now if you want to do all in one line,
> you must use the concat filter.

I do not see it at the moment: will look at it again when I am a bit
less tired (was a very hectic week). Thanks for the clarification.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-29 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Sat, May 28, 2022 at 9:46 PM Cecil Westerhof via ffmpeg-user 
>  wrote:
>
>  Paul B Mahol  writes:
>
>  > On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user 
>  wrote:
>  >
>  >  When I just want to have a certain part of a video, I can do something
>  >  like:
>  >  ffmpeg -y -i input.MTS \
>  > -ss 00:08   \
>  > -to 00:17   \
>  > -acodec copy\
>  > -vcodec libx264 \
>  > -preset veryfast\
>  > output.mp4
>  >
>  >  But what if I want several parts of a video in my video?
>  >  Do I need to cut the different parts out of the video and concatenate
>  >  them, or is it possible to do it with one command?
>  >
>  > Using concat filter.
>
>  That is exactly what I already know: cutting the different parts.
>  Probably one command for each part and then concatenate them.
>  So n + 1 commands.
>  My question was: can it be done with one command?
>
> This IS ONE command with concat FILTER.

I am going to ignore you. You do not read my question and when I say
that your reply does not answer my question you double down to 'prove'
you are right.

Before I CAN USE concat I have the create the n cuts I need to put
into the concat.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Multiple parts of a video

2022-05-28 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user 
>  wrote:
>
>  When I just want to have a certain part of a video, I can do something
>  like:
>  ffmpeg -y -i input.MTS \
> -ss 00:08   \
> -to 00:17   \
> -acodec copy\
> -vcodec libx264 \
> -preset veryfast\
> output.mp4
>
>  But what if I want several parts of a video in my video?
>  Do I need to cut the different parts out of the video and concatenate
>  them, or is it possible to do it with one command?
>
> Using concat filter.

That is exactly what I already know: cutting the different parts.
Probably one command for each part and then concatenate them.
So n + 1 commands.
My question was: can it be done with one command?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Generate numbers when concatenating videos

2022-05-28 Thread Cecil Westerhof via ffmpeg-user
I need to concatenate a series of files. It would be nice when every
part would be preceded with its number.
For example:
- A white one on a black background.
- Then the first video.
- Then a white two on a black background.
- Then the second video.
  .
  .
  .

Would that be possible, or do I want to much?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Multiple parts of a video

2022-05-28 Thread Cecil Westerhof via ffmpeg-user
When I just want to have a certain part of a video, I can do something
like:
ffmpeg -y -i input.MTS \
   -ss 00:08   \
   -to 00:17   \
   -acodec copy\
   -vcodec libx264 \
   -preset veryfast\
   output.mp4

But what if I want several parts of a video in my video?
Do I need to cut the different parts out of the video and concatenate
them, or is it possible to do it with one command?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Cutting part of four files and concatenating

2022-05-28 Thread Cecil Westerhof via ffmpeg-user
"amin...@mailbox.org"  writes:

>> time ffmpeg -y -i audio1.mp4 -i audio2.mp4 -i audio3.mp4 -i audio4.mp4  \
>> -filter_complex "[0:v][0:a][1:v][1:a][2:v][2:a][3:v][3:a]
>>  concat=n=4:v=1:a=1[v][a]"  \
>> -map "[v]" -map "[a]"   \
>> -vcodec libx264 -preset veryfast\
>> mergedAudio.mp4
>> 
>> I was wondering if this is the correct way to do this.
>> I especially would like to know if it could be done in one swoop. Now
>> the video is converted two times.
>
>
> I don't know if it can be done in one fell swoop (and I'd love to know
> if that's possible!) but the last step might be possible to do without a
> re-encode with:
>
> $ cat combined.txt
> file '/home/foo/audio1.mp4'
> file '/home/foo/audio2.mp4'
> file '/home/foo/audio3.mp4'
> file '/home/foo/audio4.mp4'
>
> $ ffmpeg -y -f concat -safe 0 -i combined.txt -c copy mergedAudio.mp4

I should have thought about that.
I do it a little bit differently:
files=$(
for i in $(seq 1 4) ; do
printf "file $(pwd)/audio%d.mp4\n" $i
done
)
ffmpeg -y -f concat -safe 0 -i <(echo "${files}") -c copy mergedAudio.mp4

Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Cutting part of four files and concatenating

2022-05-26 Thread Cecil Westerhof via ffmpeg-user
I have to cut a part from four files and concatenate them together.
At the moment I am doing that in the following way:
time ffmpeg -i 00250.MTS -i Pictures/reiger.jpg 
\
-ss 00:19 -to 02:41 
\
-filter_complex "[0:v][1:v] 
overlay=W-w-10:10:enable='between(t, 73, 106)'" \
-pix_fmt yuv420p -acodec copy -vcodec libx264 -preset veryfast 
-crf 26  \
hetOnmogelijkeDoen.mp4
time ffmpeg -y -i 00264.MTS \
-ss 00:08   \
-to 00:17   \
-acodec copy\
-vcodec libx264 \
-preset veryfast\
audio1.mp4
time ffmpeg -y -i 00265.MTS \
-ss 00:04   \
-to 00:17   \
-acodec copy\
-vcodec libx264 \
-preset veryfast\
audio2.mp4
time ffmpeg -y -i 00266.MTS \
-ss 00:06   \
-to 00:15   \
-acodec copy\
-vcodec libx264 \
-preset veryfast\
audio3.mp4
time ffmpeg -y -i 00267.MTS \
-ss 00:08   \
-to 00:16   \
-acodec copy\
-vcodec libx264 \
-preset veryfast\
audio4.mp4
time ffmpeg -y -i audio1.mp4 -i audio2.mp4 -i audio3.mp4 -i audio4.mp4  \
-filter_complex "[0:v][0:a][1:v][1:a][2:v][2:a][3:v][3:a]
 concat=n=4:v=1:a=1[v][a]"  \
-map "[v]" -map "[a]"   \
-vcodec libx264 -preset veryfast\
mergedAudio.mp4

I was wondering if this is the correct way to do this.
I especially would like to know if it could be done in one swoop. Now
the video is converted two times.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Pictures in video

2022-05-24 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 24.05.2022 um 21:55 schrieb Cecil Westerhof via ffmpeg-user:
>> With a search on the internet I found I could put a picture into a
>> video with:
>>  ffmpeg -i introductie.mkv -i Pictures/reiger.jpg \
>>  -filter_complex "[0:v][1:v] overlay=W-w:H-h:enable='between(t,0,20)'" \
>>  -pix_fmt yuv420p -c:a copy \
>>  metReiger.mp4
>>
>> But what if I would insert another picture at another time?
>> Or two at the same time? One top left, the other top right.
>
> You can use two or more overlay filters in the filter chain:
> ffmpeg -i introductie.mkv -i image1.jpg -i image2.jpg -filter_complex
> "[0:v][1:v] 
> overlay=W-w:H-h:enable='between(t,0,20)'[a];[a][2:v]overlay=W-w:H-h:enable='between(t,21,25)'"
> ...
>
>> What I find strange is that the input video is 23 MB and the picture
>> is 302 KB, but the generated video is 42 MB.
>
> You can for example specify the bitrate with -b:v

I changed it to:
ffmpeg -i introductie.mkv -i Pictures/reiger.jpg -i Pictures/vlinder.jpg \
-filter_complex "[0:v][1:v] overlay=10:10:enable='between(t, 0, 
20)'[a];[a][2:v]overlay=W-w-10:10:enable='between(t, 0, 20)'" \
-pix_fmt yuv420p -c:a copy -vcodec libx265 -preset veryfast -crf 30 \
metReigerEnVlinder.mp4

and it works.

Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Pictures in video

2022-05-24 Thread Cecil Westerhof via ffmpeg-user
Moritz Barsnick  writes:

> On Tue, May 24, 2022 at 21:55:20 +0200, FFmpeg user discussions wrote:
>> What I find strange is that the input video is 23 MB and the picture
>> is 302 KB, but the generated video is 42 MB.
>> Am I doing something wrong?
>
> No, that's not strange at all. You are reencoding a video. That process
> will likely use different parameters than the original encoding.
> (Approximately the same would happen without the overlay.) You can
> control the encoding parameters, e.g. by the bitrate option "-b:v", or
> with "-crf" (if using libx264 or libx265). There is a lot of
> information about that available.

Of-course, should have thought about that. :'-(
Changed the last but one line to:
-pix_fmt yuv420p -c:a copy -vcodec libx265 -preset veryfast -crf 30 \

And now the output file is 16 MB.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Pictures in video

2022-05-24 Thread Cecil Westerhof via ffmpeg-user
With a search on the internet I found I could put a picture into a
video with:
ffmpeg -i introductie.mkv -i Pictures/reiger.jpg \
-filter_complex "[0:v][1:v] overlay=W-w:H-h:enable='between(t,0,20)'" \
-pix_fmt yuv420p -c:a copy \
metReiger.mp4

But what if I would insert another picture at another time?
Or two at the same time? One top left, the other top right.

What I find strange is that the input video is 23 MB and the picture
is 302 KB, but the generated video is 42 MB.
Am I doing something wrong?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] ffmpeg create wrong time information

2021-12-22 Thread Cecil Westerhof via ffmpeg-user
Bouke / Videotoolshed  writes:

>> On 21 Dec 2021, at 19:37, Cecil Westerhof via ffmpeg-user 
>>  wrote:
>> 
>> Cecil Westerhof via ffmpeg-user  writes:
>> 
>> After some experiments I solved it by putting -ss and -to behind -i
>> and not forgetting to alter the between values.
>> But this takes about a third more time.
>> Is there be a better solution?
>> 
>> I am now using:
>>ffmpeg -y \
>>-i input.mp4  \
>>-ss 00:26:05  \
>>-to 00:44:04  \
>>-vf "
>> drawbox=enable='between(t, 1565, 1566.6)':
>>color = black :
>>w = in_w  :
>>h = in_h  :
>>thickness = fill
>>" \
>>-acodec copy  \
>>-vcodec libx264   \
>>-crf 23   \
>>-preset veryfast  \
>>output.mkv
>
> I think you are inserting black, not overlaying (blanking) the
> video. Try -vf overlay.

If I look at overlay, it says:
Overlay one video on top of another.

I only want to block video for a short while because someone who
should not be visible is visible.


> With -ss before input, it will do a faster search, you might have to do
> a bit of math on the enable= range, but that will become very obvious
> with a small test.

The problem is that (in this case, I have used it without problems)
with -ss before the video there is 27 seconds of (hidden) audio. If
the video started 27 seconds I could understand it.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] ffmpeg create wrong time information

2021-12-21 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

After some experiments I solved it by putting -ss and -to behind -i
and not forgetting to alter the between values.
But this takes about a third more time.
Is there be a better solution?

I am now using:
ffmpeg -y \
-i input.mp4  \
-ss 00:26:05  \
-to 00:44:04  \
-vf "
 drawbox=enable='between(t, 1565, 1566.6)':
color = black :
w = in_w  :
h = in_h  :
thickness = fill
" \
-acodec copy  \
-vcodec libx264   \
-crf 23   \
-preset veryfast  \
output.mkv

> I have the recording of a zoom meeting where I need to cut out a
> portion from and the first little bit has to be blacked out.
>
> I use the following command:
> ffmpeg -y\
> -ss 00:26:05 \
> -to 00:44:04 \
> -i input.mp4 \
> -vf "
>  drawbox=enable='between(t, 0, 1.6)' :
> color = black:
> w = in_w :
> h = in_h :
> thickness = fill
> "\
> -acodec copy \
> -vcodec libx264  \
> -crf 23  \
> -preset veryfast \
> output.mkv
>
> This creates a seemingly correct file, with one little problem: the
> time starts at 00:00:27 and ends at 00:18:26. (As displayed by the
> player mpv.)
>
> When I play it with vlc I find out that the 27 seconds of audio are
> before the video. Mpv starts with the video, but vlc starts with the
> audio.
> What could be the problem?
>
>
> I am using ffmpeg version 4.3.3-0+deb11u.
>
>
> The metadata of the input file:
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
> 'GMT20211216-184321_Recording_640x360.mp4':
>   Metadata:
> major_brand : mp42
> minor_version   : 0
> compatible_brands: isommp42
> creation_time   : 2021-12-16T18:43:21.00Z
>   Duration: 01:21:57.47, start: 0.00, bitrate: 646 kb/s
> Chapter #0:0: start 0.00, end 4917.44
> Metadata:
>   title   : Recording Started
> Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, 
> fltp, 126 kb/s (default)
> Metadata:
>   creation_time   : 2021-12-16T18:43:21.00Z
>   handler_name: AAC audio
> Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
> 640x360, 518 kb/s, 25 fps, 25 tbr, 30k tbn, 60k tbc (default)
> Metadata:
>   creation_time   : 2021-12-16T18:43:21.00Z
>   handler_name: H.264/AVC video
>   encoder : AVC Coding
> Stream #0:2(und): Data: bin_data (text / 0x74786574)
> Metadata:
>   creation_time   : 2021-12-16T18:43:21.00Z
>   handler_name: Text
>
> The metadata of the output file:
> Input #0, matroska,webm, from 'howToReachYourNewYearsResolutionsIn2022.mkv':
>   Metadata:
> COMPATIBLE_BRANDS: isommp42
> MAJOR_BRAND : mp42
> MINOR_VERSION   : 0
> ENCODER : Lavf58.45.100
>   Duration: 00:18:26.34, start: 0.00, bitrate: 346 kb/s
> Chapter #0:0: start 0.00, end 3352.44
> Metadata:
>   title   : Recording Started
> Stream #0:0: Video: h264, none, 640x360, 25 fps, 25 tbr, 1k tbn, 2k tbc 
> (default)
> Metadata:
>   HANDLER_NAME: H.264/AVC video
>   ENCODER : Lavc58.91.100 libx264
>   DURATION: 00:18:26.33600
> Stream #0:1: Audio: aac (LC), 32000 Hz, mono, fltp (default)
> Metadata:
>   HANDLER_NAME: AAC audio
>   DURATION: 00:18:26.33600
>
>
> By the way when I create a mp4 file (which is not really an option,
> because I need to create chapters), the video seems to be correct,
> with one strange thing: both mpv and vlc think it is 00:55:52 long.
> Which it is not: it stops where it should 00:17:59.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] ffmpeg create wrong time information

2021-12-21 Thread Cecil Westerhof via ffmpeg-user
I have the recording of a zoom meeting where I need to cut out a
portion from and the first little bit has to be blacked out.

I use the following command:
ffmpeg -y\
-ss 00:26:05 \
-to 00:44:04 \
-i input.mp4 \
-vf "
 drawbox=enable='between(t, 0, 1.6)' :
color = black:
w = in_w :
h = in_h :
thickness = fill
"\
-acodec copy \
-vcodec libx264  \
-crf 23  \
-preset veryfast \
output.mkv

This creates a seemingly correct file, with one little problem: the
time starts at 00:00:27 and ends at 00:18:26. (As displayed by the
player mpv.)

When I play it with vlc I find out that the 27 seconds of audio are
before the video. Mpv starts with the video, but vlc starts with the
audio.
What could be the problem?


I am using ffmpeg version 4.3.3-0+deb11u.


The metadata of the input file:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'GMT20211216-184321_Recording_640x360.mp4':
  Metadata:
major_brand : mp42
minor_version   : 0
compatible_brands: isommp42
creation_time   : 2021-12-16T18:43:21.00Z
  Duration: 01:21:57.47, start: 0.00, bitrate: 646 kb/s
Chapter #0:0: start 0.00, end 4917.44
Metadata:
  title   : Recording Started
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, 
fltp, 126 kb/s (default)
Metadata:
  creation_time   : 2021-12-16T18:43:21.00Z
  handler_name: AAC audio
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 
518 kb/s, 25 fps, 25 tbr, 30k tbn, 60k tbc (default)
Metadata:
  creation_time   : 2021-12-16T18:43:21.00Z
  handler_name: H.264/AVC video
  encoder : AVC Coding
Stream #0:2(und): Data: bin_data (text / 0x74786574)
Metadata:
  creation_time   : 2021-12-16T18:43:21.00Z
  handler_name: Text

The metadata of the output file:
Input #0, matroska,webm, from 'howToReachYourNewYearsResolutionsIn2022.mkv':
  Metadata:
COMPATIBLE_BRANDS: isommp42
MAJOR_BRAND : mp42
MINOR_VERSION   : 0
ENCODER : Lavf58.45.100
  Duration: 00:18:26.34, start: 0.00, bitrate: 346 kb/s
Chapter #0:0: start 0.00, end 3352.44
Metadata:
  title   : Recording Started
Stream #0:0: Video: h264, none, 640x360, 25 fps, 25 tbr, 1k tbn, 2k tbc 
(default)
Metadata:
  HANDLER_NAME: H.264/AVC video
  ENCODER : Lavc58.91.100 libx264
  DURATION: 00:18:26.33600
Stream #0:1: Audio: aac (LC), 32000 Hz, mono, fltp (default)
Metadata:
  HANDLER_NAME: AAC audio
  DURATION: 00:18:26.33600


By the way when I create a mp4 file (which is not really an option,
because I need to create chapters), the video seems to be correct,
with one strange thing: both mpv and vlc think it is 00:55:52 long.
Which it is not: it stops where it should 00:17:59.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] h.265 crf values corresponding with h.264

2021-12-15 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Ferdi Scholten  writes:
>
>> On 15-12-2021 18:18, Cecil Westerhof via ffmpeg-user wrote:
>>> When looking at:
>>>  https://trac.ffmpeg.org/wiki/Encode/H.265
>>>
>>> with h.265 the value 28 should correspond with the value 23 with
>>> h.264.
>>> Is there a (rough) table for the other values?
>>>
>> Well, no not really
>>
>> Those figures are generic. In reality there are many things that can
>> affect both quality and size.
>> The kind of video used as a source, the amount of visual detail, the
>> preset used or other settings all have a big impact either on size or 
>> quality of the encode.
>>
>> So what is your goal, would you want high quality, small file sizes or
>> fast encoding speed? All these things you need to trade off to get to 
>> your optimum encoding settings. Do some trial runs with small samples to
>> find out what suits your needs.
>
> In a way all three. ;-)
>
> But my first impression it is not worth it. (After a very short test.)
> It seems that h.265 generates a marginal smaller file, with a marginal
> better quality, but takes two times as much computer power.

In another case h.265 took 2/3 longer, but the size was 3/5. So that
could be interesting.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] h.265 crf values corresponding with h.264

2021-12-15 Thread Cecil Westerhof via ffmpeg-user
Rob Hallam  writes:

> On Wed, 15 Dec 2021 at 18:06, Cecil Westerhof via ffmpeg-user
>  wrote:
>
>> Does YouTube has a preference for one, or the other?
>
> YT accepts both, and has h264 encoding suggestions:
> https://support.google.com/youtube/answer/1722171
>
> As for whether it prefers one or the other, it seems unlikely as they
> transcode internally anyway. Of course, who knows what "the algorithm"
> likes!

When I upload I often think it takes long and in the past I had
messages about wrong type. But not lately I think.

I will look into your link.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] h.265 crf values corresponding with h.264

2021-12-15 Thread Cecil Westerhof via ffmpeg-user
Ferdi Scholten  writes:

> On 15-12-2021 18:18, Cecil Westerhof via ffmpeg-user wrote:
>> When looking at:
>>  https://trac.ffmpeg.org/wiki/Encode/H.265
>>
>> with h.265 the value 28 should correspond with the value 23 with
>> h.264.
>> Is there a (rough) table for the other values?
>>
> Well, no not really
>
> Those figures are generic. In reality there are many things that can
> affect both quality and size.
> The kind of video used as a source, the amount of visual detail, the
> preset used or other settings all have a big impact either on size or 
> quality of the encode.
>
> So what is your goal, would you want high quality, small file sizes or
> fast encoding speed? All these things you need to trade off to get to 
> your optimum encoding settings. Do some trial runs with small samples to
> find out what suits your needs.

In a way all three. ;-)

But my first impression it is not worth it. (After a very short test.)
It seems that h.265 generates a marginal smaller file, with a marginal
better quality, but takes two times as much computer power.

Thus it seems that for most things I could best stick to h.264.


Does YouTube has a preference for one, or the other?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] h.265 crf values corresponding with h.264

2021-12-15 Thread Cecil Westerhof via ffmpeg-user
When looking at:
https://trac.ffmpeg.org/wiki/Encode/H.265

with h.265 the value 28 should correspond with the value 23 with
h.264.
Is there a (rough) table for the other values?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Cropping video

2021-12-11 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 11.12.2021 um 22:24 schrieb Cecil Westerhof via ffmpeg-user:
>> I gave a speech on zoom. It was recorded, but sadly together with
>> others. So I want to crop my part out of it. At the moment this works:
>>  ffmpeg -y -i input.mp4 -filter:v "crop=480:360:80:180" output.mp4
>>
>> Was just wondering if there was a better way.
>>
>
> I think you have already found the best way.

Thank you.

It never hurts to ask. Sometimes I think I did something in the best
way and when I ask I am shown a better way.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Cropping video

2021-12-11 Thread Cecil Westerhof via ffmpeg-user
I gave a speech on zoom. It was recorded, but sadly together with
others. So I want to crop my part out of it. At the moment this works:
ffmpeg -y -i input.mp4 -filter:v "crop=480:360:80:180" output.mp4

Was just wondering if there was a better way.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Removing part of a video

2021-11-12 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> I need to cut a part out of a video. (A certain speaker does not want
> to be published.)
> Searching on the internet I found this:
> Following is a snippet we used to remove a few seconds from a video using 
> ffmpeg
>
> ffmpeg -i 'input.mkv' -filter_complex \
>   "[0:v]trim=end=553,setpts=N/FRAME_RATE/TB[v0]; \
>[0:a]atrim=end=553,asetpts=N/SR/TB[a0]; \
>[0:v]trim=start=559,setpts=N/FRAME_RATE/TB[v1]; \
>[0:a]atrim=start=559,asetpts=N/SR/TB[a1]; \
>[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" \
>   -map "[v]" -map "[a]" 'output.mkv'
>
> Specifically, we removed the seconds 09:13 (second 553) to 09:19 (second 
> 559).
>
> Is this the correct way to do it (after setting the correct
> timestamps), or is there a better way?

It works, but there are a few problems. :'-(

I cut 1:50 from a video of 18:51 to get a video to get a video of
17:01.
The video goes from 402.4 MB to 341.8 MB.
But the problem is that ffmpeg takes all my CPU and the speed is
0.359. It would be nice if there would be a more efficient option.
What is also not nice is that the chapter info is not updated.
But that is preventable: I could do first the cut and afterwards
create the chapters. I would prefer the other way around, but I can
life with that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Removing part of a video

2021-11-12 Thread Cecil Westerhof via ffmpeg-user
I need to cut a part out of a video. (A certain speaker does not want
to be published.)
Searching on the internet I found this:
Following is a snippet we used to remove a few seconds from a video using 
ffmpeg

ffmpeg -i 'input.mkv' -filter_complex \
  "[0:v]trim=end=553,setpts=N/FRAME_RATE/TB[v0]; \
   [0:a]atrim=end=553,asetpts=N/SR/TB[a0]; \
   [0:v]trim=start=559,setpts=N/FRAME_RATE/TB[v1]; \
   [0:a]atrim=start=559,asetpts=N/SR/TB[a1]; \
   [v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" \
  -map "[v]" -map "[a]" 'output.mkv'

Specifically, we removed the seconds 09:13 (second 553) to 09:19 (second 
559).

Is this the correct way to do it (after setting the correct
timestamps), or is there a better way?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] failed to avoid negative pts

2021-09-21 Thread Cecil Westerhof via ffmpeg-user
I tried to cut the first part of an .mkv file with:
ffmpeg -ss 119 -i input.mkv -codec copy output.mkv 

This gives several times something like the following error:
[matroska @ 0x561acc0ca700] failed to avoid negative pts -79 in stream 1.
Try -avoid_negative_ts 1 as a possible workaround.

But as far as I can see the output.mkv is OK. What is happening here?
Is it important that I run it again with:
-avoid_negative_ts 1

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Weird results with drawtext

2021-09-19 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 19.09.2021 um 12:42 schrieb Cecil Westerhof via ffmpeg-user:
>> Michael Koch  writes:
>>
>>>> As Michael Koch said:
>>>>   The content of the variable "text_h" depends on which characters
>>>>   you are printing.
>>>>
>>>> So I changed:
>>>>   drawtext=
>>>>  enable = 'between(t, 105, 115)':
>>>>  text   = 'speaker':
>>>>  y  = main_h - (text_h * 4),
>>>>   drawtext=
>>>>  enable = 'between(t, 105, 115)':
>>>>  text   = 'subject':
>>>>  y  = main_h - (text_h * 2.2),
>>>>
>>>> to:
>>>>   drawtext=
>>>>  enable = 'between(t, 105, 115)':
>>>>  text   = 'speaker':
>>>>  y  = main_h - 200,
>>>>   drawtext=
>>>>  enable = 'between(t, 105, 115)':
>>>>  text   = 'subject':
>>>>  y  = main_h - 140,
>>>>
>>>> That gives satisfactory results. The only problem is when the font
>>>> size changes. Then I have to remember I need to change these two
>>>> values also. But I do not expect that to happen often, so I can live
>>>> with that.
>>> In your case with the words "speaker" and "subject" it works, but
>>> generally it fails.
>>> For example if you remove the character "k" from "speaker", then the
>>> vertical alignment will be wrong.
>> Speaker and subject where only templates, in reality there is a
>> speaker and a subject.
>> I made a video with eight sets of speakers and subjects and all look
>> good (enough). So I think (hope) that it works.
>> But who knows, maybe I need to go back to the drawing-board next time.
>> (But I certainly hope not.)
>
> I found a simple solution. Replace
> y=100-text_h
> by
> y=100-ascent
>
> This seems to work for all characters.

Aah, I was wondering if there was a solution like that. Thanks I will
try it out.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Weird results with drawtext

2021-09-19 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

>> As Michael Koch said:
>>  The content of the variable "text_h" depends on which characters
>>  you are printing.
>>
>> So I changed:
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'speaker':
>> y  = main_h - (text_h * 4),
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'subject':
>> y  = main_h - (text_h * 2.2),
>>
>> to:
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'speaker':
>> y  = main_h - 200,
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'subject':
>> y  = main_h - 140,
>>
>> That gives satisfactory results. The only problem is when the font
>> size changes. Then I have to remember I need to change these two
>> values also. But I do not expect that to happen often, so I can live
>> with that.
>
> In your case with the words "speaker" and "subject" it works, but
> generally it fails.
> For example if you remove the character "k" from "speaker", then the
> vertical alignment will be wrong.

Speaker and subject where only templates, in reality there is a
speaker and a subject.
I made a video with eight sets of speakers and subjects and all look
good (enough). So I think (hope) that it works.
But who knows, maybe I need to go back to the drawing-board next time.
(But I certainly hope not.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Weird results with drawtext

2021-09-18 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> I have several of the following (simplified):
> drawtext=
>enable = 'between(t, 105, 115)':
>text   = 'speaker':
>y  = main_h - (text_h * 4),
> drawtext=
>enable = 'between(t, 105, 115)':
>text   = 'subject':
>y  = main_h - (text_h * 2.2),
>
> I have been carefully tweaking to get them on the correct place.
> But when I was satisfied and generated all eight places where I wanted
> to have them the placement of the speaker and subject text is on
> different heights. Sometimes one or the other is different, sometimes
> both and sometimes they are the same.
>
> Is this a bug, or am I doing something wrong?

As Michael Koch said:
The content of the variable "text_h" depends on which characters
you are printing.

So I changed:
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'speaker':
   y  = main_h - (text_h * 4),
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'subject':
   y  = main_h - (text_h * 2.2),

to:
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'speaker':
   y  = main_h - 200,
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'subject':
   y  = main_h - 140,

That gives satisfactory results. The only problem is when the font
size changes. Then I have to remember I need to change these two
values also. But I do not expect that to happen often, so I can live
with that.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Weird results with drawtext

2021-09-18 Thread Cecil Westerhof via ffmpeg-user
Michael Koch  writes:

> Am 18.09.2021 um 18:07 schrieb Cecil Westerhof via ffmpeg-user:
>> I have several of the following (simplified):
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'speaker':
>> y  = main_h - (text_h * 4),
>>  drawtext=
>> enable = 'between(t, 105, 115)':
>> text   = 'subject':
>> y  = main_h - (text_h * 2.2),
>>
>> I have been carefully tweaking to get them on the correct place.
>> But when I was satisfied and generated all eight places where I wanted
>> to have them the placement of the speaker and subject text is on
>> different heights. Sometimes one or the other is different, sometimes
>> both and sometimes they are the same.
>>
>> Is this a bug, or am I doing something wrong?
>>
>
> The content of the variable "text_h" depends on which characters you are
> printing.
>
> If you don't use "text_h", then the characters "a" and "q" are printed
> at the same height:
> ffmpeg -f lavfi -i color=yellow -lavfi
> drawtext=text='a':x=20:y=50,drawtext=text='q':x=40:y=50 -frames 1 -y 
> out1.png

That makes sense.
But now I have to find a way to place it correctly without using
text_h.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Weird results with drawtext

2021-09-18 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Sat, Sep 18, 2021 at 6:07 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> wrote:
>
>> I have several of the following (simplified):
>> drawtext=
>>enable = 'between(t, 105, 115)':
>>text   = 'speaker':
>>y  = main_h - (text_h * 4),
>> drawtext=
>>enable = 'between(t, 105, 115)':
>>text   = 'subject':
>>y  = main_h - (text_h * 2.2),
>>
>> I have been carefully tweaking to get them on the correct place.
>> But when I was satisfied and generated all eight places where I wanted
>> to have them the placement of the speaker and subject text is on
>> different heights. Sometimes one or the other is different, sometimes
>> both and sometimes they are the same.
>>
>> Is this a bug, or am I doing something wrong?
>>
>
> Make sure you do not use subsampled pixel formats.

What do you mean with that?


Maybe better to give the whole drawtext:
drawtext=
   box= 1   :
   boxborderw = 6   :
   boxcolor   = black@0.5   :
   fontcolor  = white   :
   fontfile   = FreeSerifBold.ttf   :
   fontsize   = 64  :
   x  = ((main_w - text_w) / 2) :
   enable = 'between(t, 105, 115)':
   text   = 'speaker':
   y  = main_h - (text_h * 4),
drawtext=
   box= 1   :
   boxborderw = 6   :
   boxcolor   = black@0.5   :
   fontcolor  = white   :
   fontfile   = FreeSerifBold.ttf   :
   fontsize   = 64  :
   x  = ((main_w - text_w) / 2) :
   enable = 'between(t, 105, 115)':
   text   = 'subject':
   y  = main_h - (text_h * 2.2),


I tried to find a regularity. For a moment it seemed to be related to
the number of words (while sounding strange), but that was not the
case.

But it has to do with the text. By the second speaker the subject was
placed lower. When I put there the same subject the subject is placed
correctly.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Weird results with drawtext

2021-09-18 Thread Cecil Westerhof via ffmpeg-user
I have several of the following (simplified):
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'speaker':
   y  = main_h - (text_h * 4),
drawtext=
   enable = 'between(t, 105, 115)':
   text   = 'subject':
   y  = main_h - (text_h * 2.2),

I have been carefully tweaking to get them on the correct place.
But when I was satisfied and generated all eight places where I wanted
to have them the placement of the speaker and subject text is on
different heights. Sometimes one or the other is different, sometimes
both and sometimes they are the same.

Is this a bug, or am I doing something wrong?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

> Paul B Mahol  writes:
>
>>> > What exactly you tried?
>>>
>>> What you suggested:
>>> ffmpeg -i 09-Improvisaties.mp4 -i evaluaties.txt -map_chapters 1
>>> -codec copy 09-Improvisati
>>> esMetHoofdstukken.mp4
>>>
>>>
>> Use less brain dead container than mp4
>>
>> If works fine with .nut
>
> Yes it works with .nut. But I have to distribute it. You cannot play a
> .nut file with the default player on Android. You have to install VLC.
> I have to investigate if that (or something else) is a problem.

One problem is that VLC on Android does not see the title of a
chapter.

With .mkv and .asf chapters also work. But VCL on Android does not see
the chapters in an .asf file. With a .mkv the chapters are seen and
the correct title is displayed.

So at the moment .mkv seems the best option. But only tested it with
mpv on Debian and VLC on Android. Do not know how good it will work on
Windows and Apple.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

>> > What exactly you tried?
>>
>> What you suggested:
>> ffmpeg -i 09-Improvisaties.mp4 -i evaluaties.txt -map_chapters 1
>> -codec copy 09-Improvisati
>> esMetHoofdstukken.mp4
>>
>>
> Use less brain dead container than mp4
>
> If works fine with .nut

Yes it works with .nut. But I have to distribute it. You cannot play a
.nut file with the default player on Android. You have to install VLC.
I have to investigate if that (or something else) is a problem.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Fri, Sep 17, 2021 at 11:07 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> wrote:
>
>> Paul B Mahol  writes:
>>
>> > On Fri, Sep 17, 2021 at 10:33 PM Cecil Westerhof via ffmpeg-user <
>> > ffmpeg-user@ffmpeg.org> wrote:
>> >
>> >> Paul B Mahol  writes:
>> >>
>> >> > On Fri, Sep 17, 2021 at 9:34 PM Cecil Westerhof via ffmpeg-user <
>> >> > ffmpeg-user@ffmpeg.org> wrote:
>> >> >
>> >> >> Cecil Westerhof via ffmpeg-user  writes:
>> >> >>
>> >> >> When I put before the first chapter:
>> >> >> [CHAPTER]
>> >> >> TIMEBASE=1/1
>> >> >> START=1
>> >> >> END=2
>> >> >> title=
>> >> >>
>> >> >>
>> >> > I think chapter metadata needs own command line option to work
>> correctly.
>> >>
>> >> What do you mean?
>> >> All chapters are correct, except the first one.
>> >>
>> >> Tried -map_chapters option?
>>
>> I used '-map_metadata 1'.
>> I can try -map_chapters, but if I would be using the wrong option, I
>> would expect everything to go wrong and not only the first chapter.
>>
>> I tried it, but it is just the same problem.
>> It looks like ffmpeg wants the first chapter to start at 0 and that
>> chapters need to be connected. (Chapter n ends where n + 1 starts. But
>> why do I have to enter the end of a chapter then?)
>>
>
> What exactly you tried?

What you suggested:
ffmpeg -i 09-Improvisaties.mp4 -i evaluaties.txt -map_chapters 1 -codec 
copy 09-Improvisati
esMetHoofdstukken.mp4

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Fri, Sep 17, 2021 at 10:33 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> wrote:
>
>> Paul B Mahol  writes:
>>
>> > On Fri, Sep 17, 2021 at 9:34 PM Cecil Westerhof via ffmpeg-user <
>> > ffmpeg-user@ffmpeg.org> wrote:
>> >
>> >> Cecil Westerhof via ffmpeg-user  writes:
>> >>
>> >> When I put before the first chapter:
>> >> [CHAPTER]
>> >> TIMEBASE=1/1
>> >> START=1
>> >> END=2
>> >> title=
>> >>
>> >>
>> > I think chapter metadata needs own command line option to work correctly.
>>
>> What do you mean?
>> All chapters are correct, except the first one.
>>
>> Tried -map_chapters option?

I used '-map_metadata 1'.
I can try -map_chapters, but if I would be using the wrong option, I
would expect everything to go wrong and not only the first chapter.

I tried it, but it is just the same problem.
It looks like ffmpeg wants the first chapter to start at 0 and that
chapters need to be connected. (Chapter n ends where n + 1 starts. But
why do I have to enter the end of a chapter then?)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Paul B Mahol  writes:

> On Fri, Sep 17, 2021 at 9:34 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> wrote:
>
>> Cecil Westerhof via ffmpeg-user  writes:
>>
>> When I put before the first chapter:
>> [CHAPTER]
>> TIMEBASE=1/1
>> START=1
>> END=2
>> title=
>>
>>
> I think chapter metadata needs own command line option to work correctly.

What do you mean?
All chapters are correct, except the first one.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Strange problem with creating chapters

2021-09-17 Thread Cecil Westerhof via ffmpeg-user
Cecil Westerhof via ffmpeg-user  writes:

When I put before the first chapter:
[CHAPTER]
TIMEBASE=1/1
START=1
END=2
title=

I get:
Input #1, ffmetadata, from 'evaluaties.txt':
  Metadata:
title   : Improvisations
  Duration: 00:16:35.00, start: 0.00, bitrate: 0 kb/s
Chapter #1:0: start 1.00, end 2.00
Metadata:
  title   : 
.
.
.
Output #0, mp4, to '09-ImprovisatiesMetHoofdstukken.mp4':
  Metadata:
title   : Improvisations
encoder : Lavf58.45.100
Chapter #0:0: start 1.00, end 2.00
Metadata:
  title   : 

and:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'09-ImprovisatiesMetHoofdstukken.mp4':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
title   : Improvisations
encoder : Lavf58.45.100
  Duration: 00:16:35.83, start: 0.00, bitrate: 2434 kb/s
Chapter #0:0: start 0.00, end 105.00
Metadata:
  title   : 

> I am playing with ffmpeg again. I got a few questions, so I will be
> posting them in the near future.
>
> But I have one very strange problem that is kind of urgent.
>
> I have a metafile to create chapters. It works OK except for the first
> chapter.
>
> My metafile starts with:
> ;FFMETADATA1
> title=Improvisations
>
> [CHAPTER]
> TIMEBASE=1/1
> START=105
> END=239
> title=Just a test case
>
> When creating the file with the chapters I see:
> Input #1, ffmetadata, from 'evaluaties.txt':
>   Metadata:
> title   : Improvisations
>   Duration: 00:16:35.00, start: 0.00, bitrate: 0 kb/s
> Chapter #1:0: start 105.00, end 239.00
> ^^
> Metadata:
>   title   : Just a test case
> .
> .
> .
> Output #0, mp4, to '09-ImprovisatiesMetHoofdstukken.mp4':
>   Metadata:
> title   : Improvisations
> encoder : Lavf58.45.100
> Chapter #0:0: start 105.00, end 239.00
> ^^
> Metadata:
>   title   : Just a test case
>
> But with ffprobe I am seeing:
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
> '09-ImprovisatiesMetHoofdstukken.mp4':
>   Metadata:
> major_brand : isom
> minor_version   : 512
> compatible_brands: isomiso2avc1mp41
> title   : Improvisations
> encoder : Lavf58.45.100
>   Duration: 00:16:35.83, start: 0.00, bitrate: 2434 kb/s
> Chapter #0:0: start 0.00, end 240.00
> 
> Metadata:
>   title   : Just a test case
>
> What could be happening here?
>
> I am using Debian 11 and ffmpeg version 4.3.2-0+deb11u2.
>
> I could probably solve it with a dummy chapter of a second at the
> beginning, but would prefer a better solution.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


  1   2   >