Re: [FFmpeg-user] concat a/v desync (only in MPC-HC)

2021-02-03 Thread basinilya
I tried both `cat` and `-i "concat..."`, but they produce the same artifact in 
MPC-HC.

I guess the audio PTS from the second chunk is adjusted relative to the video 
duration of the first chunk.

On 03.02.2021 1:05, Carl Eugen Hoyos wrote:
> Am Di., 2. Feb. 2021 um 22:18 Uhr schrieb Carl Eugen Hoyos 
> :
>>> Am 02.02.2021 um 20:09 schrieb basini...@gmail.com:
>>>
>>> I'm concatenating .ts chunks intended for an HLS player into a single .mp4 
>>> video.
>> You should instead concatenate all ts chunks into a single transport stream:
>> $ cat 1.ts 2.ts 3.ts > out.ts
> Or use the concat protocol instead of the concat demuxer.
>
> 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".
___
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] Out of virtual memory (swap, I assume) = telecine filter

2021-02-03 Thread Mark Filipak (ffmpeg)

On 02/03/2021 12:23 AM, Carl Zwanzig wrote:

On 2/2/2021 2:52 PM, Mark Filipak (ffmpeg) wrote:
If that's true, what's eating the swap? Transcoding parts 1, 2, 3, & 4 all succeeded when running 
concurrently. Transcoding part 5 fails, even when ffmpeg is the only app running.


Out of curiosity, have you tried looking at the file with an mkv analyzer like MediaInfo, Elecard's 
analyzer* or maybe another one? (Is there metadata towards the end of the file containing junk info?)


How does it behave if you drop the minterpolate or one of the other filters, output to a null file, 
or use a different output codec? (Anything to try isolating the problem.)


If rising memory allocation and rising swap commit indicates a memory leak, then the telecine filter 
has a memory leak.


=
part5.cmd
-
ffmpeg -i "THE LAST EMPEROR [1987] source part5.mkv" -map 0 -filter_complex 
"minterpolate=fps=48000/1001:mi_mode=mci:mc_mode=obmc:scd=fdiff:scd_threshold=10:vsbmc=1:search_param=32, 
telecine=pattern=3322,pp=linblenddeint, setpts=N*1001/6/TB" -codec:v libx265 -x265-params 
crf=20:qcomp=0.60 -codec:a copy -codec:s copy "THE LAST EMPEROR [1987] part5.mkv"

pause
exit

Results:
Though 'part1.cmd', 'part2.cmd', 'part3.cmd', and 'part4.cmd' completed when running concurrently, 
'part5.cmd' died.

I then twice ran 'part5.cmd' in isolation and it died twice.
=
part5 without minterpolate.cmd
-
ffmpeg -i "THE LAST EMPEROR [1987] source part5 (44561 frames).mkv" -map 0 -filter_complex 
"telecine=pattern=3322,pp=linblenddeint, setpts=N*1001/3/TB" -codec:v libx265 -x265-params 
crf=20:qcomp=0.60 -codec:a copy -codec:s copy "THE LAST EMPEROR [1987] part5 without minterpolate.mkv"

pause
exit

Results:

Expecting 55700 output frames.

1:07AM start.
Memory (of 32GB): 13.2GB
Swap commit (of 128GB): 14.2GB

1:32AM
Memory (of 32GB): 25.4GB
Swap commit (of 128GB): 27.3GB
A great number of "Starting new cluster due to timestamp" notices, a continuous stream -- coming so 
fast & furious that I can't read what the current frame number is before "Starting new cluster due 
to timestamp" overwrites it.


1:47AM
Memory (of 32GB): 31GB
Swap commit (of 128GB): 33GB

2:32AM
Memory (of 32GB): Hovering between 31GB & 31.6GB -- ramp up then drop, ramp up then drop: I imagine 
that's normal malloc-free cycles. But why would ffmpeg defer free'ing until it had filled memory?
Swap commit (of 128GB): 46GB, rising steadily... Aha! Then leveling off at 46.3GB. But why would 
swap commits begin immediately instead of when memory has been filled?


Ah! The "Starting new cluster due to timestamp" stream has ended, and it ended at the same time that 
swap commit leveled off.


Is that a clue?

3:07AM done.
This contrasts with the original run (that included minterpolate) which ran all 
night, then died.

You know what I think? From the behavior of memory & swap commits, it looks to me that it's a 
combination of "Starting new cluster due to timestamp" persisting for so many hours longer during 
the original run.


