Re: [FFmpeg-user] How to submit sample media

2022-01-25 Thread 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."


Could have saved both of our time, if that webpage was corrected.
___
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] drawbox: text subpixel rendering (IO bootleneck)

2022-01-25 Thread Nikita Zlobin
Found reason - it's due to 'format=gray' before [new] pad. After I
removed that conversion - it's again at full fps even with all ffmpeg
job done in one instance, with only cat for loopback.

Output from it goes to overlay, which supports only yuv and rgb. Not
sure, if that's reason.

But still - why would not this choke cause cpu load?

In Tue, 25 Jan 2022 05:58:04 +0500
Nikita Zlobin  wrote:

> I managed to get it working with overlay, using tee & named fifo.
> 
> In first attempt I had two ffmpeg instance:
> 1 - creating new image, merging with accumulator image and sending to
> tee, which makes split job, redirecting it to second ffmpeg.
> 2 - takes output from ffmpeg-1 and shifts, preparing for new merge,
> and feeds it to fifo, where ffmpeg-1 reads it again. But before
> ffmpeg-2 starts, ffmpeg-1 is seeded by null "starter" frame,
> generated by awk, so that loop can start (I tried - it will not
> without initial seed).
> 
> That was able to reach 1150 fps.
> 
> I expected, that doing all job in one ffmpeg would give better speed.
> Actual ffmpeg command:
> 
> stdbuf -o0 ffmpeg -nostdin -v verbose \
>   -vcodec rawvideo -f rawvideo -pix_fmt gray -s 1x1-i pipe:0 \
>   -vcodec rawvideo -f rawvideo -pix_fmt gray -s ${w}x${h}\
>   -i "${loop_src}" -filter_complex "
>   [0:v]
>   scale = iw : 128 : flags = neighbor,
>   geq = lum='
> if( gt(Y, H - p(X,Y) * H / 255 ),
> 80
> )',
>   scale = iw : $h : flags = bicubic,
>   format = gray
>   [new];
>   [1:v]
>   convolution = 0 0 1 : 0mode = row,
>   format = gray
>   [acc_out];
>   [acc_out] [new]
>   overlay = W-1 : 0,
>   format = gray
> " -vcodec rawvideo -f rawvideo - | stdbuf -o0 tee "${loop_src}"
> 
> and seed command:
> 
> stdbuf -o0 awk 'BEGIN { 
>   for (i = 0; i < ('$w'*'$h'); i++)
> printf "\0"
>   exit
> }' > "${loop_src}" &
> 
> (as for loop_sink - it was used for second loop).
> 
> But instead - strange bootleneck appeared, keeping fps between 200 and
> 100. However, it's not cpu load - I can barely notice it. Suspecting
> IO problem. At least during start - visible graphic movement speed
> erratically increased, but otherwise was constrained.
> 
> I tried to change stdbuf -o to have buffer with size just to
> hold output frame, but it did not make a difference.
> 
> Is it possible to reduce it without second ffmpeg instance?

___
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-25 Thread 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
-f mpegts C:\Users\shuts\Desktop\8.ts
ffmpeg version 2022-01-19-git-dd17c86aa1-essentials_build-www.gyan.dev
Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib
--enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq
--enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg
--enable-libvpx --enable-mediafoundation --enable-libass
--enable-libfreetype --enable-libfribidi --enable-libvidstab
--enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
--enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc
--enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme
--enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame
--enable-libtheora --enable-libvo-amrwbenc --enable-libgsm
--enable-libopencore-amrnb --enable-libopus --enable-libspeex
--enable-libvorbis --enable-librubberband
  libavutil  57. 18.100 / 57. 18.100
  libavcodec 59. 20.100 / 59. 20.100
  libavformat59. 17.101 / 59. 17.101
  libavdevice59.  5.100 / 59.  5.100
  libavfilter 8. 26.100 /  8. 26.100
  libswscale  6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc56.  4.100 / 56.  4.100
