Re: [FFmpeg-user] how to set the color background when i use overlay_qsv

2022-01-26 Thread Xiang, Haihao
On Thu, 2022-01-27 at 11:04 +0800, zha...@bstar.com.cn wrote:
> hello:
> I want to splice four or more video into one video,i want to set the
> background to a fixed size and the color is black, so i must scale the image
> then overlay. 
> 
> My environment is ubuntu and I used command is:
> 
> ffmpeg -i h1.mp4 -i h2.mp4 -i h3.mp4 -i h4.mp4 -filter_complex
> "color=c=black:s=1920x1080[bg];[0:v]scale=iw/2:-1[img0];[1:v]scale=iw/2:-
> 1[img1];[2:v] scale=iw/2:-1[img2];[3:v]scale=iw/2:-
> 1[img3];[bg][img0]overlay=shortest=1[out0];[out0][img1]overlay=shortest=1:x=w[
> out1];[out1][img2]overlay=shortest=1:y=h[out2];[out2][img3]overlay=shortest=1:
> x=w:y=h" -y out.mp4
> 
> --
> --
> -
> the comman is correct,but when i change it to qsv. It's not working correctly:
> 
> ./ffmpeg -hwaccel qsv -c:v h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv
> -i h2.mp4 -hwaccel qsv -c:v h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i
> h4.mp4 -filter_complex "color=black:r=30:size=1920x1080:sar=1/1,
> hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v
> ]scale_qsv=iw/2:ih/2[img1];[2:v]
> scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv
> =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove
> rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y
> out.mp4
> 
>  output:
> [hwupload @ 0x5593003e07c0] A hardware device reference is required to upload
> frames to.
> [Parsed_hwupload_1 @ 0x5593003e0680] Query format failed for
> 'Parsed_hwupload_1': Invalid argument
> Error reinitializing filters!
> Failed to inject frame into filter network: Invalid argument
> Error while processing the decoded data for stream #3:0
> Conversion failed!
> --
> --
> 
> ./ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -c:v
> h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv -i h2.mp4 -hwaccel qsv -c:v
> h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i h4.mp4 -filter_complex
> "color=black:r=30:size=1920x1080:sar=1/1,
> hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v
> ]scale_qsv=iw/2:ih/2[img1];[2:v]
> scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv
> =shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]ove
> rlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h" -y
> out.mp4
> 
> 
> output:
> [Parsed_overlay_qsv_7 @ 0x563881a99180] Inputs with different underlying QSV
> devices are forbidden.
> [Parsed_overlay_qsv_7 @ 0x563881a99180] Failed to configure output pad on
> Parsed_overlay_qsv_7
> Error reinitializing filters!
> Failed to inject frame into filter network: Invalid argument
> Error while processing the decoded data for stream #3:0
> Conversion failed!
> --
> --
> 
> I want to know How can I modify my command to run correctly. Thank you.

What is the version of your FFmpeg? Your command work for me with the latest
FFmpeg (https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/refs/heads/master).
There is a green line at the bottom of each scaled image with your command, you
may try vpp_qsv instead of scale_qsv. We will fix the green line issue in
scale_qsv

Thanks
Haihao

___
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] how to set the color background when i use overlay_qsv

2022-01-26 Thread zha...@bstar.com.cn
hello:
I want to splice four or more video into one video,i want to set the 
background to a fixed size and the color is black, so i must scale the image 
then overlay. 

My environment is ubuntu and I used command is:

ffmpeg -i h1.mp4 -i h2.mp4 -i h3.mp4 -i h4.mp4 -filter_complex 
"color=c=black:s=1920x1080[bg];[0:v]scale=iw/2:-1[img0];[1:v]scale=iw/2:-1[img1];[2:v]
 
scale=iw/2:-1[img2];[3:v]scale=iw/2:-1[img3];[bg][img0]overlay=shortest=1[out0];[out0][img1]overlay=shortest=1:x=w[out1];[out1][img2]overlay=shortest=1:y=h[out2];[out2][img3]overlay=shortest=1:x=w:y=h"
 -y out.mp4