Actually, there were 3 original runs because I tried it 3 times; all died.
=
part5 with solely minterpolate.cmd
-
ffmpeg -i "THE LAST EMPEROR [1987] part5.mkv" -map 0 -filter_complex 
"minterpolate=fps=48000/1001:mi_mode=mci:mc_mode=obmc:scd=fdiff:scd_threshold=10:vsbmc=1:search_param=32, 
setpts=N*1001/48000/TB" -codec:v libx265 -x265-params crf=20:qcomp=0.60 -codec:a copy -codec:s copy 
"THE LAST EMPEROR [1987] part5 with solely minterpolate.mkv"

pause
exit

Results:

Expecting 89120 output frames.

2:14PM start.
Memory (of 32GB):= 10.3GB
Swap commit (of 128GB): 10.6GB

Thereafter, both memory and swap commit are flat.
Note: I let it run awhile after "Starting new cluster due to timestamp" began 
appearing.
There were much fewer "Starting new cluster due to timestamp" notices.

2:40PM
Memory = 10.6GB
Swap commit = 10.9GB

3:37 stopped.
=
part5 with solely telecine.cmd
-
ffmpeg -i "THE LAST EMPEROR [1987] source part5 (44561 frames).mkv" -map 0 -filter_complex 
"telecine=pattern=3322, setpts=N*1001/3/TB" -codec:v libx265 -x265-params crf=20:qcomp=0.60 
-codec:a copy -codec:s copy "THE LAST EMPEROR [1987] part5 with solely telecine.mkv"

pause
exit

Results:

3:43PM start.
Memory (of 32GB): 9.9GB
Swap commit (of 128GB): 10.2GB

3:47PM
Memory (of 32GB): 11.4GB
Swap commit (of 128GB): 11.9GB

3:52PM begin getting "Starting new cluster due to timestamp" notices.
Memory (of 32GB): 13.2
Swap commit (of 128GB): 13.8GB

4:00
Memory (of 32GB): 17
Swap commit (of 128GB): 17.5GB

4:00 stopped.
=

___
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 just the 1st audio channel of the input.

2021-02-03 Thread Paul B Mahol
On Wed, Feb 3, 2021 at 7:48 PM Nicolas George  wrote:

> Marco Mircoli (12021-02-03):
> >wandering if it is possible to process just the 1st audio channel of
> an
> > input.
> > I don't know how many channels I will have as input, but I know that I
> have
> > to process just the 1st and the others I have not to considerate.
> >
> > INPUT from mono to multichannel
> > filters.
> > OUTPUT just one channel (mono)
> >
> > I've tried this but doesn't works
> >
> > ffmpeg -i FILE_FROM -map_channel 0.0.0 -af
> > highpass=f=70,adeclick,loudnorm=I=-16.5:TP=-1.5:LRA=7 FILE_TO
>
> Just use pan=mono|c0=c0 to extract the channel you want wherever you
> want in the graph.
>
> No need to completely split the channels, it was meant for versions that
> lack the pan filter.
>


You missed fact that user needs all channels again, not just first.


>
> Regards,
>
> --
>   Nicolas George
> ___
> 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] Filter just the 1st audio channel of the input.

2021-02-03 Thread Nicolas George
Marco Mircoli (12021-02-03):
>wandering if it is possible to process just the 1st audio channel of an
> input.
> I don't know how many channels I will have as input, but I know that I have
> to process just the 1st and the others I have not to considerate.
> 
> INPUT from mono to multichannel
> filters.
> OUTPUT just one channel (mono)
> 
> I've tried this but doesn't works
> 
> ffmpeg -i FILE_FROM -map_channel 0.0.0 -af
> highpass=f=70,adeclick,loudnorm=I=-16.5:TP=-1.5:LRA=7 FILE_TO

Just use pan=mono|c0=c0 to extract the channel you want wherever you
want in the graph.

No need to completely split the channels, it was meant for versions that
lack the pan filter.

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] Publish a HLS stream via a HTTPS server with ffmpeg and nginx.

2021-02-03 Thread Hongyi Zhao
Hi,

On Ubuntu 20.04, I've built the docker image based my project located at
. The SSL relative
configuration has been enabled in the nginx.conf file used by the
above docker image,
see 
for the detailed info. I then tried to
stream the camera using HLS, as described below.

Publish the stream:
$ docker run -it -p 1935:1935 -p 8000:80 --rm nginx-rtmp
$ ffmpeg -f pulse -i default -f v4l2 -r 30 -s 1920x1080 -i /dev/video0
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 3000k
-vf "scale=1280:-1,format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100
-force_key_frames "expr:gte(t,n_forced*4)"  -f flv
"rtmp://localhost:1935/stream/surveillance"

As for watching the stream, I tried to use ffplay with http and https
protocal respectively, but the former can
successfully play the stream, the latter failed. The used commands
are shown below:

$ ffplay http://localhost:8000/live/surveillance.m3u8
$ ffplay https://localhost:8000/live/surveillance.m3u8
ffplay version N-100814-g911ba8417e Copyright (c) 2003-2021 the FFmpeg
developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --enable-gpl --enable-nonfree --enable-version3
--enable-debug --enable-ffplay --enable-indev=sndio
--enable-outdev=sndio --enable-fontconfig --enable-frei0r
--enable-openssl --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg --enable-rpath
--enable-shared --enable-avisynth --enable-chromaprint --enable-gcrypt
--enable-ladspa --enable-libaribb24 --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libcelt --enable-libcdio
--enable-libcodec2 --enable-libdc1394 --enable-libfdk-aac
--enable-libflite --enable-libfontconfig --enable-libgsm
--enable-libiec61883 --enable-libjack --enable-libklvanc
--enable-liblensfun --enable-libmodplug --enable-libopenh264
--enable-libopenmpt --enable-libpulse --enable-librabbitmq
--enable-librsvg --enable-librtmp --enable-libshine --enable-libsnappy
--enable-libssh --enable-libtesseract --enable-libtwolame
--enable-libv4l2 --enable-libxavs2 --enable-libdavs2 --enable-libxcb
--enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape
--enable-libzmq --enable-lv2 --enable-libmysofa --enable-openal
--enable-opencl --enable-opengl --enable-pocketsphinx --enable-vulkan
--enable-libdrm --enable-libmfx --enable-pic --enable-lto
--enable-hardcoded-tables --enable-memory-poisoning --enable-ftrapv
--enable-linux-perf --enable-libsvtav1
  libavutil  56. 63.101 / 56. 63.101
  libavcodec 58.119.100 / 58.119.100
  libavformat58. 65.101 / 58. 65.101
  libavdevice58. 11.103 / 58. 11.103
  libavfilter 7. 97.100 /  7. 97.100
  libswscale  5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc55.  8.100 / 55.  8.100
[tls @ 0x7f04f0004680] error:1408F10B:SSL
routines:ssl3_get_record:wrong version number
https://localhost:8000/live/surveillance.m3u8: Input/output error

Any hints/notes/comments for solving this problem are highly appreciated.

Regards
-- 
Assoc. Prof. Hongyi Zhao 
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
___
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 just the 1st audio channel of the input.

2021-02-03 Thread Jim



On 2/3/21 7:40 AM, Marco Mircoli wrote:

Hello,
wandering if it is possible to process just the 1st audio channel of an
input.
I don't know how many channels I will have as input, but I know that I have
to process just the 1st and the others I have not to considerate.

INPUT from mono to multichannel
filters.
OUTPUT just one channel (mono)

I've tried this but doesn't works

ffmpeg -i FILE_FROM -map_channel 0.0.0 -af
highpass=f=70,adeclick,loudnorm=I=-16.5:TP=-1.5:LRA=7 FILE_TO

Any suggest?
Thanks.
S.
___
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".
I do not know what you're specifically trying to accomplish with this, 
but I have a script in which I need to reduce videos with an unknown 
number of channels into 2.  How I accomplished it was to dump the audio 
to a stereo wave file, run some external processing on it, then 
multiplex it back with the original video while encoding it as a stereo 
MP3 audio track.  If you cannot find a better solution, perhaps 
something similar would work for your purpose, only using -ac 1 instead 
of -ac 2 as I do?


Just an idea.

Jim
___
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 just the 1st audio channel of the input.

2021-02-03 Thread Paul B Mahol
On Wed, Feb 3, 2021 at 2:05 PM Marco Mircoli  wrote:

> Hello,
>wandering if it is possible to process just the 1st audio channel of an
> input.
> I don't know how many channels I will have as input, but I know that I have
> to process just the 1st and the others I have not to considerate.
>
> INPUT from mono to multichannel
> filters.
> OUTPUT just one channel (mono)
>
> I've tried this but doesn't works
>
> ffmpeg -i FILE_FROM -map_channel 0.0.0 -af
> highpass=f=70,adeclick,loudnorm=I=-16.5:TP=-1.5:LRA=7 FILE_TO
>

you will need to extract each channel by channelsplit filter, and later
merge it with other filters.
This makes filtergraph description longer.
Some filters support processing only specific channel but most do not as it
does not make sense for such filters.


>
> Any suggest?
> Thanks.
> S.
> ___
> 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 just the 1st audio channel of the input.

2021-02-03 Thread Marco Mircoli
Hello,
   wandering if it is possible to process just the 1st audio channel of an
input.
I don't know how many channels I will have as input, but I know that I have
to process just the 1st and the others I have not to considerate.