Input #0, mpegts, from 'C:\Users\shuts\Desktop\Ep1.ts':
  Duration: 00:03:23.17, start: 0.177656, bitrate: 52106 kb/s
  Program 1
  Stream #0:0[0x100]: Video: mpeg2video (4:2:2) ([2][0][0][0] / 0x0002),
yuv422p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 5 kb/s, 25 fps,
25 tbr, 90k tbn
Side data:
  cpb: bitrate max/min/avg: 5000/0/0 buffer size: 47185920
vbv_delay: N/A
  Stream #0:1[0x101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
5.1(side), fltp, 448 kb/s
  Stream #0:2[0x106](ell): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
  Stream #0:3[0x102](ell): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 (mpeg2video) -> overlay (graph 0)
  Stream #0:3 (dvbsub) -> overlay (graph 0)
  overlay:default (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[mpegts @ 01cafa6dd4c0] sub2video: using 1920x1080 canvas
[libx264 @ 01cafa6e6040] using SAR=64/45
[libx264 @ 01cafa6e6040] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 01cafa6e6040] profile Main, level 4.1, 4:2:0, 8-bit
-async is forwarded to lavfi similarly to -af
aresample=async=2:min_hard_comp=0.10:first_pts=0.
Output #0, mpegts, to 'C:\Users\shuts\Desktop\8.ts':
  Metadata:
encoder : Lavf59.17.101
  Stream #0:0: Video: h264, yuv420p(tv, progressive), 720x576 [SAR 64:45
DAR 16:9], q=2-31, 3000 kb/s, 25 fps, 90k tbn
Metadata:
  encoder : Lavc59.20.100 libx264
Side data:
  cpb: bitrate max/min/avg: 300/0/300 buffer size: 600
vbv_delay: N/A
  Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
  encoder : Lavc59.20.100 aac
[dvbsub @ 01cafab897c0] Invalid object location! 526-526 0-60
002744.5kbits/s speed=0.933x
[dvbsub @ 01cafab897c0] Invalid object location! 526-526 1-60 00
[dvbsub @ 01cafab897c0] Invalid object location! 280-280 0-76
003195.2kbits/s speed=0.914x
[dvbsub @ 01cafab897c0] Invalid object location! 280-280 1-76 00
[dvbsub @ 01cafab897c0] Invalid object location! 280-280 0-76
003185.5kbits/s speed=0.898x
[dvbsub @ 01cafab897c0] Invalid object location! 280-280 1-76 00
[dvbsub @ 01cafab897c0] Invalid object location! 963-963 0-76
003180.2kbits/s speed=0.891x
[dvbsub @ 01cafab897c0] Invalid object location! 963-963 1-76 00
[dvbsub @ 01cafab897c0] Invalid object location! 145-145 0-76
003166.4kbits/s speed=0.886x
[dvbsub @ 01cafab897c0] Invalid object location! 145-145 1-76 00
[dvbsub @ 01cafab897c0] Invalid object location! 952-952 0-161
00178.4kbits/s speed=0.882x
[dvbsub @ 01cafab897c0] Invalid object location! 952-952 1-161 00
[dvbsub @ 01cafab897c0] Invalid object location! 722-722 0-77
003179.5kbits/s speed=0.88x
[dvbsub @ 01cafab897c0] Invalid object location! 722-722 1-77 00
[dvbsub @ 01cafab897c0] Invalid object location! 375-375 0-75
003177.3kbits/s speed=0.88x
[dvbsub @ 01cafab897c0] Invalid object location! 375-375 1-75 00
[dvbsub @ 01cafab897c0] Invalid object location! 375-375 

Re: [FFmpeg-user] How to properly pasting same-size video parts together into one output?

2022-01-25 Thread LuKaRo
There is lots of information regarding this topic in the ffmpeg wiki: 
https://trac.ffmpeg.org/wiki/Concatenate You can use the concatenate 
filter if you want to concatenate video files with different formats and 
re-encode them in one step. This may also solve issues with other 
concatenation methods.


Regards,

LuKaRo

___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Bo Berglund
On Tue, 25 Jan 2022 12:00:53 +0100, Bo Berglund  wrote:

