[Ffmpeg-devel-irc] ffmpeg.log.20190921

burek burek at teamnet.rs
Sun Sep 22 03:05:04 EEST 2019


[00:10:23 CEST] <phobosoph> hi
[00:11:50 CEST] <phobosoph> I got an issue with ffmpeg and Hikvision IPCamera stream
[00:11:55 CEST] <phobosoph> any ideas how to debug this? :/
[00:12:03 CEST] <phobosoph> I got the ffmpeg invocation, I see lots of stuff logged
[00:14:05 CEST] <cehoyos> Would you like to share lots of stuff with us?
[00:14:15 CEST] <phobosoph> yes
[00:14:16 CEST] <phobosoph> :)
[00:26:24 CEST] <phobosoph> ffmpeg -stats -loglevel quiet -err_detect ignore_err -rtsp_transport tcp -i rtsp://user:pass@ip:554/Streaming/Channels/1 -map_metadata -1 -metadata application=datarhei/Restreamer -metadata server=NGINX-RTMP -f flv rtmp://127.0.0.1:1935/hls/live.stream
[00:27:39 CEST] <phobosoph> frame=   26 fps=4.2 q=31.0 size=     669kB
[00:27:45 CEST] <phobosoph> so I get not more than  5fps
[00:27:50 CEST] <phobosoph> and bandwidth is also damn lwo
[00:27:51 CEST] <phobosoph> *low
[00:28:02 CEST] <phobosoph> but I can connect to the ipcam with e.g. VLC player and see a fullhd stream
[00:28:12 CEST] <phobosoph> also the main stream is configured to be full hd 30fps
[00:28:18 CEST] <phobosoph> something is strange with the stream and ffmpeg doesn't like it
[00:28:20 CEST] <kepstin> that command's re-encoding the video, so it seems like you don't have enough cpu power to encode the video with the requested codecs (which you haven't specified, so it's using random defaults)
[00:28:46 CEST] <phobosoph> kepstin: when I check the cpu load and it is not 100%, would this indicate the device is fast enough for this?
[00:29:22 CEST] <BtbN> is one core at 100%?
[00:29:48 CEST] <phobosoph> it fluctuates a lot :/  in htop all cores got 80% and then back to 5%
[00:29:49 CEST] <kepstin> default video encoder with fpv is flv1, lol
[00:29:51 CEST] <phobosoph> sometimes 100%
[00:29:57 CEST] <kepstin> prowith flv*
[00:30:05 CEST] <kepstin> which probably isn't even multithreaded
[00:30:06 CEST] <phobosoph> hm, I am using restreamer which uses ffmpeg internally (and ffmpeg does the job basically)
[00:30:14 CEST] <BtbN> the hell even is that
[00:30:23 CEST] <kepstin> some old piece of junk
[00:30:24 CEST] <phobosoph> but ffmpeg should be used in copy mode :O
[00:30:30 CEST] <phobosoph> copy is selected, not re-encode
[00:30:40 CEST] <BtbN> in the comment you pasted, it's very much not copying
[00:30:41 CEST] <phobosoph> :(  it should just pass the h264 stream of the ipcam
[00:30:43 CEST] <phobosoph> oh
[00:30:44 CEST] <kepstin> phobosoph: you didn't specify copy anywhere in your command
[00:30:47 CEST] <kepstin> so it won't do it
[00:30:48 CEST] <phobosoph> aha
[00:30:51 CEST] <kepstin> default is re-encode
[00:31:44 CEST] <kepstin> stick a "-c copy" in there after the input files, before the output file.
[00:32:03 CEST] <phobosoph> oh, what output file... right
[00:32:13 CEST] <phobosoph> there is no output file? why is restreamer using rtmp as output?
[00:32:25 CEST] <BtbN> Because of lack of alternatives.
[00:32:46 CEST] <kepstin> well, by "output file" i mean "the thing on the command line that specifies where the output is going"
[00:33:02 CEST] <phobosoph> repeatToLocalNginx] Spawned: ffmpeg -stats -loglevel quiet -err_detect ignore_err -rtsp_transport tcp -i rtsp://user:pass@ip:554/Streaming/Channels/1 -map_metadata -1 -metadata application=datarhei/Restreamer -metadata server=NGINX-RTMP -f flv rtmp://127.0.0.1:1935/hls/live.stream
[00:33:09 CEST] <phobosoph> repeatToLocalNginx?
[00:33:10 CEST] <kepstin> and by "input file" i mean "the -i option and its argument"
[00:33:14 CEST] <phobosoph> ah
[00:33:48 CEST] <phobosoph> kepstin: so nginx somehow should serve that stream then, prepared by ffmpeg :/
[00:34:00 CEST] <kepstin> that repeatToLocalNginx thing has nothing to do with ffmpeg, it's probably just part of some log output from something else
[00:34:02 CEST] <phobosoph> fittlingly the player doesn't play it back because it can't find a livestream file
[00:34:04 CEST] <phobosoph> ah
[00:34:04 CEST] <phobosoph> yes
[00:35:24 CEST] <kepstin> anyways, assuming you add the -c copy option, and assuming the input is something reasonable like h264, that seems like a perfectly fine command to convert input from an ip cam and send it to an rtmp streaming server.
[00:35:51 CEST] <kepstin> (nginx-rtmp is a decent choice of streaming server, which can generate e.g. HLS manifests for web players)
[00:36:17 CEST] <BtbN> ffmpeg is generally better at generating HLS playlists though
[00:36:50 CEST] <kepstin> yeah, if you just want HLS then use ffmpeg's hls output on disk somewhere, and use e.g. nginx as a static http file server
[00:37:18 CEST] <kepstin> (or even hls output to a tmpfs or something if you're booted off an sd card or something ridiculous like that)
[00:39:17 CEST] <phobosoph> so one CPU core is currently at 100%
[00:39:23 CEST] <phobosoph> although copy is enabled
[00:39:31 CEST] <phobosoph> so restreamer uses the wrong commands
[00:39:32 CEST] <BtbN> You probably did it wrong then
[00:39:32 CEST] <phobosoph> damn
[00:39:54 CEST] <BtbN> What even is restreamer?
[00:40:12 CEST] <BtbN> Do you mean https://restream.io/ ?
[00:40:22 CEST] <phobosoph> https://datarhei.github.io/restreamer/
[00:40:24 CEST] <phobosoph> that one
[00:40:34 CEST] <phobosoph> https://github.com/datarhei/restreamer
[00:41:14 CEST] <BtbN> So it's just a Docker-container that uses a bunch of otherwise unrelates software to setup nginx-rtmp?
[00:42:36 CEST] <phobosoph> yes
[00:42:40 CEST] <phobosoph> it is quite comfortable
[00:43:00 CEST] <phobosoph> but it doesn't work :/  and I rather use some manual ffmpeg to get it working
[00:43:01 CEST] <BtbN> seems overcomplicated to me
[00:43:08 CEST] <phobosoph> so what I want: RTSP f rom IPcam to RTMP of YouTube
[00:43:21 CEST] <phobosoph> with this particular IPcam Restreamer doesn't work
[00:43:28 CEST] <BtbN> you can do that in a single ffmpeg command without the need for Docker at all
[00:44:00 CEST] <phobosoph> wow
[00:44:20 CEST] <phobosoph> until they found out/fixed the issue I would gladly do that on the CLI :D
[00:44:34 CEST] <phobosoph> so the ipcam has been configured to give a youtube friendly stream
[00:44:43 CEST] <phobosoph> the audio is incompatible though, it must be AAC or MP3
[00:44:53 CEST] <BtbN> I really don't see the advantage of throwing another half a dozen layers at this
[00:44:57 CEST] <phobosoph> but silence would also be OK
[00:44:59 CEST] <phobosoph> right
[00:45:02 CEST] <BtbN> encoding aac is cheap
[00:45:18 CEST] <phobosoph> what kind of command can I use then? not the one restreamer uses I guess
[00:45:28 CEST] <phobosoph> I got the youtube RTMP URL with secret key
[00:45:52 CEST] <BtbN> the rtsp stream as input, copy video, encode aac audio, rtmp out to youtube
[00:46:10 CEST] <phobosoph> yes!
[00:46:17 CEST] <phobosoph> this seems also be very lightweight to cpu
[00:46:24 CEST] <phobosoph> (it runs on a raspberry pi btw, hehe)
[00:46:28 CEST] <BtbN> Seems pretty much identical to what you pasted before, except output to YT
[00:46:34 CEST] <phobosoph> oh
[00:46:40 CEST] <phobosoph> so no copy flag needed when rtmp output is used?
[00:46:47 CEST] <phobosoph> repeatToLocalNginx] Spawned: ffmpeg -stats -loglevel quiet -err_detect ignore_err -rtsp_transport tcp -i rtsp://user:pass@ip:554/Streaming/Channels/1 -map_metadata -1 -metadata application=datarhei/Restreamer -metadata server=NGINX-RTMP -f flv rtmp://127.0.0.1:1935/hls/live.stream
[00:46:50 CEST] <BtbN> Well yes, you need to encode/copy correctly
[00:46:53 CEST] <phobosoph> so instead -f flv I would use rtmp URL?
[00:47:01 CEST] <BtbN> rtmp uses flv.
[00:47:21 CEST] <phobosoph> ffmpeg -stats -loglevel quiet -err_detect ignore_err -rtsp_transport tcp -i rtsp://user:pass@ip:554/Streaming/Channels/1
[00:47:53 CEST] <phobosoph> ffmpeg -stats -loglevel quiet -err_detect ignore_err -rtsp_transport tcp -i rtsp://user:pass@ip:554/Streaming/Channels/1 -f flv rtmp://a.rtmp.youtube.com/live2/secret-key-thing
[00:47:57 CEST] <phobosoph> like that?
[00:48:11 CEST] <BtbN> You're still re-encoding to weird flv defaults with that
[00:48:17 CEST] <BtbN> you need to copy/encode aac
[00:48:22 CEST] <phobosoph> BtbN: how can I do this in ffmpeg?
[00:48:30 CEST] <phobosoph> copy video, re-encode audio to AAC mono?
[00:48:41 CEST] <BtbN> https://trac.ffmpeg.org/wiki/Encode/AAC
[00:49:17 CEST] <phobosoph> oh, ffmpeg is so useful, it does more than just mpeg stuff, right? its name is because of legacy stuff?
[00:50:02 CEST] <phobosoph> -c:a libfdk_aac -b:a 64k
[00:50:07 CEST] <phobosoph> so this I add to the command
[00:50:19 CEST] <phobosoph> now I need to let it copy the video - not re-encode it to youtube rtmp url
[00:50:25 CEST] <BtbN> if your instance support libfdk, yes
[00:51:13 CEST] <phobosoph> ah right, I check that
[00:52:10 CEST] <phobosoph> BtbN: any elegant way for letting ffmpeg run and auto-restart when the connection breaks?
[00:54:46 CEST] <phobosoph> wow, ffmpeg does the streaming thing now
[00:54:56 CEST] <phobosoph> Past duration 0.999992 too large
[00:54:57 CEST] <phobosoph> hmmm
[00:55:04 CEST] <phobosoph> error while decoding MB 78 34, bytestream -7
[00:55:08 CEST] <phobosoph> then ffmpeg aborts
[00:59:11 CEST] <phobosoph> BtbN: help :O
[01:01:11 CEST] <another> please post the complete command line wih output to some pastebin site
[01:10:50 CEST] <phobosoph> another, BtbN: https://pastebin.com/j12xeeKF
[01:11:10 CEST] <phobosoph> it looks much better now, but ffmpeg warns me that it ignores the audio conversion thing
[01:12:37 CEST] <phobosoph> I get very high fps now :D
[01:16:16 CEST] <phobosoph> but there is still an audio issue
[01:16:21 CEST] <phobosoph> youtube doesn't recognize the stream
[01:16:32 CEST] <phobosoph> Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (rtmp...)
[01:16:41 CEST] <phobosoph> has not been used for any stream.
[01:24:25 CEST] <another> <another> please post the complete command line wih output to some pastebin site
[01:25:08 CEST] <phobosoph> another: but I posted a link !
[01:25:14 CEST] <phobosoph> that's the complete command line I use
[01:25:30 CEST] <cehoyos> another: There is a reason for the wording I use...
[01:25:40 CEST] <cehoyos> (You know it, right?)
[01:26:14 CEST] <pink_mist> phobosoph: "complete command line wih output" <-- WITH OUTPUT
[01:26:15 CEST] <phobosoph> another, cehoyos: you mean not only the invocation but also what is logged afterwards?
[01:26:19 CEST] <phobosoph> pardon my ignorance lol
[01:29:30 CEST] <DHE> yes please. details like the exact version of ffmpeg being used, format of the inputs and outputs, and any errors/warnings may be relevant
[01:30:21 CEST] <phobosoph> https://pastebin.com/pFUNWELS
[01:30:23 CEST] <phobosoph> here we go
[01:30:47 CEST] <phobosoph> so youtube doesn't recognize the data - and the last time this was caused by incompatible audio
[01:31:00 CEST] <phobosoph> either no audio (youtube requires some kind of audio channel) or incorrectly converted audio
[01:31:08 CEST] <cehoyos> Your FFmpeg version is >three years old...
[01:31:44 CEST] <phobosoph> cehoyos: What would be the fastest way to get it upgraded on a raspbian?
[01:31:56 CEST] <cehoyos> git clone && configure && make?
[01:32:16 CEST] <cehoyos> But I wonder what your issue is now: The input has no audio, so why would the output contain audio?
[01:32:23 CEST] <DHE> first this sample has only video in the source, no audio so there's no audio to output....
[01:33:18 CEST] <phobosoph> ah!
[01:33:30 CEST] <phobosoph> input has no audio? but the ipcam should output audio
[01:33:34 CEST] <phobosoph> I have to check that
[01:33:54 CEST] <phobosoph> XD, it got a Line In
[01:34:00 CEST] <phobosoph> lol, no wonder there is no audio, nothing is plugged in
[01:34:10 CEST] <DHE> <voice style="mythbusters">Well there's your problem...
[01:34:17 CEST] <phobosoph> can ffmpeg just inject proper still audio ?
[01:34:19 CEST] <phobosoph> lol
[01:34:48 CEST] <cehoyos> Only if you tell it to
[01:34:50 CEST] <DHE> you can source audio from a different device/source and ffmpeg can put them together
[01:35:05 CEST] <DHE> though audio sync may not be guaranteed with the video
[01:36:43 CEST] <phobosoph> so just silence so youtube is happy?
[01:38:52 CEST] <phobosoph> yes! yes! it works !!!!
[01:38:59 CEST] <phobosoph> I added -f lavfi -i anullsrc
[01:39:43 CEST] <DHE> that should do
[01:40:07 CEST] <DHE> one other thing caught my eye yuvj420p - note the J
[01:40:13 CEST] <DHE> I don't know if that matters though
[01:41:21 CEST] <phobosoph> DHE: yuvj420p is not full hd, right?
[01:41:38 CEST] <DHE> "full hd" is a matter of resolution, not colourspace
[01:41:55 CEST] <phobosoph> ah XD
[01:41:56 CEST] <phobosoph> I need to learn
[01:42:01 CEST] <phobosoph> so much
[01:42:23 CEST] <DHE> it's 1080p at 30fps, which is "full hd". but the non-J version of yuv420p is the industry standard
[01:42:35 CEST] <DHE> I don't know if google's servers will convert it for you or not
[01:42:44 CEST] <phobosoph> it looks okish
[01:42:53 CEST] <DHE> that's probably good enough then
[01:42:54 CEST] <phobosoph> hm, I hope the foggy image is from the lens :/
[01:44:04 CEST] <cehoyos> You should indeed add -pix_fmt yuv420p to get acceptable colours: It is unlikely that players correctly show yuvj420p.
[01:44:18 CEST] <DHE> but then you can't use -c:v copy
[01:44:25 CEST] <cehoyos> True, sorry!
[01:44:40 CEST] <cehoyos> Try to change the camera configuration
[01:44:48 CEST] <DHE> right now we're in the experimentation phase...
[01:45:34 CEST] <phobosoph> right :)
[01:45:39 CEST] <DHE> if you want to try the colourspace change, replace -c:v copy with: -c:v libx264 -preset veryfast -crf 25 -profile:v main
[01:46:12 CEST] <DHE> also regardless, delete -tune zerolatency because with -c:v copy it's useless and with actual video transcoding it hurts image quality a lot and there's already a buttload of latency on youtube streaming
[01:46:56 CEST] <phobosoph> is crf 25 = 25fps?
[01:47:16 CEST] <DHE> it's a quality setting. higher numbers use less bandwidth but obviously lower quality.
[01:47:22 CEST] <DHE> 25 is a good rough starting point
[01:47:22 CEST] <phobosoph> ah, camera settings: Baseline, High profiles
[01:47:54 CEST] <phobosoph> Profile: Basic profile, Main Profile and High Profile for coding are selectable.
[01:48:00 CEST] <phobosoph> is this the color space thing?
[01:48:17 CEST] <DHE> no...
[01:48:33 CEST] <phobosoph> but for what is it used?
[01:48:39 CEST] <DHE> it controls the features supported in the encoded stream, which in turn dictates the features the player needs to support
[01:48:54 CEST] <DHE> eg: first gen iPhones only supported Baseline profile
[01:49:24 CEST] <phobosoph> DHE: so this is irrelevant for youtube because youtube handles all this, right?
[01:50:15 CEST] <DHE> I don't know. I don't youtube stream. I just know yuv420p is the the only thing guaranteed supported by players
[01:51:05 CEST] <phobosoph> ah, so not yuvj420p
[01:51:12 CEST] <cehoyos> I wonder if Constrained Baseline support yuvj420p...
[01:51:35 CEST] <phobosoph> cehoyos: ah, this would be a way to enforce it
[01:51:48 CEST] <cehoyos> It could be, worth a try imo
[01:52:03 CEST] <cehoyos> Good night!
[01:52:04 CEST] <phobosoph> H.264+ is enabled
[01:52:08 CEST] <phobosoph> thanks and good night
[01:52:09 CEST] <DHE> main and high are supposed to already be 4:2:0. there are discrete 'High 4:2:2', etc profiles
[01:53:51 CEST] <phobosoph> Any nice way to let ffmpeg run in the background so I can exit the raspberry SSH session? :)
[01:53:59 CEST] <phobosoph> and will ffmpeg auto-retry when the connection goes down for a moment?
[01:54:56 CEST] <DHE> I like to use `screen`. Other people like tmux
[01:55:13 CEST] <DHE> as for outage handling, i suggest a shell script infinite while loop..
[01:55:22 CEST] <DHE> while true; do [ffmpeg commandline here] ; sleep 5 ; done
[01:57:27 CEST] <phobosoph> while true; do [
[01:57:32 CEST] <phobosoph> it doesn'T like the stuff after [ :)
[01:57:40 CEST] <phobosoph> it is a multiline ffmpeg thing with \
[01:57:42 CEST] <DHE> the [ ] doesn't literally get inserted
[01:57:54 CEST] <DHE> while true; do ffmeg -i ... ; sleeop 5 ; done
[01:57:55 CEST] <phobosoph> ahhh
[01:58:04 CEST] <DHE> fix obvious typos
[01:58:35 CEST] <DHE> but if you're running this on a pi... maybe avoid transcoding for now
[01:59:01 CEST] <phobosoph> thx
[01:59:04 CEST] <phobosoph> it works nice
[01:59:09 CEST] <phobosoph> it works wonderfully
[03:22:49 CEST] <classsic> somebody know how setup RGBX_8888 pixel format?
[03:22:50 CEST] <classsic> *hi
[03:26:17 CEST] <another> what do you mean by setup?
[03:26:29 CEST] <another> do you have a source?
[03:26:30 CEST] <classsic> like -pix_fmt yuv420p
[03:26:49 CEST] <classsic> rtsp input camera
[03:30:35 CEST] <another> that's a little vague
[03:30:47 CEST] <another> there are tons of pixel formats in ffmpeg. see https://www.ffmpeg.org/doxygen/trunk/pixfmt_8h.html#a9a8e335cf3be472042bc9f0cf80cd4c5
[03:31:20 CEST] <another> depending on your use case you might prefer one over the other
[03:33:04 CEST] <classsic> thanks!
[03:33:07 CEST] <classsic> I will try
[03:36:38 CEST] <DHE> you can also use ffmpeg -pix_fmts # to get a list
[03:36:51 CEST] <DHE> similarly there's also -codecs, -formats, and a few other options for info dumps
[03:38:35 CEST] <kepstin> "RGBX_8888" sounds like it would correspond to either rgb0 or 0bgr in ffmpeg (depending on endian)
[03:40:46 CEST] <classsic> I try to get hw acceleration on chrome
[03:41:20 CEST] <classsic> GpuMemoryBuffers Status
[03:41:40 CEST] <classsic> and RGBA_8888	GPU_READ, SCANOUT
[03:41:59 CEST] <classsic> the other formats .---->software decode only
[03:43:14 CEST] <classsic> so...I need to set up this pix_fmt, but really, I´m not sure.
[04:04:36 CEST] <another> hw accel for what codec?
[04:05:43 CEST] <another> you probably only get hw accel for yuv420
[05:12:11 CEST] <grkblood13> I have a atsc broadcast stream that I want to send through ffmpeg to ensure that it's properly encoded before saving it. my command is cat /dev/dvb/adapter0/dvr0 | ffmpeg -f mpegts -i pipe:0 -c:v mpeg2video -c:a aac -f mpeg -c copy /tmp/test5.out
[05:12:36 CEST] <grkblood13> this is crapping out almost instantly with [mpeg2video @ 0x557c60ce90] Invalid frame dimensions 0x0.
[05:12:36 CEST] <grkblood13>     Last message repeated 28 times
[05:12:41 CEST] <grkblood13> any idea why?
[05:20:12 CEST] <DHE> because you joined the stream at a non-keyframe so the mpeg decoder is not happy yet
[05:20:25 CEST] <DHE> this is normal and can be ignored
[05:20:49 CEST] <nicolas17> you're re-encoding it to mpeg2?
[05:21:01 CEST] <nicolas17> or does -c copy override the previous -c:v?
[05:21:23 CEST] <DHE> seems like it. ATSC around here here tends to be mpeg2 anyway
[05:29:52 CEST] <furq> i assume that -c:v mpeg2video is meant to be before -i
[05:30:00 CEST] <furq> but it's picking the right decoder anyway so you could also just remove it
[05:30:19 CEST] <furq> and -c:a obviously
[05:30:35 CEST] <DHE> well a full transcode is necessary to decode the input for an extended period before you deem it to be "intact"
[05:31:04 CEST] <furq> i'm assuming that based on him asking about that option for ffplay earlier
[06:12:24 CEST] <exs> hi
[06:12:34 CEST] <exs> I get the error [mp4 @ 0x56143fdd8bc0] Non-monotonous DTS in output stream 0:0; previous: 25406, current: 25188; changing to 25407. This may result in incorrect timestamps in the output file.
[10:29:59 CEST] <cousin_luigi> Greetings.
[10:30:15 CEST] Action: cousin_luigi keeps forgetting how to remove mp4 subtitles
[10:30:42 CEST] <cousin_luigi> Something to do with -map no doubt, but how?
[10:32:29 CEST] <JEEB> don't map them?
[10:32:45 CEST] <JEEB> -map 0:v -map 0:a
[10:35:12 CEST] <cousin_luigi> JEEB: ffmpeg -i foo.mkv -acodec copy -vcodec copy -map 0:v -map 0:a bar.mp4 <- what am I doing wrong?
[10:38:11 CEST] <JEEB> then it's chapters since those get inserted as a text stream
[10:39:01 CEST] <JEEB> since effectively that's how mov specified chapters :)
[10:39:20 CEST] <JEEB> antways don't remember how to ignore chapters
[10:39:23 CEST] <cousin_luigi> JEEB: I see EIA-708
[10:39:39 CEST] <JEEB> that's in the video then most likely?
[10:39:45 CEST] <JEEB> within the video stream
[10:39:48 CEST] <cousin_luigi> Yes.
[10:39:53 CEST] <cousin_luigi> How can I remove those?
[10:40:17 CEST] <JEEB> yes, stripping that is probably less simple although there is a header bit stream filter
[10:40:34 CEST] <JEEB> which might strip that
[10:40:50 CEST] Action: cousin_luigi is all ears
[10:42:52 CEST] <JEEB> see filter_units example I guess in ffmpeg-all.html ?
[10:43:04 CEST] <JEEB> that might be what you need
[10:43:40 CEST] <cousin_luigi> JEEB: "Unknown bitstream filter filter_units"
[10:43:55 CEST] <cousin_luigi> I'm on ffmpeg 3.something if that's a factor.
[10:44:08 CEST] <JEEB> probably yes. have fun
[10:44:20 CEST] <cousin_luigi> :'(
[10:44:33 CEST] <JEEB> probably worth just locally building in your home directory :p
[10:44:39 CEST] <JEEB> anyways, afk
[12:06:05 CEST] <Spring> has anyone done benchmarks on ffmpeg's APNG encoding vs other programs like APNG Assembler?
[12:06:15 CEST] <Spring> in terms of speed that is
[12:37:11 CEST] <cehoyos> APNG Assembler does not accept random input, so the benchmark will not be useful afaict
[13:13:11 CEST] <Spring> cehoyos, I'm only wondering about PNG frames -> APNG benchmarks.
[13:13:55 CEST] <Spring> assuming that's what you mean about random input
[13:14:15 CEST] <Spring> in that it doesn't accept non-PNG inputs
[13:15:12 CEST] <Spring> I'll be trying some myself later
[13:22:16 CEST] <cehoyos> Then let me rephrase: APNG Assembler cannot do what FFmpeg can do and FFmpeg cannot do what APNG Assembler can do
[13:22:52 CEST] <cehoyos> If APNG Assembler does something really stupid, FFmpeg could still be faster but it is unlikely
[13:40:58 CEST] <Spring> so what kind of support for APNG encoding does ffmpeg have in that case?
[13:43:24 CEST] <Spring> in my previous searches I couldn't find a docs page about it, just a note in a changelog
[13:45:38 CEST] <cehoyos> FFmpeg supports apng encoding, APNG Assembler supports "png to apng remuxing" which is not supported by FFmpeg
[13:47:52 CEST] <cehoyos> (But as said, I don't know APNG Assembler, so maybe they only support decoding png and encoding apng, but I consider that unlikely)
[13:51:43 CEST] <Spring> Takes a good while to output APNGs with APNG Assembler using larger input images, whether color palette optimizations are enabled or not which was the reason I originally wondered. Wouldn't remuxing be a lot quicker?
[14:25:29 CEST] <cehoyos> Then feel free to compare with FFmpeg
[14:28:39 CEST] <furq> Spring: apngasm defaults to a different (slower) DEFLATE encoder
[14:28:42 CEST] <furq> so that's probably why it's slower
[14:29:31 CEST] <furq> you'd hope it would be a bit faster with -z0 but probably not appreciably so
[14:29:33 CEST] <greysondn> Huh
[14:29:37 CEST] <greysondn> "ffmpeg.pastebin.coms server IP address could not be found."
[14:30:01 CEST] <greysondn> Not what I came here for, but probably worth mentioning.
[14:30:11 CEST] <Spring> furq, so not much difference between the compression types? Huh. Do you know if changing the number of iterations helps?
[14:30:22 CEST] <furq> well yeah fewer iterations will be faster
[14:30:30 CEST] <furq> and there is a big difference between the compression types
[14:30:45 CEST] <furq> in terms of speed at least
[14:30:56 CEST] <furq> they're all DEFLATE so you won't gain much from using zopfli in terms of size
[14:31:29 CEST] <furq> but it will heat the room up a bit more
[14:32:09 CEST] <furq> -z0 is zlib deflate which is what ffmpeg uses, so that would be the fair comparison
[14:32:09 CEST] <cehoyos> greysondn: Where is this url mentioned and how could we fix it?
[14:32:20 CEST] <furq> it's in the chanserv welcome message iirc
[14:32:35 CEST] <Spring> you mentioned -z0 isn't appreciably faster than -z1 (the default) but -z2 would be, have I understood that right?
[14:32:44 CEST] <cehoyos> I must be blind because I don't see it...
[14:32:59 CEST] <greysondn> Yes. The channel topic message, to all appearances.
[14:33:27 CEST] <furq> Spring: -z0 is faster than -z1 is much faster than -z2
[14:33:27 CEST] <cehoyos> You have joined the channel #ffmpeg.
[14:33:35 CEST] <furq> and no it's not the topic, chanserv sends you a notice when you join
[14:33:36 CEST] <cehoyos> The channel topic is "Welcome to the FFmpeg USER support channel | Development channel: #ffmpeg-devel | Bug reports: http://bit.ly/cqvkhs | Wiki: https://trac.ffmpeg.org/ | FFmpeg 4.2 is released | This channel is publicly logged".
[14:33:41 CEST] <furq> it'll probably be in your status window
[14:33:45 CEST] <cehoyos> The topic was set by michaelni!
[14:33:52 CEST] <cehoyos> Channel modes: no colors allowed, no messages from outside, topic protection
[14:33:58 CEST] <cehoyos> This channel was created on 11/26/06 7:42 AM.
[14:34:04 CEST] <cehoyos> Sorry, I still don't see it
[14:34:14 CEST] <greysondn> https://imgur.com/XHmU6kF
[14:34:17 CEST] <Spring> I see, thanks. I'll run some tests a bit later.
[14:34:20 CEST] <greysondn> I'm in web client.
[14:34:28 CEST] <furq> https://clbin.com/5s3tm
[14:35:06 CEST] <greysondn> So... That's not working, I'mma just use normal pastebin. I'm getting what I'm dealing with together right now. That was just "I joined and woops".
[14:36:08 CEST] <furq> someone with ops needs to /msg chanserv set #ffmpeg entrymsg ...
[14:36:17 CEST] <furq> or something along those lines, i've never run a channel on this network
[14:36:18 CEST] <cehoyos> It appears I am only operator in -devel,
[14:37:16 CEST] <furq> anyway yeah any pastebin is fine
[14:40:29 CEST] <greysondn> So. I've got some python code ( https://pastebin.com/EuycVQv7 ) that calls two ffmpeg subprocesses that is giving me a headache. The first of the two just opens a video file and reads the raw frames from the video into python for me. It's just fine. I then do some work on those using python, and output them to the second one where things seem to be
[14:40:29 CEST] <greysondn> going wrong. That subprocess can't run in realtime, but for whatever reason tries to. I have it muxing the original audio and the new frames (as it converts them) into a new video, and I'd really prefer to get this out of trying so hard to be realtime if at all possible because of the queue blocking when it fills.
[14:41:07 CEST] <greysondn> The significant part I figure maybe you could help me with is just the arguments I'm passing to ffmpeg here.
[14:41:07 CEST] <cehoyos> But his isn't python-help;-(
[14:41:11 CEST] <greysondn> I don't expect you to know any python.
[14:41:26 CEST] <greysondn> If I need to translate those into the ffmpeg calls going on, I can.
[14:41:28 CEST] <cehoyos> Does anybody know how to change the NOTICE?
[14:41:39 CEST] <durandal_1707> NOT ICE
[14:41:45 CEST] <cehoyos> Then translate it and post the complete, uncut console output
[14:42:05 CEST] <greysondn> Sure. There's going to be a "magic" in there, basically.
[14:42:05 CEST] <furq> cehoyos: /msg chanserv set #ffmpeg entrymsg
[14:42:14 CEST] <cehoyos> No
[14:42:38 CEST] <cehoyos> Or yes
[14:42:42 CEST] <cehoyos> there is also a notice command
[14:43:36 CEST] <cehoyos> Invalid command
[14:44:23 CEST] -cehoyos:#ffmpeg- When
[14:52:08 CEST] <cehoyos> Sorry, I was unable to find out how to change the notice
[14:52:09 CEST] <greysondn> Should be this
[14:52:10 CEST] <greysondn> https://pastebin.com/7ReF1EXq
[14:52:24 CEST] <greysondn> Note that I've just ran my python and dumped from there, but should be correct.
[14:53:00 CEST] <greysondn> That WTF between the pipes is just where the frame edit goes. Takes in raw frames, spits out raw frames.
[14:53:21 CEST] <cehoyos> This is unreadable: Assuming you have a problem with the second command, save the rawvideo stream in a file and use cat
[14:54:56 CEST] <greysondn> I'm puzzled at your response.
[14:55:50 CEST] <greysondn> So you have the arguments given to it and the problem I'm facing. What are you missing still?
[14:55:55 CEST] <cehoyos> Don't worry: Everybody is today;-)
[14:56:33 CEST] <cehoyos> What I see is the console output of two ffmpeg commands interleaved with each other: Sorry that I believe parsing this is simply too difficult
[14:56:44 CEST] <greysondn> Okay.
[14:56:46 CEST] <greysondn> That makes more sense.
[14:56:52 CEST] <greysondn> Didn't even consider it TBH
[14:56:57 CEST] <greysondn> What I can do is just trash the first one.
[14:57:00 CEST] <greysondn> Would that help?
[14:57:14 CEST] <greysondn> It seems to be what you're asking me to do anyway.
[14:58:34 CEST] <furq> greysondn: that looks like it finished ok
[14:58:39 CEST] <furq> is the output actually broken
[14:58:50 CEST] <greysondn> It did. It informed me the queue blocked at least once, however.
[14:59:01 CEST] <greysondn> I would assume that means it dropped a frame.
[14:59:13 CEST] <furq> no the status line would tell you if it dropped frames
[14:59:27 CEST] <furq> the thread message queue blocking is just a warning to tell you that it's waiting for an input frame
[14:59:37 CEST] <furq> or waiting to output a frame
[14:59:57 CEST] <greysondn> So I would have to wait if it was realtime, but I don't have to wait if I'm just processing a video with non-realtime constraints?
[15:00:14 CEST] <furq> yeah that all looks fine to me
[15:00:31 CEST] <greysondn> Dead honest, didn't even realize it was interleaved.
[15:00:39 CEST] <greysondn> I thought it was showing the first and then the second when I looked at it.
[15:01:33 CEST] <furq> i'm surprised it deals with a full pipe buffer so neatly
[15:01:36 CEST] <furq> i would have expected that to break
[15:01:38 CEST] <cehoyos> Sorry that I find this extremely unlikely (from just looking at the output and your message)
[15:01:49 CEST] <cehoyos> Why?
[15:02:03 CEST] <cehoyos> I believe this is a common way of using FFmpeg
[15:02:27 CEST] <greysondn> It supports pipes. The only thing weird I've done is do image editing via python, but there's no reason I can't.
[15:02:41 CEST] <greysondn> Just have to make it hook into the pipes, which I've done.
[15:02:43 CEST] <furq> well mostly because the subprocesses are being called from python
[15:02:53 CEST] <furq> but yeah i guess if you do it properly it's no different from doing ffmpeg | foo | ffmpeg
[15:03:32 CEST] <Spring> For the curious ran some simple timing benchmarks on 7zip (1 and 15 iterations) vs zlib compression with both optimizations enabled/disabled. 7zip with 1 iteration was literally the same speed as zlib with optimizations enabled so I decided to use that. Saved 29 seconds over what I was using prevously.
[15:03:35 CEST] <greysondn> The major fly in the ointment, if you ever hear someone trying this, is that your pipe buffer in python must be at least the size of a frame.
[15:03:52 CEST] <greysondn> The default pipe buffer is quite small.
[15:03:57 CEST] <Spring> *7zip with 1 iteration and optimzations enabled
[15:03:58 CEST] <furq> yeah that's true of pipe buffers in general
[15:09:55 CEST] <greysondn> Sorry, that's a test clip about seven minutes long. I'm just watching it now to make sure it did actually come out clean. 2 minutes and so far, so good.
[15:10:44 CEST] <cehoyos> Spring: Did you compare FFmpeg with something else?
[15:12:04 CEST] <Spring> Haven't tried ffmpeg yet. Since reducing the processing time with APNG Assembler though I'm in a much better spot.
[15:15:34 CEST] <greysondn> Far as I can tell it did.
[15:16:10 CEST] <greysondn> Might hear from me on a later date, but as it is, it appears I should apologize for wasting time just to find out everything's fine.
[15:23:07 CEST] <ossifrage> Is there a way to get ffplay to visualize the h.264 block sizes?
[15:24:13 CEST] <greysondn> I'mma duck out of your hair. Thanks for your time and help!
[18:24:10 CEST] <cpusage> Hi. I'm trying to strip/delete/purge metadata from a bunch of older .wmv files I have
[18:24:12 CEST] <cpusage> using
[18:24:15 CEST] <cpusage> ffmpeg -i input.wmv -map_metadata -1 -c copy output.wmv
[18:24:34 CEST] <cpusage> but I get the following error:
[18:24:35 CEST] <cpusage> [asf @ 000002f0a1a58700] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[18:24:48 CEST] <cpusage> and the output file is larger than the input file
[18:25:21 CEST] <cpusage> any ideas on what I can do to properly do this?
[19:05:37 CEST] <cehoyos> cpusage: Please provide the command line you tested together with the complete, uncut console output.
[19:17:32 CEST] <cpusage> cehoyos would this suffice?
[19:17:34 CEST] <cpusage> https://pastebin.com/V7NpbRf9
[19:18:14 CEST] <cehoyos> What problem do you have with the output file?
[19:18:22 CEST] <cpusage> resulting (output) wmv/asf file is bigger than the original (input), and no playback
[19:18:53 CEST] <durandal_1707> playback in what?
[19:19:22 CEST] <cpusage> the resulting wmv doesn't play in any media player. It's stated as playing, but is just paused on a frame
[19:19:31 CEST] <cehoyos> Please provide an input file
[19:19:39 CEST] <cehoyos> That allows to reproduce the issue
[22:24:05 CEST] <Agafnd> is there a way get ffprobe to output just the resolution and framerate of a file?
[22:25:29 CEST] <JEEB> use a parse'able output
[22:25:31 CEST] <JEEB> like -of json
[22:25:44 CEST] <JEEB> and then something like -show_format -show_streams
[22:25:52 CEST] <JEEB> then you can parse the stdout
[22:26:41 CEST] <Agafnd> ah yeah. I think that'll work
[23:01:13 CEST] <auser0> hello everyone, what does this command do ;
[23:01:14 CEST] <auser0> ffmpeg -i test.ts -f lavfi -i "movie=test.ts[out0+subcc]" -map 0 -map 1:s -c:a copy -c:s srt final.mkv
[23:01:51 CEST] <auser0> i have some .ts that has some CC subtitles that i want to convert to SRT and mux into that mkv, while the audio and video streams to be untouched so no encoding of both of them
[23:03:21 CEST] <JEEB> it makes two inputs. one is the actual file, and the other utilizes the movie lavfi device that has a hack to create a subtitle stream for possible closed captions
[23:03:33 CEST] <JEEB> then it maps all streams from input 0 (the first one, thus the .ts file itself9
[23:03:52 CEST] <JEEB> then it maps the subtitle stream from input 1 (the second one)
[23:04:08 CEST] <JEEB> and finally it sets the *audio* codec to copy and *subtitle* codec to srt
[23:04:16 CEST] <JEEB> for some reason it re-encodes the video stream?
[23:04:37 CEST] <JEEB> if you want to strip the closed captions then there's a filter_units or so bit stream filter
[23:04:48 CEST] <JEEB> no actual re-encoding needed
[23:04:58 CEST] <auser0> thanks JEEB
[23:05:04 CEST] <JEEB> https://www.ffmpeg.org/ffmpeg-all.html#filter_005funits
[23:05:05 CEST] <auser0> i don't want no re-encoding at all
[23:05:23 CEST] <JEEB> see the example for filter_units on how to utilize it
[23:05:37 CEST] <JEEB> and switch the codec definitions basically to -c copy -c:s srt
[23:05:51 CEST] <JEEB> (copy everything, set subtitle codec to srt)
[23:07:17 CEST] <auser0> ah, i tried that before but it ignored the subtitles
[23:07:28 CEST] <auser0> would that lavfi device hack thing works fine?
[23:07:45 CEST] <auser0> can't seem to understand how that filter_untis work
[23:09:11 CEST] <auser0> how do i re-edit that lavfi device to not re-encode the video JEEB ?
[23:09:19 CEST] <JEEB> it can't
[23:09:28 CEST] <JEEB> that's why you ignore everything else from the lavfi input
[23:09:55 CEST] <auser0> so for that hack to work, it will need to re-encode the video first, right?
[23:11:13 CEST] <cehoyos> No
[23:11:21 CEST] <cehoyos> It will need to decode the video
[23:11:33 CEST] <cehoyos> If you need the subtitles as srt, you currently have to decode video
[23:11:49 CEST] <auser0> ah thanks
[23:11:52 CEST] <cehoyos> If you don't need the subtitles (as srt), you don't have to use the movie filter at all.
[23:12:07 CEST] <cehoyos> If you need the subtitles as srt, you currently have to decode video *using the video filter"
[23:12:17 CEST] <cehoyos> If you need the subtitles as srt, you currently have to decode video *using the movie filter*
[23:12:22 CEST] <cehoyos> (Sorry, it's late here)
[23:12:29 CEST] <auser0> np, thanks
[23:13:17 CEST] <auser0> so in both scenarios whether i chose to use the lavfi hack or the video filter, it will need to re-encode the video
[23:13:30 CEST] <cehoyos> If you want the video and the subtitles as srt, you can choose if you want both the video including the closed captions and the srt subtitles (-c copy) or the video without the closed captions but with the additional srt subtitles (-c copy and the bitstream filter)
[23:13:46 CEST] <cehoyos> No, definitely not
[23:14:39 CEST] <auser0> okay, sorry i am confused a little here
[23:14:56 CEST] <auser0> i would like to extract the subs as srt and that SRT only to be muxed in the final mkv
[23:15:08 CEST] <auser0> i don't want to keep the CC subs at all in the final output mkv
[23:15:38 CEST] <cehoyos> Then you need a bitstream filter that JEED mentioned
[23:15:44 CEST] <cehoyos> JEEB...
[23:15:49 CEST] <auser0> would you be able show me an example of a CLI on how to do that filer method?
[23:16:02 CEST] <JEEB> I linked to the example for it ;)
[23:16:11 CEST] <cehoyos> No, I didn't suggest it because I didn't know it already existed
[23:17:31 CEST] <cehoyos> Given that the filter will mostly be used for Closed Captions, an explicit example may help =-)
[23:17:59 CEST] <auser0> ffmpeg -i XX.ts -c:v copy -bsf:v 'filter_units=pass_types=1-5' FINAL.mkv
[23:19:11 CEST] <auser0> that didn't seem to convert those subtitles to SRT, the output has the audio and video streams only
[23:19:52 CEST] <auser0> https://pastebin.com/raw/xbn6fwR0
[23:19:58 CEST] <auser0> maybe those subs are hardcoded ?
[23:21:31 CEST] <cehoyos> The command line was supposed to remove the Closed Captions, did it work?
[23:21:45 CEST] <cehoyos> The command line did (certainly) not create a srt stream
[23:21:50 CEST] <cehoyos> in the output file
[23:22:27 CEST] <cehoyos> And please understand that this is not the MediaInfo channel
[23:23:14 CEST] <auser0> that didn't seem to work nope
[23:23:27 CEST] <cehoyos> The Closed Captions are still in the output file?
[23:23:35 CEST] <auser0> when i ran that command, the final MKV had no subtitles at all
[23:23:41 CEST] <auser0> https://pastebin.com/raw/LKvLHdnR
[23:24:16 CEST] <auser0> I was as if i am doing -c copy, only audio and video streams are muxed in the final output mkv
[23:24:17 CEST] <cehoyos> Please do not (as in: never) post excerpts of your ffmpeg command, always post the complete, uncut console output
[23:25:23 CEST] <auser0> sure cehoyos
[23:25:24 CEST] <auser0> https://pastebin.com/raw/zpRkjyBR
[23:25:27 CEST] <auser0> sorry, new here :)
[23:26:00 CEST] <cehoyos> I assume you also want "-c:a copy" to not re-encode audio
[23:26:45 CEST] <JEEB> (if you do not set a codec for a type of media it will get re-encoded by *something*)
[23:26:52 CEST] <JEEB> (that is generally not something you want)
[23:27:08 CEST] <JEEB> (thus, always explicitly set the encoder for everything unless you really know what you're getting is what you want)
[23:27:10 CEST] <cehoyos> Because it both takes time and (even if not noticeable) reduces quality
[23:27:58 CEST] <auser0> got it, thanks
[23:28:10 CEST] <auser0> ya, when i ran it with -c:a copy, it didn't re-encode the audio
[23:28:23 CEST] <auser0> what does "bsf:v" mean ?
[23:28:51 CEST] <cehoyos> Call the video bitstream filter filter_units (that removes the non-video parts of the h.264 bitstream)
[23:29:22 CEST] <JEEB> "bit stream filter : video"
[23:29:24 CEST] <JEEB> basically
[23:29:40 CEST] <auser0> thanks guys
[23:30:40 CEST] <auser0> so after i ran that command for the bsf:v, what should i do next to get those srt subtitles?
[23:31:05 CEST] <another> *sigh*
[23:31:17 CEST] <JEEB> the lavfi thing is needed to get an AVStream out of the closed captions due to a limitation in the ffmpeg.c command line application
[23:31:40 CEST] <JEEB> unfortunately people have priorities and things they want to hack on, so ffmpeg.c is not yet dynamic with streams :P
[23:31:58 CEST] <auser0> ah i got it :)
[23:32:03 CEST] <another> ffmpeg -i test.ts -f lavfi -i "movie=test.ts[out0+subcc]" -map 0 -map 1:s -c copy -c:s srt -bsf:v 'filter_units=pass_types=1-5' final.mkv
[23:32:53 CEST] <auser0> thanks another, but here an encoding is going to take place, which i was trying to avoid hehe
[23:33:18 CEST] <auser0> i thought the filter method could magically facilitate me getting the srt without re-encoding :p
[23:33:43 CEST] <JEEB> only the subtitle stream is getitng mapped out of the second input
[23:33:46 CEST] <JEEB> (1th input)
[23:33:52 CEST] <JEEB> (-map 1:s)
[23:34:02 CEST] <JEEB> also it has -c copy AND -c:s srt
[23:34:10 CEST] <another> decoding != encoding
[23:34:22 CEST] <JEEB> which copies all streams, and then sets encoder to srt for subtitles
[23:34:37 CEST] <JEEB> so yes, if the movie filter decodes always then yes, it will decode. but it will not encode
[23:34:44 CEST] <JEEB> the video stream from that isn't even mapped :P
[23:35:10 CEST] <JEEB> or audio
[23:37:00 CEST] <auser0> oh, a complete newbie here with ffmpeg, i appreciate the thorough explanation
[23:37:15 CEST] <auser0> testing that atm
[23:50:22 CEST] <auser0> i got some error : https://pastebin.com/raw/PHYzFPxM
[23:53:01 CEST] <furq> auser0: replace -map 0 with -map 0:v -map 0:a
[23:55:34 CEST] <auser0> thanks furq
[23:55:42 CEST] <giaco> hello
[23:57:17 CEST] <giaco> I have a mpeg-dash quesiton, not strictly related to ffmpeg. I am capturing a stream and converting it into mpeg-dash chunks, I then need to transfer them to a server that does the actual stream
[23:58:50 CEST] <giaco> so is: dash_producer > <???> > web_server > client (dash_player)
[23:58:54 CEST] <auser0> how do i add English as a language to every stream of those ?
[23:59:19 CEST] <giaco> what would you use considering that the link between the producer and the web_server is not granted? rsync?
[00:00:00 CEST] --- Sun Sep 22 2019



More information about the Ffmpeg-devel-irc mailing list