[Ffmpeg-devel-irc] ffmpeg.log.20191208
burek
burek at teamnet.rs
Mon Dec 9 03:05:01 EET 2019
[08:58:09 CET] <void09> symphorien: I've been looking for that answer for a week, it seems it's not possible with the ffmpeg client
[09:10:40 CET] <dartleader> I finally figured out how to do lossless conversion of vob containers to mkv, time to save myself quite a few gigs of HDD space
[09:28:23 CET] <pink_mist> if it's lossless conversion, how are you saving gigs?
[09:31:45 CET] <void09> vob container overhead
[09:32:08 CET] <void09> dartleader: what was so hard to figure out, just drag and drop in makemkv : )
[09:32:19 CET] <kurosu> stripping unnecessary streams as well as using a more efficient file format? he probably means also stream copy
[09:32:40 CET] <kurosu> (ie not reencoding to a different, lossless codec)
[09:45:54 CET] <pink_mist> stripping unnecessary streams sounds like it could save some gigs, yeah, but vob container overhead shouldn't be that large
[09:46:17 CET] <pink_mist> I would argue that stripping streams means it's not lossless anymore though :P
[10:11:45 CET] <void09> yes, and you lose the menus
[10:12:30 CET] <void09> I was wondering, theretically, it would be possible to convert the mkv back to .vob or .m2ts (bluray format) with ffmpeg, from mkv, once you remux it
[10:13:18 CET] <void09> do you think there's a way to do this on the fly, so for example, i could play the dvd/bd using the mkv re-muxed to m2ts/vob on the fly?
[10:38:46 CET] <void09> without having to actually save it in that format
[13:24:19 CET] <spfy> Hi guys. Anyone able to answer my question? I am piping an .mkv into ffmpeg. It has a video stream and a subtitle stream. I'd like to hardsub the subtitle stream.
[13:24:19 CET] <spfy> stream is not image-based. Is it not possible to use the subtitles filter with a pipe or input stream?
[13:28:16 CET] <JEEB> spfy: yea currently you can only do it with the subtitle filter or so which takes in the input file as well, and thus internally reads it too. and thus piping probably won't work too well
[13:28:57 CET] <JEEB> I don't think it's a gargantuan job to add support to the sub2video logic the same stuff that the subtitle/ass filters are doing
[13:29:05 CET] <JEEB> but nobody has cared enough to do that yet
[13:29:40 CET] <JEEB> I think mpv's encoding feature can do that, not sure how close that is to something you'd want to try
[13:29:56 CET] <spfy> i see. darn. i'm trying to set up a nice pipeline for this instead of saving the files first.
[13:30:06 CET] <spfy> oh i havent tried mpv. ill look into it! thanks!
[13:30:40 CET] <BtbN> There's a lot of stuff that makes use of being able to seek in the input, so a pipeline isn't always the best idea.
[13:31:24 CET] <JEEB> well as long as you don't need any of that then piping isn't too bad?
[13:31:56 CET] <spfy> hardsubbing does require encoding though, which might seek i guess. i dont know too much about this kind of thing though
[13:32:17 CET] <JEEB> encoding by itself is a A->B process
[13:32:27 CET] <JEEB> otherwise encoding of live streams wouldn't exactly be a thing :)
[13:33:06 CET] <pink_mist> if the mkv has attachments for fonts or similar things though, that may require seeking
[14:16:07 CET] <void09> JEEB: any idea how i can send ffmpeg output to a named pipe ? I want to see if it's possible for a bluray to play with m2ts stream coming from an mkv
[14:16:35 CET] <void09> or anyone else : P
[14:17:36 CET] <spfy> can't you just redirect ffmpeg's stdout to the pipe?
[14:18:04 CET] <void09> how would i do that ?
[14:19:19 CET] <spfy> ffmpeg -i input.mp4 -c copy - >/my/pipe
[14:20:03 CET] <spfy> if you don't specify an output file and put - instead, it just writes the output to stdout. then you can redirect to the named pipe. hope it's clear!
[14:20:57 CET] <void09> hmm, does ffmpeg support m2ts as an ouput format anyway ?
[14:21:03 CET] <void09> I don't see it in ffmpeg -formats
[14:21:26 CET] <void09> oh, mpegts ?
[14:21:30 CET] <spfy> that i dont know lol
[14:22:22 CET] <void09> ffmpeg -i backup.m2ts -c copy - > 00274.m2ts
[14:22:25 CET] <void09> is this correct?
[14:23:02 CET] <void09> 00274.m2ts being a pipe created with mkfifo 00274.m2ts
[14:23:53 CET] <void09> if i run that and try to do something with it (like cat), I get: [NULL @ 0x56330d0b3240] Unable to find a suitable output format for 'pipe:'
[14:23:54 CET] <void09> pipe:: Invalid argument
[14:24:12 CET] <zeromind> you'll need to specify the format manually
[14:24:43 CET] <void09> :O Works
[14:25:09 CET] <spfy> nice! named pipes are magic. i started playing with them myself
[14:25:25 CET] <void09> I want to have bd-remux and bd too
[14:25:33 CET] <void09> like having the cake and eating it too :P
[14:25:57 CET] <void09> ok, is it normal for ffmpeg to exit when i close the video player reading the pipe ?
[14:26:07 CET] <void09> if yes, can i do something to keep it open ?
[14:26:26 CET] <void09> I get this on player exit: av_interleaved_write_frame(): Broken pipeB time=00:00:08.38 bitrate=35662.7kbits/s speed=1.35x
[14:26:26 CET] <void09> Error writing trailer of pipe:: Broken pipe
[14:27:14 CET] <spfy> maybe when you close the player, it's closing the pipe. not sure how you'd prevent that
[14:28:22 CET] <void09> when opening the Bluray folder in vlc, it does not work though
[14:28:27 CET] <void09> maybe vlc does not expect a pipe but a file
[14:28:47 CET] <void09> since the size of the pipe in thefilesystem is 0
[14:31:11 CET] <void09> playing the bd folder in smplayer results in some extras being played
[14:31:36 CET] <void09> playing the m2ts pipe in smplayer makes ffmpeg crash, but when restarting the ffmpeg pipe output, it start playing
[14:39:36 CET] <void09> hm seems you cannot seek back with a named pipe
[14:40:29 CET] <pink_mist> of course you can't
[14:40:35 CET] <pink_mist> you can't seek in any pipe
[14:42:40 CET] <cehoyos> How did you crash FFmpeg?
[14:42:53 CET] <cehoyos> It is not supposed to crash, if you can reproduce, please explain how!
[14:43:14 CET] <pink_mist> he closed the pipe ffmpeg was writing to, and ffmpeg got a SIGPIPE, and it reported that as an error
[14:43:21 CET] <pink_mist> afaik that's precisely how it should happen
[14:43:47 CET] <void09> yeah, i also crashed smplayer trying to close the "file"
[14:43:58 CET] <void09> vlc and mplayer worked ok
[14:44:05 CET] <void09> but what i really wanted to do does not work : (
[14:44:47 CET] <void09> can you do some brainstorm and tell me if there is any way to make this happen ? even writing custom code
[14:45:21 CET] <void09> That is, play a bluray with menus and everything, where the main feature stream comes from ffmpeg, doing mkv -> m2ts
[14:46:22 CET] <cehoyos> Note that FFmpeg does not really write bluray streams, it can write mpegts (to some degree)
[14:46:32 CET] <cehoyos> Patches to improve the bluray support exist
[14:47:11 CET] <cehoyos> And to repeat above: If FFmpeg crashes, there is (nearly) always an issue that should be fixed, if FFmpeg received a signal and reported an error and did not crash, there is of course no issue.
[14:48:12 CET] <void09> cehoyos: oh so no bluray stream support ? interesting
[14:48:44 CET] <cehoyos> (FFmpeg may for example crash if the memory allocation model of the underlying operating system is optimistic - which it often is - and the OS does not immediately report out-of-memory but kills FFmpeg later when it tries to access the memory: In this case, FFmpeg cannot be "fixed")
[14:48:48 CET] <void09> I misuses the word crash I guess
[14:48:52 CET] <cehoyos> No output support
[14:48:56 CET] <cehoyos> thank you!
[14:49:27 CET] <void09> so what's the state of those patches for m2ts ?
[14:49:44 CET] <void09> and why are they so difficult to implement, isn't the standard open ?
[14:49:49 CET] <JEEB> no?
[14:49:57 CET] <JEEB> blu-ray specs cost $8000/year
[14:50:00 CET] <JEEB> at least
[14:50:03 CET] <void09> lol what
[14:50:09 CET] <cehoyos> (But I don't think this is the main issue)
[14:50:15 CET] <void09> how can tehy cost "/year" ?
[14:50:28 CET] <JEEB> void09: you're not allowed to use them afterwards. either official PDF DRM or otherwise
[14:50:39 CET] <JEEB> the DRM of "not having a digital edition" worked pretty well for the DVD spec apparently
[14:50:47 CET] <JEEB> the actual MPEG-TS spec is open, yes.
[14:50:54 CET] <JEEB> but then what you put and how with what limitations
[14:50:55 CET] <void09> wait.. what
[14:50:57 CET] <JEEB> that is blu-ray
[14:51:16 CET] <cehoyos> The mpegts muxer has (non-trivial) issues independently of bluray...
[14:51:17 CET] <void09> you are not allowed to use them.. like. in software?
[14:51:23 CET] <void09> what if you already wrote the software ?
[14:51:45 CET] <cehoyos> As said, I don't think this is the reason bluray write support is very limited / highly incomplete
[14:51:50 CET] <JEEB> sure
[14:52:00 CET] <void09> I understand, just curious about this bluray spec $8k /year thing
[14:52:06 CET] <bencoh> it most certainly doesn't help people fixing it though :)
[14:52:19 CET] <bencoh> but yeah, ffmpeg mpegts muxer has other issues
[14:52:37 CET] <JEEB> anyways, this only matters if you want to write MPEG-TS that goes through a mastering app's validation
[14:52:50 CET] <JEEB> as in, would be OK to write onto an official blu-ray
[14:53:02 CET] <void09> alrigh then. is there some software that convert bluray menus to some open format ?
[14:53:33 CET] <JEEB> I think matroska had menus specified at some point, but at the end of the day that was so niche that nobody implemented any of that otehr than maybe divx inc briefly
[14:53:53 CET] <void09> oh wow : \ too bad
[14:53:56 CET] <JEEB> and after DVDs the menu systems have differed quite a bit. with blu-ray being java based and all that jazz
[14:54:44 CET] <JEEB> so the best way of keeping the menu structure is to just keep the darn original blu-ray file structure and utilize libbluray
[14:55:09 CET] <JEEB> if you need to "re-master" the thing based on another thing, you get into some other fun things
[14:57:45 CET] <void09> well I want the bluray video and extras backed up as mkv. cause that's the most convenient
[14:57:51 CET] <byte4byte_> blb
[14:58:01 CET] <JEEB> so basically what you need is actually blu-ray input
[14:58:05 CET] <void09> and i also want to back up the bd menu and crap
[14:58:13 CET] <JEEB> well, ok. that is less fun :P
[14:58:23 CET] <JEEB> like, you can get the playlists out
[14:58:28 CET] <JEEB> and remultiplex them
[14:58:38 CET] <void09> and take screenshots of the menu and save them as png :D
[14:59:01 CET] <JEEB> taking screenshots of the m2ts that contain the menu isn't too hard
[14:59:08 CET] <JEEB> they're usually a few minutes of random video
[14:59:12 CET] <JEEB> but it's not containing the java parts
[15:07:16 CET] <void09> so nobody worked on porting bluray menus to something else
[15:07:31 CET] <void09> and there's no working way of convering mkv to m2ts ? :\
[15:08:56 CET] <JEEB> why would you go that way 'round?
[15:09:32 CET] <void09> that way ?
[15:10:35 CET] <JEEB> from matroska to mpeg-ts?
[15:10:53 CET] <JEEB> or well, I can see some specific reasons like putting it through multicast in a local network for some reason, but most people don't do that :P
[15:12:33 CET] <void09> JEEB: from matroska to m2ts so i can copy all teh bd files excep the extras and main film, and when i need "bluray", i give it a m2ts stream from mkv
[15:12:35 CET] <void09> that was the plan
[15:12:57 CET] <JEEB> ok, so that now depends on how the blu-ray data files are working
[15:13:12 CET] <JEEB> because it's quite possible that the playlists etc just base on offsets
[15:13:24 CET] <JEEB> not that I know, if you read libbluray's code you might understand it better
[15:13:42 CET] <void09> I have thought of that. I thought it would at least play, with no working chapters and such
[15:13:47 CET] <void09> but it might not be that simple
[15:14:22 CET] <JEEB> so at that point I think esp. with current master the actual writing of the mpeg-ts is not the problem, the problem is then adjusting the things you have backed up to the newly created mux you have done
[15:14:56 CET] <JEEB> but of course I can't be sure, you'll have to read the "requirements" by reading libbluray code or so :P
[15:15:11 CET] <void09> :[ no
[15:15:29 CET] <void09> ok how about dvds then
[15:16:03 CET] <void09> they are split in multiple files, that might prove to be a problem , no ?
[15:16:14 CET] <void09> how do you turn an .mkv into 6 .vobs
[15:16:26 CET] <void09> without writing them to disc
[15:16:30 CET] <JEEB> there were some "re-mastering" apps there, esp. since it was popular to make 4.xGiB DVDs out of 9.xGiB ones or whatever it was
[15:16:43 CET] <JEEB> but I have no idea how good or bad those were
[15:16:54 CET] <void09> no, I don't want to remaster everything
[15:16:56 CET] <void09> anything*
[15:17:21 CET] <JEEB> well you have lost your original media files anyways
[15:17:25 CET] <void09> I want to have playable in both .mkv remuxed format, and the original, without keeping the d ata twice
[15:17:28 CET] <JEEB> so it effectively is creating new muxes
[15:17:39 CET] <JEEB> so recreating the DVD structure from that *is* "remastering"
[15:18:13 CET] <void09> well, technically
[15:18:27 CET] <JEEB> also I know for blu-rays people added subtitle streams etc to them, so there must be some software around :P
[15:18:32 CET] <void09> does not matter, as long as it retains the original "experience" of it
[15:18:46 CET] <void09> yes, there is software to remux those streams
[15:18:58 CET] <void09> which is why i am surprised ffmpeg has issues with it
[15:20:35 CET] <JEEB> I wouldn't be surprised if that software also modifies the playlists etc
[15:20:38 CET] <JEEB> since language codes etc are there
[15:21:42 CET] <JEEB> that is why if you use FFmpeg's libbluray input, which is on the I/O level, you don't get language identifiers or chapters. because they're not on the MPEG-TS stuff which gets passed onto the MPEG-TS reader, but rather in the metadata file(s)
[15:22:56 CET] <JEEB> void09: anyways it's really hard to say anything about what is working and what's not because nobody has really detailed this :P even if we don't go as far as actual blu-ray disc muxing goes, but just something that PC players would play.
[15:23:03 CET] <JEEB> but I wouldn't be surprised if it wasn't just about writing the mpeg-ts
[15:47:53 CET] <byte4byte_> blb
[17:04:31 CET] <glow8> How does ffmpeg download a video when you use `ffmpeg $FFMPEG_FLAGS -i "$url" "$name"`? I want to do exactly the same thing but inside a C program, so that I can save the data into an array rather than a file.
[17:05:17 CET] <glow8> I was going to use libcurl and then convert it with something like sox but I'm not sure if I can do it with libavutil or something like that
[17:17:44 CET] <DHE> ffmpeg abstracts file IO into their own wrapper. HTTP becomes just another IO driver
[17:23:00 CET] <glow8> So if FFMPEG_FLAGS was something like `-ac 1`, it converts the file into mono *while* (not after) reading/downloading the url, right?
[17:23:54 CET] <DHE> it means the input file is converted to mono while still in the "input file reading" phase. not really directly related to file IO
[17:24:30 CET] <DHE> but it means that if you had multiple outputs, all would treat the input as being mono. which would reduce CPU usage vs having each one individually remix the audio before converting
[17:32:10 CET] <glow8> that sounds so painful to program...
[17:33:03 CET] <glow8> Is there some way of piping the ffmpeg output file to an array in C or somethign?
[17:34:41 CET] <glow8> because inside C programs you can only use libav or similars. If I want to use ffmpeg's logic I have to rewrite everything...
[17:37:49 CET] <JEEB> a lot of it is already abstracted from you
[17:38:38 CET] <DHE> ffmpeg provides its own file functions, like rather than fopen() you call avio_open(), instad of fseek() you call avio_seek() etc
[17:38:39 CET] <JEEB> and of course you can literally pipe ffmpeg.c's output to another app
[17:38:54 CET] <DHE> the difference is ffmpeg's functions support stuff like realtime encryption, http(s), etc
[17:49:07 CET] <glow8> I'll try with avio_open() then and see how it goes. Thanks
[17:49:29 CET] <JEEB> not sure if you need custom I/O in your case
[17:49:42 CET] <JEEB> like, if you just want to have raw PCM in buffers, you get that from the AVFrames
[17:52:19 CET] <glow8> All I want is to run a ffmpeg command and have the output inside a C array. One use case is going to be downloading a video and converting it to mono & 48000KHz, and another is recording the desktop audio & converting it to mono & 48000KHz. The thing is that I'm not sure if ffmpeg is the best option for doing this, as it's really low level.
[17:55:12 CET] <JEEB> like I said, the simplest thing when you mention something like that is just having a thing reading the stdout after ffmpeg.c :P
[17:55:41 CET] <JEEB> then if that doesn't get good enough I'm not really sure how "low level" FFmpeg's libraries are given that they generally abstract a whole lot of stuff away from you.
[17:56:13 CET] <JEEB> but if you just want raw PCM at the other end, you can just stdout + pipe on the ffmpeg.c side, and having an app reading that from stdin into whatever you want
[18:01:11 CET] <glow8> that solution wouldn't work on windows though
[18:01:27 CET] <JEEB> why not?
[18:01:41 CET] <glow8> windows doesn't have pipes or stdin or anything like that
[18:01:43 CET] <JEEB> windows has stdou/stdin just like nay other OS
[18:01:45 CET] <JEEB> it does
[18:01:52 CET] <JEEB> I do encoding like that every now and then :P
[18:02:09 CET] <JEEB> I have vspipe pushing out video and then I have ffmpeg.c or x264's cli app or x265's cli app
[18:02:14 CET] <JEEB> taking stuff in from stdin
[18:02:30 CET] <JEEB> named pipes are what don't exist on the same layer
[18:02:36 CET] <JEEB> but stdin/stdout definitely do
[18:03:03 CET] <pink_mist> windows has named pipes too
[18:03:12 CET] <pink_mist> just they're pretty weird
[18:03:12 CET] <JEEB> yes, but I meant in the same way that on lunix
[18:03:13 CET] <JEEB> yes
[18:03:25 CET] <JEEB> you can't just make a named pipe as a file
[18:03:31 CET] <JEEB> and push/pull to/from it
[18:06:28 CET] <glow8> my mind is blown
[18:09:15 CET] <glow8> let me try to understand it
[18:09:29 CET] <glow8> you mean something like `ffmpeg -i test.wav -f wav pipe:1 | ffplay -`, right?
[18:12:35 CET] <JEEB> yes?
[18:12:45 CET] <JEEB> of course you need an output be "-" as well
[18:12:54 CET] <JEEB> or pipe:1 if that works too
[18:13:03 CET] <glow8> yeah that works perfectly
[18:13:27 CET] <glow8> so you can do that in windows too? I'll have to investigate more about pipes
[18:15:31 CET] <JEEB> yup
[18:15:40 CET] <JEEB> has been utilized for ages
[18:17:24 CET] <glow8> man computers are awesome
[18:17:37 CET] <glow8> it's such a neat solution
[18:17:44 CET] <glow8> thanks a bunch JEEB
[18:35:28 CET] <th3_v0ice> Is there a way to get left portion of a video? lets say, I have input which is 2*W x H, and I want to encode only left part of the video W x H.
[18:37:21 CET] <shibboleth> is ffnvcodec required for both encode and decode hwaccel or is this taken care of by cuda/cuvid?
[18:56:21 CET] <cehoyos> th3_v0ice: There is a crop filter
[19:14:33 CET] <th3_v0ice> @cehoyos: Thanks, I found it. Is there a way to split the frame and output to two different outputs?
[19:18:58 CET] <cehoyos> You have to split first and use the crop filter on both outputs
[19:26:06 CET] <th3_v0ice> Ok, thanks
[19:29:15 CET] <th3_v0ice> One more question, is it possible to use AVFrame->crop_top, left, right and bottom, before AVFrame is sent to the encoder? What I mean is will it be cropped if these variables are properly set for each frame?
[19:31:57 CET] <BtbN> Most likely not, no.
[19:32:14 CET] <BtbN> At least I'm not aware of any encoder even looking at them. I'm not even sure what actually does.
[19:55:46 CET] <cehoyos> The vaapi encoder seems to use it
[19:58:28 CET] <shibboleth> will ffmpeg default to using libjpeg-turbo if these are the only jpeg-dev packs installed?
[19:58:39 CET] <shibboleth> during compilation
[19:58:50 CET] <shibboleth> can't find a configure flag to specify
[20:00:42 CET] <cehoyos> FFmpeg does not support any libjpegs, neither turbo nor non-turbo
[20:00:59 CET] <shibboleth> ok, using its own lavf then?
[20:01:13 CET] <cehoyos> jpeg is not related to lavf
[20:01:33 CET] <cehoyos> But lavc contains a jpeg encoder and decoder, the decoder supports more variants than libjpeg
[20:01:55 CET] <shibboleth> k
[20:15:09 CET] <shibboleth> yeah, i can see ffmpeg build using jpeg2000 for lavc
[20:15:33 CET] <shibboleth> isn't turbo preferable re performance though?
[20:30:23 CET] <cehoyos> There is a native jpeg encoder and decoder, no need for an external dependency (with less features)
[20:31:17 CET] <shibboleth> i get that, reason i'm asking is that turbo includes quite a few accelerations
[20:32:21 CET] <JEEB> you should benchmark that, but I've heard similar remarks regarding jpeg2000 decoding
[20:34:32 CET] <shibboleth> been using zoneminder for close to two decodes, -turbo performance compared to -2000 i ridiculous
[20:35:19 CET] <shibboleth> at least if you've got >=pentium mmx :)
[20:38:38 CET] <shibboleth> anyway, i got my answer. just food for thought
[20:38:39 CET] <shibboleth> ty
[22:30:14 CET] <wouter> hi -- I have a media container with two mono audio streams. How can I use the ffmpeg command line to create a file with a single audio stream that contains a mixed version of the two original mono audio streams?
[22:31:58 CET] <wouter> (alternatively, if it's somehow easy to change two mono audio streams into a single stereo stream, that works too -- I can then use '-ac 1' to mix it down to a single mono channel again, as I've done before with stereo files)
[22:38:27 CET] <wouter> ah, found it
[22:38:49 CET] <wouter> -filter_complex '[0:1][0:2] amix=inputs=2:duration=first' does the trick
[23:18:19 CET] <Numline1> Hey guys :) Sorry, this might not be a question related specifically to FFMPeg, but close enough, since I couldn't figure out any other channel that deals with video. Anyway, I'm about to do some VHS tapes digitalization (is that a word?). I'm using a cinch2USB adapter and following this guide. https://www.youtube.com/watch?v=sn_TDa9zY1c&t=1010s
[23:19:00 CET] <Numline1> Anyway, the guy in the guide speaks about NTSC and interlaced fields used for VHS in NA. Was NTSC used in Europe or did we use PAL for videos? If so, what about interlacing and framerate? Thank you!
[23:49:01 CET] <cehoyos> PAL in Europe
[23:49:06 CET] <cehoyos> always 25 fps
[23:55:36 CET] <Numline1> thanks ;]
[00:00:00 CET] --- Mon Dec 9 2019
More information about the Ffmpeg-devel-irc
mailing list