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".


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

2022-05-31 Thread Bo Berglund
On Tue, 31 May 2022 13:15:02 +0200, Michael Koch 
wrote:

>> So reading this thread I get the feeling that there is a way to use the list 
>> of
>> cut times in a *single ffmpeg command* to create the output mp4 file 
>> *without*
>> creating the list file and essentially doing everything in this single ffmpeg
>> command.
>
>I have a short example in chapter 2.57 of my book:
>http://www.astro-electronic.de/FFmpeg_Book.pdf
>
>Michael
>

So I used the command that re-encodes the video from example 2.57 for an input
file of 64 minutes where the cuts sum to 44m33s

time ffmpeg -hide_banner \
-ss 25 -t 1100 -i input.mp4 \
-ss 1338 -t 265 -i input.u.mp4 \
-ss 1831 -t 573 -i input.u.mp4 \
-ss 2647 -t 735 -i input.u.mp4 \
-lavfi "concat=n=4:v=1:a=1" -an output.mp4

real6m53.455s

So this took almost 7 minutes to cut out the 4 sections and concatenate them
onto the output file. I had to change :a=0 to :a=1 in order to get audio too.

This slower concatenation (compared to using -c copy as in example 2.56)
produces a much smoother video transition between cuts. No interruptions like I
have in my existing concat function, which uses copy.

But the downside is of course the long processing, using copy makes the process
run for 3-6 seconds only...

But it *is* a one-command ffmpeg concat of multiple sections in the same source
file onto an output file including audio

I also tried to concat using the 2.56 example but with two files recorded from
the same stream but at different times.
Did not work at all, the first part plays OK but the second half is muted and
there are a lot of error output during the encoding, many-many lines like this:

[mp4 @ 0x5622ce1a0200] Non-monotonous DTS in output stream 0:0; previous:
81976537, current: 81940035; changing to 81976538. This may result in incorrect
timestamps in the output file.



-- 
Bo Berglund
Developer in Sweden

___
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 Michael Koch

Am 31.05.2022 um 20:27 schrieb 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?



Then you could use the trim filter.

Michael

___
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 Michael Koch

Am 31.05.2022 um 20:27 schrieb 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?



Then you could use the trim filter.

Michael

___
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 Michael Koch

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.


 Michael
___
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-31 Thread Paul B Mahol
On Tue, May 31, 2022 at 6:15 PM Bo Berglund  wrote:

> On Tue, 31 May 2022 13:15:02 +0200, Michael Koch <
> astroelectro...@t-online.de>
> wrote:
>
> >Am 31.05.2022 um 11:17 schrieb Bo Berglund:
> >> On Sun, 29 May 2022 13:17:55 +0200, Michael Koch <
> astroelectro...@t-online.de>
> >> wrote:
> > 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.
> >>>
> >>> Michael
> >> Stepping in here due to the interesting topic:
> >>
> >> I am daily using a tool I created myself to use ffmpeg to remove ads
> from
> >> recorded mp4 TV news videos.
> >> What I do is the following:
> >> - I manually scan the video to find the start/end times of the ads
> (seconds)
> >> - From this list the tool creates the ffmpeg commands to extract the
> parts
> >> *between* the ads as separate numbered mp4 files
> >> - Then a list of these small files is written to a file $JOINFILE
> >> - This is then used in an ffmpeg call like this:
> >>ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE
> >> - When this is done the small files and $JOINFILE are deleted
> >>
> >> So reading this thread I get the feeling that there is a way to use the
> list of
> >> cut times in a *single ffmpeg command* to create the output mp4 file
> *without*
> >> creating the list file and essentially doing everything in this single
> ffmpeg
> >> command.
> >
> >I have a short example in chapter 2.57 of my book:
> >http://www.astro-electronic.de/FFmpeg_Book.pdf
> >
>
> Michael, thanks a lot for your input!
>
> When using your book link I landed in a directory where I already had the
> April
> 25, 2021 version! Downloaded 13 months ago...
>
> This new version from May 28, 2022 is greatly expanded going from 553 to
> 821
> pages!
> Great work, thank you!
>
>
> So when I read the ch 2.57 I see that the sources of the concatenation
> operation
> are actual multiple video files.
>
> This is what I am already doing but it is a multiple-step process where
> there is
> one step where the short video files are created by cutting out of the main
> input video files based on start time and length for each cut. (Resolution:
> seconds.)
>
> Then these are pasted together using the concat with copy since they are
> cutouts
> from the same single input video and thus share the format.
>
> What has been asked in this thread is if there is a way to *combine* these
> operations such that there is no need for intermediate files...
>
> I.e. can ffmpeg be commanded to extract the sections to concatenate and
> feed
> them one after another into the concat operation without landing in a temp
> file
> inbetween?
>
> Further notes about your book example 2.57:
> ---
>
> The first line states:
> "In this example the concat filter is used for input videos of the same
> size and
> no audio."
>
> No audio is a non-starter for me.
>
> I need the audio to also be present in the output with preserved
> audio/video
> sync.
>
> It also says:
> "This filter does re-encode the videos, ..."
>
> Also something I want to avoid since it takes a long time to do and seems
> un-necessary since all of the parts being concatenated come from one and
> the
> same source video where parts are being edited out. Thus they share the
> same
> format.
>
> Basically when editing a single source video (with audio) the re-encoding
> should
> not be needed, right?
> Or am I missing something due to the use of compression?
>
> Every now and then some nob comes around with similar requests.