INPUT from mono to multichannel
filters.
OUTPUT just one channel (mono)

I've tried this but doesn't works

ffmpeg -i FILE_FROM -map_channel 0.0.0 -af
highpass=f=70,adeclick,loudnorm=I=-16.5:TP=-1.5:LRA=7 FILE_TO

Any suggest?
Thanks.
S.
___
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] Out of virtual memory (swap, I assume)

2021-02-03 Thread Mark Filipak (ffmpeg)

Here is the original command that fails:

ffmpeg -i "source part5.mkv" -map 0 -filter_complex 
"minterpolate=fps=48000/1001:mi_mode=mci:mc_mode=obmc:scd=fdiff:scd_threshold=10:vsbmc=1:search_param=32, 
telecine=pattern=3322,pp=linblenddeint, setpts=N*1001/6/TB" -codec:v libx265 -x265-params 
crf=20:qcomp=0.60 -codec:a copy -codec:s copy "part5.mkv"


Here is the test command for this run:

ffmpeg -i "source part5 (44561 frames).mkv" -map 0 -filter_complex 
"telecine=pattern=3322,pp=linblenddeint, setpts=N*1001/3/TB" -codec:v libx265 -x265-params 
crf=20:qcomp=0.60 -codec:a copy -codec:s copy "part5 without minterpolate.mkv"


Test results:

Memory (of 32GB): 13.2GB to 25.4GB in 25 minutes, 31GB 15 minutes later, then hover between 31GB & 
31.6GB thereafter -- ramp up then drop, ramp up then drop: I imagine that's normal malloc-free 
cycles. But why would ffmpeg defer free'ing until it had filled memory?


Swap commit (of 128GB): 14.2GB to 27.3 in 25 minutes, 33GB 15 minutes later, 46GB 45 minites later 
-- rising steadily... Aha! Then leveling off at 46.3GB. But why would swap commits begin immediately 
instead of when memory has been filled?


A great many more "Starting new cluster due to timestamp", a continuous stream -- coming so fast & 
furious that I can't read what the current frame number is before "Starting new cluster due to 
timestamp" overwrites it.


Ah! The "Starting new cluster due to timestamp" stream has ended, and it ended at the same time that 
swap commit leveled off.


Is that a clue?

The run just completed at 3:07AM. It started at 1:37AM, so took 1 hr. 40 min. That contrasts with 
the original run (that included minterpolate) which ran all night before dying.


You know what I think? From the behavior of memory & swap commits, it looks to me that it's a 
combination of "Starting new cluster due to timestamp" persisting for so many hours longer during 
the original run.


Actually, there were 3 original runs because I tried it 3 times; all died.

=

For what it's worth, here's my notes made while planning the source video 
cutting:

Divide transcoding the 222545 input frames between 5 concurrent tasks.
(222545-0)/5 = 44509 input frames per task

Define the bounds of the 5 segments.
0-44509, 44510-89018, 89019-133527, 133528-178036, 178037-222545

Adjust the segments so that each starts with the nearest key frame having an 
even frame number.
0-44503, 44504-88999, 89000-133447, 133448-177983, 177984-222545

Add 1 because MKVToolNIX expects frame numbers to start from 1, not zero.
1-44504, 44505-89000, 89001-133448, 133449-177984, 177985-222546

minterpolate silently drops the final 2 input frames, so add 2 frame overlaps 
to compensate.
1-44506, 44505-89002, 89001-133450, 133449-177986, 177985-222548

Via MKVToolNix, segment the input per the compensated bounds.
source-part1.mkv source-part2.mkv source-part3.mkv source-part4.mkv 
source-part5.mkv

Create 5 scripts and run them concurrently.
source part1.mkv.cmd
  ffmpeg -i source-part1.mkv -map 0 -filter_complex 
"minterpolate=fps=48000/1001:mi_mode=mci:vsbmc=1, telecine=pattern=3322,pp=linblenddeint, 
setpts=N*1001/6/TB" -codec:v libx265 -x265-params crf=20:qcomp=0.60 -codec:a copy -codec:s copy 
part1.mkv

  pause
source part2.mkv.cmd
  ffmpeg -i source-part2.mkv ... part2.mkv
  pause
source part3.mkv.cmd
  ffmpeg -i source-part3.mkv ... part3.mkv
  pause
source part4.mkv.cmd
  ffmpeg -i source-part4.mkv ... part4.mkv
  pause
source part5.mkv.cmd
  ffmpeg -i source-part5.mkv ... part5.mkv
  pause

Hope that the resulting motion vectors at segment joins will be close enough that they're not too 
apparent.


--
I don't have a dog.
And furthermore, my dog doesn't bite.
And furthermore, you provoked him.
___
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".