>So far so good, now the remaining problem I have is that the file size is blown
>up considerably..
>
>input1.mp4 =98,302,009 bytes
>input2.mp4 =53,629,084 bytes
>1.mpg is   =   930,535,424 bytes
>2.mpg is   =   385,169,408 bytes
>output.mp4 = 1,095,027,291 bytes
>
>Is there a way to reduce the size of the final mp4 too?
>

I tested this on the output file:

ffmpeg -hide_banner -i output.mp4 -vf scale=in_w:in_h -c:v libx264 -crf 30
-preset fast -c:a copy final.mp4

It too took a while to run, like 5-7 minutes but the resulting mp4 is smaller:

final.mp4 = 111,212,441 bytes

So this is the expected file size for these news shows.

What I really need now is to skip the last step by combining it into the main
command somehow...


-- 
Bo Berglund
Developer in Sweden

___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Bo Berglund
On Tue, 25 Jan 2022 15:30:06 +0500, Nikita Zlobin  wrote:

>So, there's another way - explicitly convert all to same format,
>unifying everything (with filters format, scale, setsar) for video.
>As it starts working - see, what could be omited from these extra
>options.

So I found a thread on StackOverflow:
https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg

And as the accepted reply is this where your suggestion is apparently used:

[quote]
I ended up using mpg as the intermediate format and it worked (NOTE this is a
dangerous example, -qscale 0 will re-encode the video...)

ffmpeg -i 1.mp4 -qscale 0 1.mpg
ffmpeg -i 2.mp4 -qscale 0 2.mpg
cat 1.mpg 2.mpg | ffmpeg -f mpeg -i - -qscale 0 -vcodec mpeg4 output.mp4
[/quote]

So I used this:
ffmpeg -hide_banner -i input1.mp4 -qscale 0 1.mpg
ffmpeg -hide_banner -i input2.mp4 -qscale 0 2.mpg
cat 1.mpg 2.mpg | ffmpeg -f mpeg -i - -qscale 0 -vcodec mpeg4 output.mp4

The resulting video plays well and at the cut position between them it keeps
audio sync.

So far so good, now the remaining problem I have is that the file size is blown
up considerably..

input1.mp4 =98,302,009 bytes
input2.mp4 =53,629,084 bytes
1.mpg is   =   930,535,424 bytes
2.mpg is   =   385,169,408 bytes
output.mp4 = 1,095,027,291 bytes

Is there a way to reduce the size of the final mp4 too?


-- 
Bo Berglund
Developer in Sweden

___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Nikita Zlobin
In Tue, 25 Jan 2022 11:14:31 +0100
Bo Berglund  wrote:

> On Tue, 25 Jan 2022 15:11:41 +0500, Nikita Zlobin
>  wrote:
> 
> >I would try separate separate concats for audio and video,
> >as they are demuxed anyway before filtergraph.
> >
> 
> Hmm, what exactly do you mean by this suggestion?
> An example, perhaps?
> 
> 

Fixup - to set sample aspect ratio it must be setsar=sar=... (default
first parameter is display aspect ratio, not SAR)
___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Nikita Zlobin
In Tue, 25 Jan 2022 11:14:31 +0100
Bo Berglund  wrote:

> On Tue, 25 Jan 2022 15:11:41 +0500, Nikita Zlobin
>  wrote:
> 
> >I would try separate separate concats for audio and video,
> >as they are demuxed anyway before filtergraph.
> >
> 
> Hmm, what exactly do you mean by this suggestion?
> An example, perhaps?
> 
> 

I meaned different parallel concat for video and audio.
However, to update - I just looked concat manual, and it seems
correctly used. This suggestion was based on concat error "Failed to
figure out output pad".

So, there's another way - explicitly convert all to same format,
unifying everything (with filters format, scale, setsar) for video.
As it starts working - see, what could be omited from these extra
options.