There is no straightforward bulletproof way to achieve this without
re-encoding and at same time using random videos as inputs,

Feel free to prove me wrong.


>
> --
> Bo Berglund
> Developer in Sweden
>
> ___
> 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 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 Bo Berglund
On Tue, 31 May 2022 13:15:02 +0200, Michael Koch 
wrote:

>Am 31.05.2022 um 11:17 schrieb Bo Berglund:
>> On Sun, 29 May 2022 13:17:55 +0200, Michael Koch 
>> 
>> wrote:
> 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.
>>>
>>> Michael
>> Stepping in here due to the interesting topic:
>>
>> I am daily using a tool I created myself to use ffmpeg to remove ads from
>> recorded mp4 TV news videos.
>> What I do is the following:
>> - I manually scan the video to find the start/end times of the ads (seconds)
>> - From this list the tool creates the ffmpeg commands to extract the parts
>> *between* the ads as separate numbered mp4 files
>> - Then a list of these small files is written to a file $JOINFILE
>> - This is then used in an ffmpeg call like this:
>>ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE
>> - When this is done the small files and $JOINFILE are deleted
>>
>> So reading this thread I get the feeling that there is a way to use the list 
>> of
>> cut times in a *single ffmpeg command* to create the output mp4 file 
>> *without*
>> creating the list file and essentially doing everything in this single ffmpeg
>> command.
>
>I have a short example in chapter 2.57 of my book:
>http://www.astro-electronic.de/FFmpeg_Book.pdf
>

Michael, thanks a lot for your input!

When using your book link I landed in a directory where I already had the April
25, 2021 version! Downloaded 13 months ago...

This new version from May 28, 2022 is greatly expanded going from 553 to 821
pages!
Great work, thank you!


So when I read the ch 2.57 I see that the sources of the concatenation operation
are actual multiple video files.

This is what I am already doing but it is a multiple-step process where there is
one step where the short video files are created by cutting out of the main
input video files based on start time and length for each cut. (Resolution:
seconds.)

Then these are pasted together using the concat with copy since they are cutouts
from the same single input video and thus share the format.

What has been asked in this thread is if there is a way to *combine* these
operations such that there is no need for intermediate files...

I.e. can ffmpeg be commanded to extract the sections to concatenate and feed
them one after another into the concat operation without landing in a temp file
inbetween?

Further notes about your book example 2.57:
---

The first line states:
"In this example the concat filter is used for input videos of the same size and
no audio."

