Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th May 2019, 14:52   #1  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 135
Delay audio by decding with FFMPEG and / or fill up end with silence

Not found some correct or working commands.

Which command do I need to delay (positiv/negative) an audio stream I am decoding into another format (uncompressed).
There is no video inside, only audio.

And appended question:
Is there a way to fill up the end of this audio with silence to some defined total-length of audiostream or trim it to that total-length:

1:27min real-length
1:30min wanted total-length
0:03min silence added to end

1:36min real-length
1:30min wanted total-length
0:06min trimmed from end
mbcd is offline   Reply With Quote
Old 16th May 2019, 15:42   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,494
Quote:
Originally Posted by mbcd View Post
Which command do I need to delay (positiv/negative) an audio stream I am decoding into another format (uncompressed).
Positive 2.5 seconds try: -itsoffset 2.5
Negative 2.5 seconds try: -ss 00:02.500

Quote:
Originally Posted by mbcd View Post
And appended question:
Is there a way to fill up the end of this audio with silence to some defined total-length of audiostream or trim it to that total-length:

1:27min real-length
1:30min wanted total-length
0:03min silence added to end
Try: -longest

Quote:
Originally Posted by mbcd View Post
1:36min real-length
1:30min wanted total-length
0:06min trimmed from end
Try: -shortest
sneaker_ger is offline   Reply With Quote
Old 16th May 2019, 15:58   #3  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 135
Thank you very much for this hints, but they not seem to work.

-itsoffset does not make any change, a "10.0" should give a 10 second delay, but nothing is applied, its still exact like the original. This command seems only to work if you have a container and sync video with audio.

-ss works, but thats only the trimming part at beginning.

-longest / shortest needs seperate streams as input as i suggest. I have only one single stream and wand to apply silense at the end or trim the end.

I tried with flac and wav as output, input is dts or ac3.

BTW: using Windows!

Last edited by mbcd; 16th May 2019 at 16:21.
mbcd is offline   Reply With Quote
Old 17th May 2019, 00:56   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,494
I see.

For delay (silence at beginning) try adelay filter. For silence at end try apad filter. To cut short use -to (similar to -ss).



P.S.: delaycut can losslessly do such operations on ac3 and dts, and it is easy to use. Maybe it is of interest to you.
sneaker_ger is offline   Reply With Quote
Old 17th May 2019, 22:30   #5  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 135
Thank you very much for your time, you were faster ... :-)

I came to the same conclusion, apad and adelay with apad=whole_dur there is a wonderfull command to define the total playtime.

For delay you have to specify each channel seperate, this is possible but "bad", but not a big problem, but you have to know the amount of channels before, dont unsterstand why there is no general delay for all channels.

-t is also possible for trimming to a total length.


delaycut looks nice, but I convert it to wave, also it should not be possible to cut dts-ma with it, but a nice hint, some years passed since I used it last time, is a great program!
mbcd is offline   Reply With Quote
Old 18th May 2019, 09:48   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,494
Quote:
Originally Posted by mbcd View Post
For delay you have to specify each channel seperate, this is possible but "bad", but not a big problem, but you have to know the amount of channels before, dont unsterstand why there is no general delay for all channels.
Yes, it's very .. peculiar.

But at least:
Quote:
You can use adelay='5|5|5|5|5|5|5|5|5'.. up to very high number.
Unused entries are ignored.
https://trac.ffmpeg.org/ticket/5855#comment:4
sneaker_ger is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.