[FFmpeg-user] what is wrong with the map parameter?

2023-03-07 Thread Gabriel Dina
Hi,

I don't understand why the map parameter does not select only one video
stream:

ffmpeg -i 'uploads/movie.mov' -i ./assets/logo.png -filter_complex
"[1][0]scale2ref=w='iw*1/5':h='ow/mdar'[v1];[0][v1]overlay=main_w-overlay_w-5:5[out]"
-map '[out]:v:1' 'uploads/outputx.mp4'

 ffprobe uploads/outputx.mp4...

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'uploads/outputx.mp4':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
  Duration: 00:00:03.64, start: 0.00, bitrate: 521 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
smpte170m/bt709/bt709), 360x480, 255 kb/s, 29.97 fps, 29.97 tbr, 30k tbn,
59.94 tbc (default)
Metadata:
  handler_name: VideoHandler
  vendor_id   : [0][0][0][0]
  Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
smpte170m/bt709/bt709), 360x480, 255 kb/s, 29.97 fps, 29.97 tbr, 30k tbn,
59.94 tbc
Metadata:
  handler_name: VideoHandler


Thank you.
___
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] filter_complex with 2 images generates 3 files instead of one

2023-03-01 Thread Gabriel Dina
"In your example all three inputs are images, so the output can be only one
image."-> this doesn;t happen.

The output consists in:
1. the original image
2. the original image + logo
3. the original image + logo + info

I wish it were simpler!
Gabriel

On Wed, Mar 1, 2023 at 12:06 PM Michael Koch 
wrote:

> Am 01.03.2023 um 10:55 schrieb Gabriel Dina:
> > 1 frame, indeed, but is the first image without logo and info. Maybe it
> is
> > a way to get the last frame?
>
> In your example all three inputs are images, so the output can only one
> image.
>
> If the first input is a video, you could add -ss 5 before this input,
> where 5 is the time where the first frame is used.
>
> Extracting the last frame from a video is a little bit more complicated,
> see chapter 2.9 in 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".
>
___
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] filter_complex with 2 images generates 3 files instead of one

2023-03-01 Thread Gabriel Dina
ffmpeg -i uploads/image.mp4 -i ./assets/logo.png -i ./assets/info.png
-filter_complex "[1][0]scale2ref=w='iw
*1/5':h='ow/mdar'[v1];[2][0]scale2ref=w='iw*9/10':h='ow/mdar'[v2];[0][v1]overlay=main_w-overlay_w-5:5[vid];[vid][v2]overlay=10:main_h-overlay_h-10"
uploads/image%0d.mp4

If I remove %0d from the output I get an error.

Thank you
___
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] filter_complex with 2 images generates 3 files instead of one

2023-03-01 Thread Gabriel Dina
Updated command:

ffmpeg -i *uploads/test.png* -i ./assets/logo.png -i ./assets/telefon.png
-filter_complex
"[1][0]scale2ref=w='iw*1/5':h='ow/mdar'[v1];[2][0]scale2ref=w='iw*9/10':h='ow/mdar'[v2];[0][v1]overlay=main_w-overlay_w-5:5[vid];[vid][v2]overlay=10:main_h-overlay_h-10"*
test.png*


Result:

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg
developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --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-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl
--enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg
--enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil  56. 70.100 / 56. 70.100
  libavcodec 58.134.100 / 58.134.100
  libavformat58. 76.100 / 58. 76.100
  libavdevice58. 13.100 / 58. 13.100
  libavfilter 7.110.100 /  7.110.100
  libswscale  5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc55.  9.100 / 55.  9.100
Input #0, png_pipe, from 'uploads/test.png':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: png, rgba(pc), 512x512 [SAR 3779:3779 DAR 1:1], 25
fps, 25 tbr, 25 tbn, 25 tbc
Input #1, png_pipe, from './assets/logo.png':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Video: png, rgba(pc), 350x206 [SAR 11811:11811 DAR 175:103],
25 fps, 25 tbr, 25 tbn, 25 tbc
Input #2, png_pipe, from './assets/telefon.png':
  Duration: N/A, bitrate: N/A
  Stream #2:0: Video: png, rgba(pc), 1650x200 [SAR 11811:11811 DAR 33:4],
25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (png) -> scale2ref:ref
  Stream #0:0 (png) -> scale2ref:ref
  Stream #0:0 (png) -> overlay:main
  Stream #1:0 (png) -> scale2ref:default
  Stream #2:0 (png) -> scale2ref:default
  scale2ref:ref -> Stream #0:0 (png)
  scale2ref:ref -> Stream #0:1 (png)
  overlay -> Stream #0:2 (png)
Press [q] to stop, [?] for help
Output #0, image2, to 'test.png':
  Metadata:
encoder : Lavf58.76.100
  Stream #0:0: Video: png, rgba(pc, progressive), 512x512 [SAR 3779:3779
DAR 1:1], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
  encoder : Lavc58.134.100 png
  Stream #0:1: Video: png, rgba(pc, progressive), 512x512 [SAR 3779:3779
DAR 1:1], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
  encoder : Lavc58.134.100 png
  Stream #0:2: Video: png, rgba(pc, gbr/unknown/unknown, progressive),
512x512 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
  encoder : Lavc58.134.100 png
[image2 @ 0x5641d478bf80] Could not get frame filename number 2 from
pattern 'test.png'. Use '-frames:v 1' for a single image, or '-update'
option, or use a pattern such as %03d within the filename.
Error writing trailer of test.png: Invalid argument
frame=1 fps=0.0 q=-0.0 Lq=-0.0 q=-0.0 size=N/A time=00:00:00.04
bitrate=N/A speed=0.539x
video:150kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown







On Wed, Mar 1, 2023 at 11:25 AM Michael Koch 
wrote:

> Am 01.03.2023 um 10:23 schrieb Michael Koch:
> > Am 01.03.2023 um 10:12 schrieb Gabriel Dina:
> >> ffmpeg -i uploads/image.mp4 -i ./assets/logo.png -i ./assets/info.png
> >> -filter_complex "[1][0]scale2ref=w='iw
> >>
> *1/5':h='ow/mdar'[v1];[2][0]scale2ref=w='iw*9/10':h='ow/mdar'[v2];[0][v1]overlay=main_w-overlay_w-5:5[vid];[vid][v2]overlay=10:main_h-overlay_h-10"
>
> >>
> >> uploads/image%0d.mp4
> >>
> >> If I remove %0d from the output I get an error.
> >
> > please post the full console output.
>
> P.S. I mean with %0d removed.
>
> 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 "unsubsc

Re: [FFmpeg-user] filter_complex with 2 images generates 3 files instead of one

2023-03-01 Thread Gabriel Dina
1 frame, indeed, but is the first image without logo and info. Maybe it is
a way to get the last frame?

Many thanks.
Gabriel

On Wed, Mar 1, 2023 at 11:49 AM Michael Koch 
wrote:

> Am 01.03.2023 um 10:39 schrieb Gabriel Dina:
> > Updated command:
> >
> > ffmpeg -i *uploads/test.png* -i ./assets/logo.png -i ./assets/telefon.png
> > -filter_complex
> >
> "[1][0]scale2ref=w='iw*1/5':h='ow/mdar'[v1];[2][0]scale2ref=w='iw*9/10':h='ow/mdar'[v2];[0][v1]overlay=main_w-overlay_w-5:5[vid];[vid][v2]overlay=10:main_h-overlay_h-10"*
> > test.png*
>
> add -frames 1 just before the output file, this does limit the output to
> one frame.
>
> 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 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".