No audio is a non-starter for me.

I need the audio to also be present in the output with preserved audio/video
sync.

It also says:
"This filter does re-encode the videos, ..."

Also something I want to avoid since it takes a long time to do and seems
un-necessary since all of the parts being concatenated come from one and the
same source video where parts are being edited out. Thus they share the same
format.

Basically when editing a single source video (with audio) the re-encoding should
not be needed, right?
Or am I missing something due to the use of compression?


-- 
Bo Berglund
Developer in Sweden

___
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 Michael Koch

Am 31.05.2022 um 11:17 schrieb Bo Berglund:

On Sun, 29 May 2022 13:17:55 +0200, Michael Koch 
wrote:

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.

Michael

Stepping in here due to the interesting topic:

I am daily using a tool I created myself to use ffmpeg to remove ads from
recorded mp4 TV news videos.
What I do is the following:
- I manually scan the video to find the start/end times of the ads (seconds)
- From this list the tool creates the ffmpeg commands to extract the parts
*between* the ads as separate numbered mp4 files
- Then a list of these small files is written to a file $JOINFILE
- This is then used in an ffmpeg call like this:
   ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE
- When this is done the small files and $JOINFILE are deleted

So reading this thread I get the feeling that there is a way to use the list of
cut times in a *single ffmpeg command* to create the output mp4 file *without*
creating the list file and essentially doing everything in this single ffmpeg
command.


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

Michael

___
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 Bo Berglund
On Sun, 29 May 2022 13:17:55 +0200, Michael Koch 
wrote:
>>> 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.
>
>Michael

Stepping in here due to the interesting topic:

I am daily using a tool I created myself to use ffmpeg to remove ads from
recorded mp4 TV news videos.
What I do is the following:
- I manually scan the video to find the start/end times of the ads (seconds)
- From this list the tool creates the ffmpeg commands to extract the parts
*between* the ads as separate numbered mp4 files
- Then a list of these small files is written to a file $JOINFILE
- This is then used in an ffmpeg call like this:
  ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE
- When this is done the small files and $JOINFILE are deleted

So reading this thread I get the feeling that there is a way to use the list of
cut times in a *single ffmpeg command* to create the output mp4 file *without*
creating the list file and essentially doing everything in this single ffmpeg
command.

> Paul B Mahol  writes:
> Using concat filter.

And this is repeated several times..

But the exact way to do this complete extraction given the multiple time slots
into a final single mp4 file using the concat filter is not described.

Please note that I *do* use concat in my command and I still have to first
separately cut out the parts to be concatenated...

How can these two steps be merged into a single ffmpeg command is something I
would also like to know.

The current strategy I use (as shown above) is producing a final video that has
some artifacts of the ads at the cut points and I hope that by doing it in a
single operation these will not be present.


-- 
Bo Berglund
Developer in Sweden

___
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 Nicolas George
Cecil Westerhof via ffmpeg-user (12022-05-29):
> I am going to ignore you.

Then I am going to ignore you.

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

And it is easy to do. But do not count on my help.

-- 
  Nicolas George


signature.asc
Description: PGP signature
___
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] 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 Michael Koch

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.


Michael

___
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 Paul B Mahol
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 <
> ffmpeg-user@ffmpeg.org> wrote:
> >
> >  Paul B Mahol  writes:
> >
> >  > On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> 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.

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

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



> --
> 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 Paul B Mahol
On Sat, May 28, 2022 at 9:46 PM Cecil Westerhof via ffmpeg-user <
ffmpeg-user@ffmpeg.org> wrote:

> Paul B Mahol  writes:
>
> > On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user <
> ffmpeg-user@ffmpeg.org> 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.

>
> --
> 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 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".


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

2022-05-28 Thread Paul B Mahol
On Sat, May 28, 2022 at 4:28 PM Cecil Westerhof via ffmpeg-user <
ffmpeg-user@ffmpeg.org> 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.


>
> --
> 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 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".