Re: [FFmpeg-user] Increased latency from filter_complex

2021-07-29 Thread Paul B Mahol
On Thu, Jul 29, 2021 at 7:13 PM  wrote:

> Hi Paul,
>
> thanks again for answering.
>
> > Please show how you use sidechaincompress filter.
>
> Basically we did what is mentioned here:
>
>
> https://superuser.com/questions/1093607/ffmpeg-sidechaincompress-give-more-importance-to-the-sidechain
>
> We too found no audible difference between ratio 1 and ratio 20.
>
> But this all doesn't touch the initial question I contacted the mailing
> list for.
> We found that applying any ducking increased latency. by ~8 seconds and
> for every additional audio track it added 8 seconds on top.
>

Is sidechaincompress adding 8 seconds of latency too?

ratio in processing is used with other options in parallel, especially
threshold.

Copying random commands with little or no understanding how filter is
working will get you nowhere.

Please read documentation of sidechaincompress filter, and experiment with
command provided in documentation.
Probably need to use amix filter instead of amerge as last filter in
filtergraph.



>
> So it seems like the analyzing of the the audio tracks happens sequentially
> at least for the filters we used.
> What I wanted to know is, if there are ways to write those differently to
> mitigate this problem.
> In case of the sidechain filter, if this is handled sequentially too, the
> problem would still be there, even if a sidechain might be less workload.
>
> @all Anybody else knows how to do this in parallel instead?
>

Latency of loudnorm and dynaudnorm filters are extremely high compared to
sidechaincompress, always couple of seconds.

And keeping using those filters you will never expect less latency.

You can control latency in some cases with asetnsamples filter as first
filter in filtergraph.

Also if you willing to provide input demo files I may look more into this,
to help you get correct filtergraph.

Also note that encoder may add additional latency.





>
> Thanks
>
> Philipp
> ___
> 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".


[FFmpeg-user] single image + audio -> mp4 -> hls results in unplayable file

2021-07-29 Thread Duncan Robertson
The application I am working on converts a video or audio file to an mp4, and 
later on the server to an hls playlist. I just implemented audio and I wanted a 
background image. After reading through various options on stackoverflow I 
settled on the following args:

-y -i "C:\path\ExternalAudioBackground.png" -i "C:\path\Audio.mp3" -vf 
scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1:color=black
 -c:a copy -vcodec libx264 -pix_fmt yuv420p "C:\path\external_media_file.mp4"

This set of args was chosen because it is instantaneous due to -c:a copy as 
well as constraints to ensure all videos have the same aspect ratio and 
encoding.

The issue is when converting this to an hls stream the stream fails to play (in 
video.js player, and also vlc) with the message :

VIDEOJS: WARN: Segment with index 0 from playlist 0-https://domain/video.m3u8 
has a duration of 464.96 when the reported duration is 0.04 and the target 
duration is 0.04. For HLS content, a duration in excess of the target duration 
may result in playback issues. See the HLS specification section on 
EXT-X-TARGETDURATION for more details: 
https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1 


Adding -loop 1 to the start increases the processing time from millseconds to 
minutes, but produces a working file

Adding -r 1 and -loop 1 takes longer to process than without -r (!?)

Adding  -stream_loop 116 (116 is the length of the audio in seconds divided by 
4, the desired hls segment size) before the image input loops the first 4 
seconds of the audio over and over


In case relevant, the hls encoding arguments look like this:

-safe 0 -f concat -i listOfFiles.txt -c:a aac -ar 48000 -b:a 128k -vcodec copy 
-crf 20 -g 48 -keyint_min 48 -sc_threshold 0 -b:v 2500k -maxrate 2675k -bufsize 
3750k -hls_time 4 -hls_playlist_type vod  -hls_segment_filename segment-%03d.ts 
result.m3u8

listOfFiles.txt always contains only one file in the case being discussed.


How can I achieve this with the minimum processing time but still have the file 
convertable to HLS?

Also, is it a bug that ffmpeg fails to convert its own output into a valid hls 
file? Should I report this?


Duncan

___
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] Increased latency from filter_complex