Btw, SAR 0:1 looks very strange for me (if I interpret it correctly,
it's like horizontal SAR=0). So just for test - what if you try
satsar=1 for both videos?
___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Bo Berglund
On Tue, 25 Jan 2022 15:11:41 +0500, Nikita Zlobin  wrote:

>I would try separate separate concats for audio and video,
>as they are demuxed anyway before filtergraph.
>

Hmm, what exactly do you mean by this suggestion?
An example, perhaps?


-- 
Bo Berglund
Developer in Sweden

___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Nikita Zlobin
I would try separate separate concats for audio and video,
as they are demuxed anyway before filtergraph.

In Tue, 25 Jan 2022 09:35:59 +0100
Bo Berglund  wrote:

> This is about ffmpeg usage on Linux...
> 
> I am nightly downloading news shows from several sources and
> sometimes a show from one might be bad at the end and another at the
> beginning. So I use ffmpeg to cut out the good parts from both and
> then paste them together using this method in a "paste" script:
> 1) create a joinfile listing all of the parts to paste
> 2) create the output video using this:
>ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE
> 
> This always works for parts extracted from the same video (commercial
> removal) and often also from parts coming from different download
> sources. The download script always converts the videos on the fly to
> the same 852x480 pixel format.
> 
> But sometimes the video parts seems to paste OK but the audio is
> either missing in later parts or severely shifted (by many seconds it
> seems like).
> 
> Each small part when played by itself is perfectly OK.
> 
> How would the command look like in order to combine the video parts
> such that audio and video are not shifted?
> 
> I have tried this but it failed:
> 
> ffmpeg -hide_banner -i input.1.mp4 -i input.2.mp4 -filter_complex
> "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map
> "[a]" output.mp4
> 
> Output (after the normal ffmpeg stuff):
> 
> [Parsed_concat_0 @ 0x55c0837c7400] Input link in0:v0 parameters (size
> 852x480, SAR 0:1) do not match the corresponding output link in0:v0
> parameters (852x480, SAR 640:639)
> [Parsed_concat_0 @ 0x55c0837c7400] Failed to configure output pad on
> Parsed_concat_0
> Error reinitializing filters!
> Failed to inject frame into filter network: Invalid argument
> Error while processing the decoded data for stream #1:0
> Conversion failed!
> 
> I don't know what the (852x480,SAR 640:639) part of the output means,
> so I am clueless here.
> I would like to create a paste script that can handle these
> situations when the existing script using the command on top does not
> work. The existing paste script is very fast but it does not
> re-encode anything, I believe.
> 
> Any suggestions welcome.
> 
> 
___
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 properly pasting same-size video parts together into one output?

2022-01-25 Thread Bo Berglund
This is about ffmpeg usage on Linux...

I am nightly downloading news shows from several sources and sometimes a show
from one might be bad at the end and another at the beginning.
So I use ffmpeg to cut out the good parts from both and then paste them together
using this method in a "paste" script:
1) create a joinfile listing all of the parts to paste
2) create the output video using this:
   ffmpeg -f concat -safe 0 -i $JOINFILE -c copy $TARGETFILE

This always works for parts extracted from the same video (commercial removal)
and often also from parts coming from different download sources. The download
script always converts the videos on the fly to the same 852x480 pixel format.

But sometimes the video parts seems to paste OK but the audio is either missing
in later parts or severely shifted (by many seconds it seems like).

Each small part when played by itself is perfectly OK.

How would the command look like in order to combine the video parts such that
audio and video are not shifted?

I have tried this but it failed:

ffmpeg -hide_banner -i input.1.mp4 -i input.2.mp4 -filter_complex "[0:v] [0:a]
[1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4

Output (after the normal ffmpeg stuff):

[Parsed_concat_0 @ 0x55c0837c7400] Input link in0:v0 parameters (size 852x480,
SAR 0:1) do not match the corresponding output link in0:v0 parameters (852x480,
SAR 640:639)
[Parsed_concat_0 @ 0x55c0837c7400] Failed to configure output pad on
Parsed_concat_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

I don't know what the (852x480,SAR 640:639) part of the output means, so I am
clueless here.
I would like to create a paste script that can handle these situations when the
existing script using the command on top does not work. The existing paste
script is very fast but it does not re-encode anything, I believe.

Any suggestions welcome.


-- 
Bo Berglund
Developer in Sweden

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