filter_complex > apad and -shortest

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

filter_complex > apad and -shortest

Jon bae
Hello!

Is there a way to apply filter_complex with video filter + audio filter *apad
*and on top using -shortest in command line command?

When I run this:

*ffmpeg -i input.mp4 -filter_complex "[0:v]null;[0:a]apad,anull" -shortest
-f null -*

It end up in endless encoding...

ffmpeg version is the latest version from git master. ffmpeg output:

ffmpeg version git-2019-03-03-4635f64 Copyright (c) 2000-2019 the FFmpeg
developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --arch=x86_64 --disable-debug --disable-shared
--disable-doc --enable-gpl --enable-version3 --enable-runtime-cpudetect
--enable-avfilter --enable-zlib --enable-opencl --enable-opengl
--enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray
--enable-libsrt --enable-libzimg --enable-libtwolame --enable-libmp3lame
--enable-libopus --enable-libsoxr --enable-libaom --enable-libvpx
--enable-libx264 --enable-libx265 --enable-nonfree --enable-libfdk-aac
--enable-decklink
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.102 / 58. 47.102
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomiso2avc1mp41mp42
    encoder         : Lavf57.41.100
  Duration: 00:03:00.00, start: 0.000000, bitrate: 1892 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1024x576 [SAR 1:1 DAR 16:9], 1697 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 190 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 (h264) -> null
  Stream #0:1 (aac) -> apad
  null -> Stream #0:0 (wrapped_avframe)
  apad -> Stream #0:1 (pcm_s16le)
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomiso2avc1mp41mp42
    encoder         : Lavf58.26.101
    Stream #0:0: Video: wrapped_avframe, yuv420p(progressive), 1024x576
[SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.47.102 wrapped_avframe
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
(default)
    Metadata:
      encoder         : Lavc58.47.102 pcm_s16le
frame= 4500 fps= 48 q=-0.0 Lsize=N/A time=246:30:02.11 bitrate=N/A
speed=9.37e+03x
video:2355kB audio:166387896kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Michael Koch
Am 04.03.2019 um 11:28 schrieb Jon bae:

> Hello!
>
> Is there a way to apply filter_complex with video filter + audio filter *apad
> *and on top using -shortest in command line command?
>
> When I run this:
>
> *ffmpeg -i input.mp4 -filter_complex "[0:v]null;[0:a]apad,anull" -shortest
> -f null -*
>
> It end up in endless encoding...

If audio and video come from the same source, then don't they have
already the same length?

Michael

--
**********************************************
   ASTRO ELECTRONIC   Dipl.-Ing. Michael Koch
        Raabestr. 43   37412 Herzberg
           www.astro-electronic.de
   Tel. +49 5521 854265   Fax +49 5521 854266
**********************************************

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Moritz Barsnick
On Mon, Mar 04, 2019 at 11:45:16 +0100, Michael Koch wrote:
> If audio and video come from the same source, then don't they have
> already the same length?

Not necessarily. Streams within a container can have different lengths.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Gyan
In reply to this post by Jon bae


On 04-03-2019 03:58 PM, Jon bae wrote:
> ffmpeg -i input.mp4 -filter_complex "[0:v]null;[0:a]apad,anull" -shortest
> -f null -*
Reproduced. Happens when all output streams are emitted from the same
filtergraph.

Doesn't happen with, e.g.

     ffmpeg -i input.mp4 -filter_complex "[0:v]null" -filter_complex
"[0:a]apad,anull" -shortest -f null -


Open a ticket at trac.ffmpeg.org, but search first - there may already
be one.

Thanks,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Moritz Barsnick
On Mon, Mar 04, 2019 at 17:21:08 +0530, Gyan wrote:
> Reproduced. Happens when all output streams are emitted from the same
> filtergraph.
[...]
> Open a ticket at trac.ffmpeg.org, but search first - there may already
> be one.

There is already one:
https://trac.ffmpeg.org/ticket/3789
"shortest command doesnt work when using a filter_complex with audio
and video filters"

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Jon bae
Am Mo., 4. März 2019 um 13:21 Uhr schrieb Moritz Barsnick <[hidden email]
>:

> On Mon, Mar 04, 2019 at 17:21:08 +0530, Gyan wrote:
> > Reproduced. Happens when all output streams are emitted from the same
> > filtergraph.
> [...]
> > Open a ticket at trac.ffmpeg.org, but search first - there may already
> > be one.
>
> There is already one:
> https://trac.ffmpeg.org/ticket/3789
> "shortest command doesnt work when using a filter_complex with audio
> and video filters"
>

Ah good that you post this! I was almost starting to write a ticked :).

Gyan writes that the error goes away when using two filter_complex
commands. Are we still able in future to use two filter_complex graphs?
Because multiple *-vf/-af *are not allowed.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: filter_complex > apad and -shortest

Gyan


On 04-03-2019 06:01 PM, Jon bae wrote:

> Am Mo., 4. März 2019 um 13:21 Uhr schrieb Moritz Barsnick <[hidden email]
>> :
>> On Mon, Mar 04, 2019 at 17:21:08 +0530, Gyan wrote:
>>> Reproduced. Happens when all output streams are emitted from the same
>>> filtergraph.
>> [...]
>>> Open a ticket at trac.ffmpeg.org, but search first - there may already
>>> be one.
>> There is already one:
>> https://trac.ffmpeg.org/ticket/3789
>> "shortest command doesnt work when using a filter_complex with audio
>> and video filters"
>>
> Ah good that you post this! I was almost starting to write a ticked :).
>
> Gyan writes that the error goes away when using two filter_complex
> commands. Are we still able in future to use two filter_complex graphs?
> Because multiple *-vf/-af *are not allowed.
>
Multiple -vf/-af for the *same* output stream is not allowed. Multiple
filter_complex can be used on the same input stream to generate however
many new output streams.

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".