2021-07-29 Thread technik+ffmpeg

Hi Paul,

thanks again for answering.


Please show how you use sidechaincompress filter.


Basically we did what is mentioned here:

https://superuser.com/questions/1093607/ffmpeg-sidechaincompress-give-more-importance-to-the-sidechain

We too found no audible difference between ratio 1 and ratio 20.

But this all doesn't touch the initial question I contacted the mailing
list for.
We found that applying any ducking increased latency. by ~8 seconds and
for every additional audio track it added 8 seconds on top.

So it seems like the analyzing of the the audio tracks happens sequentially
at least for the filters we used.
What I wanted to know is, if there are ways to write those differently to
mitigate this problem.
In case of the sidechain filter, if this is handled sequentially too, the
problem would still be there, even if a sidechain might be less workload.

@all Anybody else knows how to do this in parallel instead?

Thanks

Philipp
___
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] -pix_fmt + pixel format conversions

2021-07-29 Thread Nicolas George
Green Koopa (12021-07-29):
> My input file is yuvj420p(pc, bt709). My target output is
> yuv420p(tv, bt709). I would like to use "-pix_fmt +yuv420p"
> to specify the output format, and to force me to be explicit
> in my conversions in the filtergraph. How do I achieve
> explicit conversions? The format filter appears to trigger
> implicit conversions.

The format filter does not do the conversions, it only forces the format
at a certain point in the filter graph.

The standard filter for converting between pixel formats is scale. In
certain cases, I hear zscale can be more suited, but I never looked at
the specifics.

Regards,

-- 
  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] -pix_fmt + pixel format conversions

2021-07-29 Thread Michael Koch

Am 29.07.2021 um 09:12 schrieb Green Koopa:

My input file is yuvj420p(pc, bt709). My target output is
yuv420p(tv, bt709). I would like to use "-pix_fmt +yuv420p"
to specify the output format, and to force me to be explicit
in my conversions in the filtergraph. How do I achieve
explicit conversions? The format filter appears to trigger
implicit conversions.

"crop=2704:1520:0:0,format=yuv420p,eq=saturation=1.2"
causes error
The filters 'Parsed_crop_0' and 'Parsed_format_1' do not have
a common format and automatic conversion is disabled.

If I go back to relying on implicit conversions, how do I
output these automatically added filters?


Add "-v verbose" to your command line and then search for the green 
lines in the console listing.


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


[FFmpeg-user] -pix_fmt + pixel format conversions

2021-07-29 Thread Green Koopa
My input file is yuvj420p(pc, bt709). My target output is
yuv420p(tv, bt709). I would like to use "-pix_fmt +yuv420p"
to specify the output format, and to force me to be explicit
in my conversions in the filtergraph. How do I achieve
explicit conversions? The format filter appears to trigger
implicit conversions.

"crop=2704:1520:0:0,format=yuv420p,eq=saturation=1.2"
causes error
The filters 'Parsed_crop_0' and 'Parsed_format_1' do not have
a common format and automatic conversion is disabled.

If I go back to relying on implicit conversions, how do I
output these automatically added filters?


ffmpeg version 4.4-essentials_build-www.gyan.dev
on Windows 10
___
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] Increased latency from filter_complex

2021-07-29 Thread Paul B Mahol
On Wed, Jul 28, 2021 at 10:11 PM  wrote:

> Hi Paul,
> thanks for your answer.
>
> > 3 loudnorm calls and 2 dynaudnorm calls?
> > for ducking there is sidechaincompress filter
>
> We tried sidechain of course, but will try this again.
> Our problem is, that the resulting audio from the sidechaincompress never
> reached the same quality. The audio from the primary channel also never got
> down to a level, where the secondary audio could be understood without
> problems.
> If you have any parameters or tips how to achieve this, please share.
> Thank you.
>
> But regarding the central difficulty, the increasing latency from - what
> we suspect serial instead of parallel processing of the audio channels -
> this does not help.
> Or is sidechaincompress being handled differently?
>

Please show how you use sidechaincompress filter.


>
> Thank you for your time.
>
> Philipp
> ___
> 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".