-
the comman is correct,but when i change it to qsv. It's not working correctly:

./ffmpeg -hwaccel qsv -c:v h264_qsv -i h1.mp4 -hwaccel qsv -c:v h264_qsv -i 
h2.mp4 -hwaccel qsv -c:v h264_qsv -i h3.mp4 -hwaccel qsv -c:v h264_qsv -i 
h4.mp4 -filter_complex "color=black:r=30:size=1920x1080:sar=1/1, 
hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v]scale_qsv=iw/2:ih/2[img1];[2:v]
 
scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv=shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]overlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h"
 -y out.mp4

 output:
[hwupload @ 0x5593003e07c0] A hardware device reference is required to upload 
frames to.
[Parsed_hwupload_1 @ 0x5593003e0680] Query format failed for 
'Parsed_hwupload_1': Invalid argument
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #3:0
Conversion failed!

./ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -c:v h264_qsv 
-i h1.mp4 -hwaccel qsv -c:v h264_qsv -i h2.mp4 -hwaccel qsv -c:v h264_qsv -i 
h3.mp4 -hwaccel qsv -c:v h264_qsv -i h4.mp4 -filter_complex 
"color=black:r=30:size=1920x1080:sar=1/1, 
hwupload=extra_hw_frames=64,format=qsv[bg];[0:v]scale_qsv=iw/2:ih/2[img0];[1:v]scale_qsv=iw/2:ih/2[img1];[2:v]
 
scale_qsv=iw/2:ih/2[img2];[3:v]scale_qsv=iw/2:ih/2[img3];[bg][img0]overlay_qsv=shortest=1[out0];[out0][img1]overlay_qsv=shortest=1:x=w[out1];[out1][img2]overlay_qsv=shortest=1:y=h[out2];[out2][img3]overlay_qsv=shortest=1:x=w:y=h"
 -y out.mp4


output:
[Parsed_overlay_qsv_7 @ 0x563881a99180] Inputs with different underlying QSV 
devices are forbidden.
[Parsed_overlay_qsv_7 @ 0x563881a99180] Failed to configure output pad on 
Parsed_overlay_qsv_7
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #3:0
Conversion failed!

I want to know How can I modify my command to run correctly. 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] How to submit sample media

2022-01-26 Thread Carl Eugen Hoyos
Am Mi., 26. Jan. 2022 um 00:13 Uhr schrieb Whatsthis :
>
> The webpage stating the upload procedure
> (https://ffmpeg.org/bugreports.html#SubmittingSampleMedia) also says:
>
> > Furthermore movie files uploaded to services like rapidshare or any other
> > similar service will be ignored. We are not willing to spend our time 
> > fighting
> > with this ridiculous, bloated and spam-filled crap."

It is still true that hosters that require registration (or only work
with Windows browsers) likely will be ignored.

Carl Eugen
___
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] how to avoid broken pi

2022-01-26 Thread meex

> This is not a problem with ffmpeg. You should configure your shell to
> set the tty to a sane state before a prompt. With zsh, it is done with
> "ttyctl -f".

thanks for the tip - i've been looking into this and not understanding 
how to accomplish it


for bash the command is stty and it seems the relevant options are:
ixany
ixoff
ixon

what i don't understand is 1) which one(s) to use and 2) how to use them 
in a shell script; should this be near the top of the script so it's 
global, or should these options be enabled/disabled as needed per-command?


Nicolas George wrote:

meex (12022-01-26):

