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

burek burek at teamnet.rs
Fri Dec 13 03:05:02 EET 2019


[00:06:14 CET] <TanaPanda> Hello
[00:06:54 CET] <TanaPanda> Lets say I have a MP4 video that I would like to stream to an IP address using UDP. What command would I use in Rasbian to stream the file using FFMPEG?
[00:07:28 CET] <BtbN> You will need to be more specific then "using UDP"
[00:07:56 CET] <TanaPanda> I want to stream it to say UDP://192.168.6.2:17
[00:08:02 CET] <DHE> usually it means mpegts over udp, and for added fun (ie. pain) over multicast
[00:08:18 CET] <TanaPanda> so file located on my raspbian OS streaming to that IP address
[00:08:30 CET] <TanaPanda> yes sorry TS encapsulation
[00:08:39 CET] <TanaPanda> i would assume for streaming
[00:08:51 CET] <DHE> to do it properly you need to know the bitrate of the source video. preferably it would be CBR or damned close
[00:09:14 CET] <TanaPanda> right click and look at properties for this info?
[00:09:26 CET] <DHE> or ffprobe. but cbr vs vbr isn't so obvious
[00:10:16 CET] <TanaPanda> does VLC use FFprobe in the background when you stream files?
[00:10:36 CET] <TanaPanda> I assume VLC just uses ffmpeg to perform these operations so I am atempting to cut VLC out of the picture
[00:10:43 CET] <DHE> no. it embeds the ffmpeg libraries..
[00:11:17 CET] <DHE> well you can safely overestimate. take your video and audio bitrates, add them together, add 20%, what's the result?
[00:11:29 CET] <DHE> or just the bitrate of the file as a whole +20%
[00:12:25 CET] <TanaPanda> 1239
[00:12:47 CET] <TanaPanda> So with this question your asking me
[00:12:53 CET] <DHE> kilobits?
[00:12:59 CET] <TanaPanda> let me expain some more that i didnt think was relivent
[00:13:55 CET] <TanaPanda> Ideal situation is to have a command line that auto runs. it will point to a video inside a folder and start streaming it upon startup. I would like to be able to delete the video in said folder and replace it with another with the exact same name and then have that video start playing on startup
[00:14:29 CET] <TanaPanda> they will alwyas be streamed to the same IP address and port
[00:14:53 CET] <TanaPanda> such as 192.168.6.2:187
[00:14:58 CET] <DHE> the "right" way to do this requires knowing the bitrates because networks are unreliable and this process makes them better
[00:15:02 CET] <TanaPanda> i mean 192.168.6.2:17
[00:15:07 CET] <DHE> also it's tradition to use a higher number port. 1024 minimum
[00:15:07 CET] <BtbN> If you have something listening there on that UDP port, waiting for mpeg-ts, just blast away and see if it works?
[00:15:20 CET] <TanaPanda> yes it not going through a traditional network
[00:15:29 CET] <BtbN> UDP is UDP though
[00:15:37 CET] <TanaPanda> its gpoing though a device strictly for braodcasting TV
[00:15:41 CET] <BtbN> And ports below 1024 are priviledged, you can't easily bind to them
[00:15:46 CET] <TanaPanda> the Com3000 from technicolor to be specific
[00:16:07 CET] <DHE> ffmpeg -re -i INPUT.MP4 -c copy -f mpegts -bitrate 1239k -muxrate 1239k -pkt_size 1316 udp://192.168.6.2:12345
[00:16:29 CET] <DHE> for the "I don't know the bitrate scenario" dropping the two bitrate parameters may work, but it also may result in glitching due to packet loss
[00:16:43 CET] <BtbN> Broadcasting equipment is usually INSANELY picky with their inputs. So don't be surprised if it just doesn't work at all, for unknown reasons.
[00:16:56 CET] <TanaPanda> It works through VLC perfectly
[00:17:02 CET] <TanaPanda> I would just like to simplify the process
[00:17:24 CET] <DHE> I have used ffmpeg for broadcast equipment in the past. still do from time to time. it works, but yeah you definitely want to be anal about following the rules. the bitrate thing really is one of those rules
[00:17:52 CET] <BtbN> or the profile, or only taking very specific resolutions, or other seemingly random codec constraints
[00:18:01 CET] <TanaPanda> I will tst with dropping the bitrate lines and see what happenes
[00:18:09 CET] <BtbN> Like, "we support h264, but only if you don't use feature XY"
[00:18:11 CET] <DHE> with those options, ffmpeg will go out of its way to send a single UDP packet every 5 milliseconds (or whatever the math works out to be) rather than sending a small burst of packets before waiting 1/30th of a second
[00:18:12 CET] <TanaPanda> when I set the port number literally nothing else will be sharing it
[00:18:59 CET] <DHE> because network switches are garbage with tiny buffers and ffmpeg will just blast packets unless told not to
[00:20:25 CET] <TanaPanda> so the unit function on an internal managed switch
[00:20:49 CET] <TanaPanda> the IP address I am sending the video to belongs to a QAM modulator that will then convert it to RF and send it over COAX
[00:21:06 CET] <DHE> unit function?
[00:21:18 CET] <TanaPanda> ?
[00:21:23 CET] <DHE> <TanaPanda> so the unit function on an internal managed switch
[00:21:25 CET] <TanaPanda> oh my bad
[00:21:41 CET] <TanaPanda> the Com3000 is on a managed switch that I am sending the TS to
[00:21:45 CET] <TanaPanda> is what i meant
[03:37:40 CET] <Yiden> sorry to bother.  I'm wondering if someone can re-post a link to the "to directive" for ffmpeg?
[03:38:04 CET] <Yiden> I'm trying to figure out to extract an mp4 file from an mp4 file from time mm to time nn.
[03:39:14 CET] <pzich> You probably want to use -ss and -t or -to https://trac.ffmpeg.org/wiki/Seeking
[03:40:03 CET] <Yiden> is it going to be hard for me to get th formating right?
[03:40:34 CET] <Yiden> I mean, I just work in a crappy little office.  we don't have a lot of great technolgoy or technical people.
[03:40:56 CET] <Yiden> I mean, is the default input also the default output?
[03:42:03 CET] <Yiden> input format/output format
[03:43:04 CET] <Yiden> this is a great read.  i love the pictures.
[03:43:30 CET] <Yiden> what CMS is this website using?
[03:44:19 CET] <DHE> trac
[03:45:49 CET] <Yiden> Wow, it even talks about burning subs into a video.
[03:46:18 CET] <Yiden> If I just specify a .mp4 output, am I going to have 'codec problems'?
[03:48:24 CET] <Yiden> Uhm, sorry, last thing I was wondering: will "cutting out a section" destroy the origional?
[03:49:16 CET] <Yiden> It would be cool if ffmpeg download page had a link to a persistent example directory.
[03:52:53 CET] <Yiden> for my personal reference: from-to command: ffmpeg -ss 00:01:00 -i "target original.mp4" -to 00:02:00 -c copy target_output.mp4
[04:05:30 CET] <fks> anybody have ffmpeg build that has rav1e
[04:16:19 CET] <edenist> fks: mine is built with it
[04:16:33 CET] <edenist> from freebsd ports
[04:16:37 CET] <fks> edenist how did you get it
[04:17:06 CET] <edenist> built from source
[04:18:07 CET] <fks> i don't use freebsd
[04:18:22 CET] <edenist> what OS?
[04:19:03 CET] <fks> windows
[04:19:15 CET] <fks> i cannot find ffmpeg with rav1e
[04:19:46 CET] <edenist> it's pretty new, and experimental. Likely not goign to find a binary ready to go. Look up a guide to build it from source and you can enable it then
[04:50:39 CET] <iconoclasthero> hi, i'm trying to get ffmpeg to trim an audio file (12 - Joss Stone -- Girlfriend on Demand.flac) to a duration 4m 31s starting from the beginning.
[04:50:39 CET] <iconoclasthero> i thought i wanted to use ffmpeg -i 12\ -\ Joss\ Stone\ --\ Girlfriend\ on\ Demand.flac -to 0:4:31 -acodec copy 12-trimmed.flac
[04:50:39 CET] <iconoclasthero> but despite ffmpeg reporting "size=   23886kB time=00:04:30.93 bitrate= 722.2kbits/s speed=5.84e+03x" both mediainfo and vlc still show the file being 7:30.
[04:54:44 CET] <iconoclasthero> https://pastebin.com/zBBKvzMT
[08:45:06 CET] <Damme> Hey guys, I added an extra sound track to a container, but I lost the chapter titles when doing that. How do I keep that information ?
[12:12:38 CET] <lesshaste> I need to recode a video from 50fps to 30fps. I am using ffmpeg -i in.mp4 -filter:v fps=fps=30 out.mp4
[12:12:56 CET] <lesshaste> two questions. I don't want to recode the audio, can I just copy it over somehow?
[12:13:06 CET] <lesshaste> also, what exactly does -filter:v do?
[12:19:03 CET] <lesshaste> can I just add -acodec copy and it will all be properly synced?
[12:49:58 CET] <BtbN> You will also want to specify video encoder options. Otherwise it will fall back to defaults, which are usually less than ideal.
[13:04:50 CET] <lesshaste> BtbN, ah ok.  The main problem is that reducing the frame rate from 50fps to 30fps is really really slow as an operation it seems.
[13:05:21 CET] <lesshaste> so anything I can do to speed that up would be great
[13:39:28 CET] <BtbN> lesshaste, reducing the framerate is effectively free, it just throws away excess frames.
[13:39:38 CET] <BtbN> Encoding video is slow. Specially on default settings.
[14:17:18 CET] <lesshaste> BtbN, so what is the quick way to do this?
[14:26:52 CET] <DHE> you probably want something like: -c:a copy -c:v libx264 -preset:v faster -crf 25
[14:32:45 CET] <lesshaste> DHE,  thanks!
[14:34:39 CET] <lesshaste> trying that now
[15:09:41 CET] <epileg> hello
[15:10:25 CET] <epileg> is it possible to embed a cue sheet to m4a (pm4 alac audio) with ffmpeg?
[15:10:49 CET] <epileg> *mp4
[15:59:08 CET] <Lantizia_> hey I've been trying to set up a HLS server... think I'm good on that now - and I seem to be able to use ffmpeg to use a .mp4 file as input - and send it to the rtmp server (which is an nginx module) and that spits it out as http hls m3u8 style stuffffs
[15:59:47 CET] <Lantizia_> but having difficulties when i want to use a http mpegts input with ffmpeg to output to rtmp in the same way
[16:00:00 CET] <Lantizia_> ffmpeg doesn't show any errors but webbrowsers can't seem to play the content
[16:00:31 CET] <BtbN> You are aware ffmpeg can just generate a hls playlist on its own?
[16:00:38 CET] <BtbN> So all you need is a relatively dumb http server.
[16:01:07 CET] <DHE> still, the input format shouldn't matter here
[16:01:30 CET] <BtbN> And Browsers are relatively picky with formats they accept. So if it's not h264+aac/vp9+opus, it probably won't play.
[16:01:50 CET] <BtbN> Natively, they don't even support HLS as a transport, that's a JavaScript blob doing that.
[16:14:09 CET] <Lantizia_> BtbN, yeah it's h264 and aac
[16:14:17 CET] <Lantizia_> no i didn't know ffmpeg could just do it on it's own
[16:15:20 CET] <Lantizia_> essentially I'm using this...     ffmpeg -i http://hostname.com:5004/auto/v107 -vcodec copy -vprofile baseline -acodec aac -strict -2 -f flv rtmp://localhost/show/stream
[16:16:26 CET] <Lantizia_> https://pastebin.com/raw/ZWPY5gbz
[16:17:08 CET] <Lantizia_> the video codec is on copy (as it's already h264) but the audio is on aac as the source is aac_latm
[16:17:39 CET] <Lantizia_> oh and i usually throw in -sn to ignore subtitles too
[17:15:40 CET] <iconoclasthero> hi, i'm trying to get ffmpeg to trim an audio file (12 - Joss Stone -- Girlfriend on Demand.flac) to a duration 4m 31s starting from the beginning.
[17:15:40 CET] <iconoclasthero> i thought i wanted to use ffmpeg -i 12\ -\ Joss\ Stone\ --\ Girlfriend\ on\ Demand.flac -to 0:4:31 -acodec copy 12-trimmed.flac
[17:15:40 CET] <iconoclasthero> but despite ffmpeg reporting "size=   23886kB time=00:04:30.93 bitrate= 722.2kbits/s speed=5.84e+03x" both mediainfo and vlc still show the file being 7:30. https://pastebin.com/zBBKvzMT
[18:06:57 CET] <kepstin> iconoclasthero: hmm, i think i remember someone running into something similar before. iirc ffmpeg doesn't update some length metadata when in copy mode with flac.
[18:07:01 CET] <kepstin> might be an issue open for it
[18:13:21 CET] <kepstin> workaround is to re-encode I guess. flac encoding is reasonably fast, and it is lossless, so that's not a terrible option :)
[19:06:23 CET] <epileg> hi, is there a way to use cue sheet with ffmpeg?
[19:25:55 CET] <klaxa> epileg: i'm not sure, but years ago i wrote this script: https://gist.github.com/klaxa/5089109
[19:37:53 CET] <Filarius> i'm doing some x264 related research where i use ffmpeg. I made wrapper to write to stdin and get mp4, and to exactract raw frames from that mp4 to stdout where I read from my program. But i just need to get raw frames after x264 compression, is here some trick I can do it with one command like on ffmpeg ?
[19:38:17 CET] <epileg> klaxa: Thank you, but I'm tolking about cue sheet (metadata text file), not binary one
[19:42:30 CET] <epileg> so basically I've an m4a file with whole CD and also I've a cue sheet with the chapters info. I just want to embed this cue sheet to the m4a (mp4 alac). This is usefull to have a whole live CD without cuts between tracks, but you can choose an specific song as well
[19:42:49 CET] <klaxa> epileg: yes, me too
[19:43:19 CET] <epileg> klaxa: is there a way to do it?
[19:43:54 CET] <DHE> Filarius: you can request raw h264 as an output format. it's on you to be able to split the frames up while parsing it though
[19:45:01 CET] <Filarius> DHE, I mean i need raw_yuv -> h264 -> raw_yuv
[19:45:58 CET] <DHE> encoder, and immediately decode again, presumably to compare the frames to measure quality somehow?
[19:47:13 CET] <DHE> I mean you can do it with 2 ffmpeg instances piped into each other, but I don't think a single instance can do that.
[19:47:51 CET] <Filarius> u mean something like "ffmpeg -i - ... -| ffmpeg -i - ... -"  ?
[19:48:33 CET] <klaxa> epileg: as you can read from the script, it just parses the .cue file
[19:49:00 CET] <Filarius> does in Windows I should use "ffmpeg .. > ffmpeg ... " ?
[19:50:02 CET] <furq> | works on windows
[19:50:50 CET] <furq> ffmpeg -i foo -c:v libx264 -f nut - | ffmpeg -i - -c:v rawvideo -
[19:51:07 CET] <furq> or -f rawvideo
[19:51:25 CET] <Filarius> i quess i will need to add some buffering to wait until frame will come out to compare frames
[19:53:00 CET] <Filarius> I already have commands to read and write to ffmpeg, thanks, just will need make second one to read raw x264 instead of file
[19:54:11 CET] <bodqhrohro_> How to delay drawtext?
[19:54:58 CET] <epileg> klaxa: yes, I tried your script but unsuccessful
[19:55:08 CET] <bodqhrohro_> I think of a trick of drawing it on nullsrc and then overlaying the delayed video stream, but how to make this nullsrc transparent?
[19:55:24 CET] <Filarius> ...right  now I just starting ffmpeg each time to encode only 1 frame and start another time to read that frame from mp4, its add some time to wait until ffmpeg starts and to while process will die
[19:56:50 CET] <klaxa> ah, too bad :/
[19:57:30 CET] <DHE> Filarius: mp4 is not live-streaming friendly. you might try mpegts instead
[20:01:26 CET] <Filarius> i think i will just will try that "double dragon". I have very promising results here. Not sure if "live-streaming" is related here. Hm. do you will advice make piping from ffmpeg to ffmpeg with raw x264 stream, or wrap into mpegts or something ?
[20:08:07 CET] <DHE> wrapping in mpegts might be overkill but somehow I just prefer using a container. it does preserve some metadata like the framerate.
[20:11:30 CET] <Filarius> also i'd like to have very low count of "buffered" frames, because after each unique output i will change what frames in sending in, and with "buffer lag" i will need to keep send "filler" frames until frame of changed kind will pop-up to all me to do next iteration if changes
[20:12:07 CET] <Filarius> *to allow me
[20:13:03 CET] <Filarius> i do not need frame rate, just put frames in and take out
[20:13:41 CET] <iconoclasthero> kepstin:  that's what I ended up doing...i.e., removing the -c copy and it worked.  I don't know what "iirc" ffmpeg means though.
[20:13:48 CET] <iconoclasthero> should i open a ticket?
[20:16:19 CET] <DHE> Filarius: x264 buffers a LOT of frames by default. internally for its own encoding purposes. taking that away can be done but will negatively impact image quality
[20:16:36 CET] <wodim> I want to overlay a series of png files, in loop, one image per frame, on a video. would this be a good approach? https://stackoverflow.com/q/42943805
[20:18:13 CET] <DHE> that's one way. if the duration of each overlay is fixed and consistent, you could probably treat the image sequence as a looping video and do a simple 2-video overlay
[20:22:04 CET] <wodim> can videos have transparency?
[20:22:23 CET] <kepstin> yes, but very few codecs support it so it's pretty rare
[20:22:28 CET] <Filarius> DHE, well, I wish its will be faster whan start ffmpeg per each frame, also right now i work only key-frame, and piping between ffmpeg and ffmpeg will show me something more real, to check on other frames too
[20:22:39 CET] <wodim> adding more context: I would like to add a moving logo, like the one tiktok videos have.
[20:22:47 CET] <wodim> and I thought of that approach
[20:23:04 CET] <kepstin> wodim: it would be easiest to just have a directory of png images as input to ffmpeg for that.
[20:23:32 CET] <wodim> yeah but that creates a video with the files, like a gif, right?
[20:24:27 CET] <kepstin> ffmpeg can read a series of images as a video stream.
[20:24:40 CET] <wodim> yes but... I want to overlay that on another video
[20:25:25 CET] <kepstin> yes? if you have a video stream in ffmpeg, then you can overlay it over another video stream.
[20:25:59 CET] <wodim> hmmm, okay, I'll look into that
[20:26:32 CET] <wodim> thanks
[20:27:44 CET] <kepstin> it should be pretty much "ffmpeg -i somevideo.mp4 -stream_loop 1 -i directory/%04d.png -filter_complex overlay=<options for position> output.mp4"
[20:28:12 CET] <kepstin> obviously fixing any typos i made, since that's just off the top of my head
[20:28:36 CET] <wodim> that's very helpful
[21:31:00 CET] <TanaPanda> Hello
[21:31:39 CET] <JEEB> ohai
[21:32:11 CET] <TanaPanda> So I am using ffmpeg to strema a video to an IP address. I am using the command: ffmpeg -re -i /home/pi/Desktop/ActiveChannel/Property_LCI.mp4 -c copy -f mpegts udp://192.168.6.2:20
[21:32:35 CET] <TanaPanda> however when I connect my laptop to the Pi i am able to see the UDP on wireshark however I am unable to pull up the stream via VLC
[21:32:40 CET] <TanaPanda> any thoughts?
[21:33:02 CET] <TanaPanda> when I do thsi function with VLC the streams comes across as mpegts not UDP on wireshark
[21:33:24 CET] <TanaPanda> also I need to make sure that the video its streaming loops
[21:33:34 CET] <TanaPanda> but that can wait until I get the video working properly
[21:34:43 CET] <BenLubar> quick question to make sure I'm not going crazy: is the imaginary part of the FFT of audio frequency always 0?
[21:35:06 CET] <TanaPanda> incase it helps when i do this via command line on vlc my command looks like this : "std{access=udp,mux=ts,dst=192.168.6.2:20}"
[21:35:42 CET] <TanaPanda> if that question is directed at me then I have no idea
[21:37:54 CET] <BenLubar> oh wait I'm looking at this wrong now it seems more obvious
[22:32:21 CET] <pink_mist> TanaPanda: are you running VLC as root? otherwise there might be issues when listening on ports under 1024
[22:32:27 CET] <pink_mist> 20 is quite far under 1024
[22:34:05 CET] <TanaPanda> well i am streaming the video using vlc right now however I would like to simply use FFMPEG if possible
[22:34:29 CET] <TanaPanda> however I am not getting success with ffmpeg whereas i am successful when using vlc
[22:34:52 CET] <TanaPanda> the device i am streaming to does not have any ports above 780
[22:38:49 CET] <pink_mist> oh, I thought you were watching the stream from ffmpeg with VLC
[22:38:54 CET] <pink_mist> then I have no clue
[22:39:03 CET] <TanaPanda> no I am trying to stream a video to a source using ffmpeg
[22:39:59 CET] <pink_mist> also, all IP implementations I've ever heard of supports ports at least up to 65535
[22:40:11 CET] <pink_mist> I've never heard of one where 780 was the max
[22:41:02 CET] <TanaPanda> i'm sending the stream to a QAM modulator and its channels are set via the port. all ports are satic and end at 780
[23:53:33 CET] <TanaPanda> so
[23:53:52 CET] <TanaPanda> I can get my video to stream but when I watch the packets in wireshark they are using the UDP protocol
[23:54:04 CET] <TanaPanda> how do I get them to stream usign the mpeg ts protocol
[23:54:47 CET] <BtbN> mpeg-ts is not a layer 3 protocol
[23:54:53 CET] <BtbN> Or a protocol to begin with
[23:55:14 CET] <TanaPanda> why does wire shark show vlc streaming using the mpeg ts protocol then
[23:55:29 CET] <BtbN> I highly doubt it does, cause mpeg ts is not a protocol.
[23:55:39 CET] <TanaPanda> I can screen shot and share
[23:55:48 CET] <BtbN> If it claims it is, it's plain wrong.
[23:55:50 CET] <pink_mist> wireshark supports a lot of application protocols too
[23:56:07 CET] <pink_mist> and mpegts is certianly something it can recognise
[23:56:11 CET] <pink_mist> *certainly
[23:56:14 CET] <BtbN> raw mpeg-ts dumped over UDP is no protocol though.
[23:56:23 CET] <BtbN> It's just that, mpeg-ts dumped out via UDP
[23:56:32 CET] <pink_mist> it's a datastream that can be recognised
[23:56:38 CET] <pink_mist> wireshark can recognise it
[23:57:05 CET] <TanaPanda> i just for the life of me cannot get my video to work with ffmpeg but it orks fine when streamed out via vlc
[23:57:28 CET] <TanaPanda> the difference i can see is that coming from vlc it shows the packets as mpeg ts and they work
[23:57:40 CET] <TanaPanda> coming from ffmpeg they show as UDP and do not work
[23:57:51 CET] <TanaPanda> i'm sure its me and not the program
[00:00:00 CET] --- Fri Dec 13 2019


More information about the Ffmpeg-devel-irc mailing list