in a bash script i'm using ffmpeg to create a spectrogram movie and pipe the
output to a decoder (mpv in this case, but it doesn't matter)

as expected, if the user exits mpv before ffmpeg completes, it returns a
broke pipe error and i would like to avoid that if possible

the problem is that the terminal may refuse to accept any user input when
this happens (this occurs ~20% of the time)


This is not a problem with ffmpeg. You should configure your shell to
set the tty to a sane state before a prompt. With zsh, it is done with
"ttyctl -f".


is there a way to have ffmpeg exit gracefully when the pipe is broken?


Again, it is not ffmpeg's responsibility:

Compare:

ssecem ~ $ sh -c "dmesg" | head -n 1
[0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
zsh: exit 141   sh -c "dmesg" |
zsh: done   head -n 1

ssecem ~ $ sh -c "trap '' PIPE; dmesg" | head -n 1
[0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
dmesg: write error
zsh: exit 1 sh -c "trap '' PIPE; dmesg" |
zsh: done   head -n 1

Regards,


___
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] Error while hardcoding subtitles (Invalid object location)

2022-01-26 Thread Carl Eugen Hoyos
Am Mo., 24. Jan. 2022 um 19:46 Uhr schrieb Sergey_S :
>
> C:\Users\shuts\Downloads\ffmpeg-2022-01-19-git-dd17c86aa1-essentials_build\bin>ffmpeg
> -i C:\Users\shuts\Desktop\Ep1.ts -vcodec libx264 -s 720x576 -g 50
> -keyint_min 50 -sc_threshold 0 -vprofile main -level 4.1 -b:v 3000K
> -maxrate 3000K -bufsize 6000K -r 25.000 -acodec aac -ar 48000 -ac 2 -ab
> 128k -async 2 -filter_complex "[0:v][0:s:1]overlay[v]" -map "[v]" -map 0:a

Does the error disappear if you don't use "-s" if you are using "filter_complex"
(as you have to)?

> -f mpegts C:\Users\shuts\Desktop\8.ts

"-f mpegts" looks strange in this command line (but that may only be me).

Carl Eugen
___
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] how to avoid broken pi

2022-01-26 Thread Nicolas George
meex (12022-01-26):
> in a bash script i'm using ffmpeg to create a spectrogram movie and pipe the
> output to a decoder (mpv in this case, but it doesn't matter)
> 
> as expected, if the user exits mpv before ffmpeg completes, it returns a
> broke pipe error and i would like to avoid that if possible
> 
> the problem is that the terminal may refuse to accept any user input when
> this happens (this occurs ~20% of the time)

This is not a problem with ffmpeg. You should configure your shell to
set the tty to a sane state before a prompt. With zsh, it is done with
"ttyctl -f".

> is there a way to have ffmpeg exit gracefully when the pipe is broken?

Again, it is not ffmpeg's responsibility:

Compare:

ssecem ~ $ sh -c "dmesg" | head -n 1
[0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
zsh: exit 141   sh -c "dmesg" |
zsh: done   head -n 1

ssecem ~ $ sh -c "trap '' PIPE; dmesg" | head -n 1
[0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
dmesg: write error
zsh: exit 1 sh -c "trap '' PIPE; dmesg" |
zsh: done   head -n 1

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


[FFmpeg-user] how to avoid broken pi

2022-01-26 Thread meex



in a bash script i'm using ffmpeg to create a spectrogram movie and pipe 
the output to a decoder (mpv in this case, but it doesn't matter)


as expected, if the user exits mpv before ffmpeg completes, it returns a 
broke pipe error and i would like to avoid that if possible


the problem is that the terminal may refuse to accept any user input 
when this happens (this occurs ~20% of the time)


is there a way to have ffmpeg exit gracefully when the pipe is broken?

$ ffmpeg -i 'a.flac' -filter_complex 
"[0:a]showspectrum=mode=separate:color=intensity:scale=cbrt:s=1280x518[top]; 
[0:a]showwaves=s=1280x202:mode=point:colors=white[bottom]; 
[top][bottom]vstack" -map 0:a -codec:v libx264 -preset fast -crf 18 
-codec:a copy -f matroska - | mpv --no-config -- -

ffmpeg version n4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static 
--disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm 
--enable-lto --enable-fontconfig --enable-gmp --enable-gnutls 
--enable-gpl --enable-ladspa --enable-libaom --enable-libass 
--enable-libbluray --enable-libdav1d --enable-libdrm 
--enable-libfreetype --enable-libfribidi --enable-libgsm 
--enable-libiec61883 --enable-libjack --enable-libmfx 
--enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb 
--enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus 
--enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr 
--enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 
--enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf 
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 
--enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid 
--enable-libzimg --enable-nvdec --enable-nvenc --enable-shared 
--enable-version3

  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, flac, from 'a.flac':
  Metadata:
GENRE   : Soft
TITLE   : 17th Street
ARTIST  : 2 Good To Go
COMMENT : Muzik Faktry v20211226 12/26/2021
REPLAYGAIN_REFERENCE_LOUDNESS: 89.0 dB
REPLAYGAIN_TRACK_GAIN: -6.36 dB
REPLAYGAIN_TRACK_PEAK: 1.
REPLAYGAIN_ALBUM_GAIN: -6.36 dB
REPLAYGAIN_ALBUM_PEAK: 1.
  Duration: 00:03:38.00, start: 0.00, bitrate: 953 kb/s
  Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Side data:
  replaygain: track gain - -6.36, track peak - 0.23, album 
gain - -6.36, album peak - 0.23,

Stream mapping:
  Stream #0:0 (flac) -> showspectrum
  Stream #0:0 (flac) -> showwaves
  vstack -> Stream #0:0 (libx264)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x5627f9f5aa00] using SAR=1/1
[libx264 @ 0x5627f9f5aa00] MB rate (15876) > level limit (16711680)
[libx264 @ 0x5627f9f5aa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5627f9f5aa00] profile High 4:4:4 Predictive, level 6.2, 
4:4:4, 8-bit
[libx264 @ 0x5627f9f5aa00] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 
AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - 
options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf 
mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 
aq=1:1.00

Output #0, matroska, to 'pipe:':
  Metadata:
GENRE   : Soft
TITLE   : 17th Street
ARTIST  : 2 Good To Go
COMMENT : Muzik Faktry v20211226 12/26/2021
REPLAYGAIN_REFERENCE_LOUDNESS: 89.0 dB
REPLAYGAIN_TRACK_GAIN: -6.36 dB
REPLAYGAIN_TRACK_PEAK: 1.
REPLAYGAIN_ALBUM_GAIN: -6.36 dB
REPLAYGAIN_ALBUM_PEAK: 1.
encoder : Lavf58.76.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv444p(progressive), 
1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1k tbn (default)

Metadata:
  encoder : Lavc58.134.100 libx264
Side data:
  cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: flac ([172][241][0][0] / 0xF1AC), 44100 Hz, 
stereo, s16

Side data:
  replaygain: track gain - -6.36, track peak - 0.23, album 
gain - -6.36, album peak - 0.23,

[file] Reading from stdin...
frame=1 fps=0.0 q=0.0 size=   1kB time=00:00:00.74 bitrate= 

[FFmpeg-user] Ubuntu 21.10 ffmpeg 4.4 compile- libzmq3-dev *fail*

2022-01-26 Thread Matt C
Not sure if the is a libzmq or ffmpeg issue...
On Ubuntu 21.10 while compiling ffmpeg 4.4 and trying to include
--enable-libzmq
FFmpeg cannot find libzmq and is specifically looking for: libzmq 4.2.1 even 
when I have
sudo apt-get install libzmq3-dev
This does not happen on Ubuntu 20.04.
The only way I could get libzmq to work was to use gcc 9, get 
zeromq-4.2.1.tar.gz
./autogen.sh ./configure make sudo make install
That let ffmpeg compile but it was messing everything else up so that is not a 
solution.
Only other info I could find was here, looks like this has maybe happened 
before?
https://github.com/conda-forge/zeromq-feedstock/issues/16

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