[Ffmpeg-devel-irc] ffmpeg.log.20190222
burek
burek021 at gmail.com
Sat Feb 23 03:05:03 EET 2019
[00:59:24 CET] <tbrowder> hi,n
[00:59:52 CET] <tbrowder> anyone active now
[01:06:39 CET] <tbrowder> i'm trying to help my brother whose group just had a 50 year reunion and they took about 4 hours of video with an old camcoder that creates m2ts files. i have the ffmpeg on my debian 9 box and i have concatenated the 9 or so streams together via 'cat' to one stream of about 8 gb. i know very little about video, but one search came up with an ffmpeg execline like this:
[01:09:26 CET] <tbrowder> $ ffmpeg -i in.m2ts -vcodec copy -acodec copy out.mp4
[01:10:20 CET] <relaxed> what's the problem?
[01:10:26 CET] <tbrowder> does that sound like it should work? i'm about to try it but would appreciate any advice. thnx
[01:10:40 CET] <tbrowder> relaxed: hi!
[01:10:54 CET] <bodqhrohro> tbrowder: what are you trying to accomplish?
[01:11:44 CET] <tbrowder> convert a single m2ts file to mp4 for viewing and listening via html5 on my website
[01:12:08 CET] <furq> tbrowder: pastebin the output of `ffprobe in.m2ts`
[01:12:28 CET] <furq> if it's h264 and aac then the command line you posted should work
[01:13:17 CET] <tbrowder> ok, it will take a few minutes while i run to my big 'puter
[01:14:56 CET] <tbrowder> ok, trying to paste:
[01:15:09 CET] <relaxed> pastebin.com
[01:19:50 CET] <tbrowder> https://pastebin.com/z1HD6eQf
[01:21:02 CET] <tbrowder> i see h264 but no aac
[01:24:06 CET] <tbrowder> i'm trying it anyway...something is happening...
[01:32:28 CET] <furq> tbrowder: you'll need to convert the audio to aac or else it won't play back in browsers
[01:32:46 CET] <furq> -i in.m2ts -c:v copy -c:a aac -b:a 192k out.mp4
[01:34:53 CET] <furq> uh
[01:34:58 CET] <furq> -i in.m2ts -c:v copy -c:a aac -ac 2 -b:a 192k out.mp4
[01:36:58 CET] <tbrowder> my incantation worked like a charm! i'm not trying to edit anything, but the final product looks just like the original scene. thanks!
[01:37:42 CET] <tbrowder> ah, ok, i was suckered in by the local viewer....
[01:39:58 CET] <tbrowder> furq: i'm trying your incantation...
[01:40:53 CET] <tbrowder> working...
[01:54:06 CET] <tbrowder> furq: thanks! bye fornow
[01:54:48 CET] <Hello71> furq: won't play in *some* browsers.
[01:56:00 CET] <Hello71> should work on Linux I think? I was under the impression that both firefox and chromium used ffmpeg for decoding
[01:57:33 CET] <furq> firefox policy is to only support the lowest common denominator
[01:57:38 CET] <furq> so stuff that should logically work on linux doesn't
[01:58:18 CET] <furq> but yeah for "in browsers" read "in any browser that people might reasonably be using in 2019"
[02:03:54 CET] <another> tbrowder: you might want to throw -movflags +faststart in there
[02:11:13 CET] <furq> you might also want to try without -ac 2
[02:11:52 CET] <furq> i know some browsers used to have headaches with 5.1 audio, but idk if that's still true
[02:11:57 CET] <furq> stereo is probably less hassle though
[03:40:32 CET] <DHE> I've had android issues with 5.1 historically, but that was a year or two ago
[03:44:50 CET] <furq> i can't imagine a camcorder mic is picking up quality 5.1 audio anyway
[04:29:05 CET] <ossifrage> Can someone point me to an example of using libavformat to multiplex a h.26[45] elementary stream as a fmp4 stream?
[13:17:32 CET] <tbrowder> furq: you're right about the mike, sound I heard is not real hugh quality, too bad
[14:12:14 CET] <zaeph> Hello everyone. I'm having trouble getting ffmpeg to accept a palette for colouring sub/idx subtitles. I've extracted the palette from the .ifo file with lsdvd, but putting `-palette "286df0,&"` right before the input file doesn't change anything.
[14:12:46 CET] <zaeph> Here's the command I ran: https://paste.xinu.at/eQKmxe/bash .
[14:16:55 CET] <zaeph> Here's how it looks on the original DVD: https://paste.xinu.at/A0yH/ . And here's how it looks on the output file: https://paste.xinu.at/eGJ/ . Mind you, the output doesn't change whether the `palette` parameter is there or not.
[14:17:59 CET] <zaeph> And I've also tried `-ifo_palette`, which didn't work either.
[14:18:19 CET] <pink_mist> what if you place the parameter right after the input file?
[14:18:28 CET] <zaeph> pink_mist: Let me try.
[14:18:34 CET] <pink_mist> (I've no idea if that'd help or not, but it's something to try)
[14:19:08 CET] <zaeph> Doesn't work either. But it was a good idea.
[14:19:34 CET] <pink_mist> darn, good luck then, hope someone else can help
[14:19:35 CET] <zaeph> I assumed from the wiki that it had to go before the input option: https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options#Subtitle_Color .
[14:20:10 CET] <zaeph> Thanks. I'm not sure whether the problem comes from my file or the `palette` parameter, but I'm not well-versed in ffmpeg, so I'd rather ask here.
[14:24:45 CET] <zaeph> And here's a final paste with a test file and the .ifo: https://paste.xinu.at/m-knj/ . (It also regroups all the previous pastes for convenience)
[14:25:08 CET] <tinystoat> zaeph: I've just made an animated gif using a palette and this is what I had to do: ffmpeg -i "video_to_be_giffed" -i "palette_image" -filter_stuff_here "output_gif_here"
[14:26:02 CET] <zaeph> tinystoat: Thank you, but this is not the same thing. I'm referring to the palette used when displaying sub/idx subtitles on a DVD.
[14:26:35 CET] <tinystoat> zaeph: Ah, pity. I was hoping that would be. Good luck, wish I knew more about this myself.
[14:26:55 CET] <zaeph> tinystoat: Thank you. Fingers crossed.
[14:34:24 CET] <tinystoat> Same. :)
[14:37:40 CET] <brejeiro[xi]> Hello. I'm recording my screen using ffmpeg, and, at some points, I'd like to create "chapters", so that I can fast forward/rewind to certain points, as I would do in DVDs. Is it possible?
[14:43:41 CET] <DHE> depends on the file format. mkv can do that, mp4 can't I believe
[14:49:01 CET] <brejeiro[xi]> DHE: hmmm, I would have to use mp4. But I guess I might think of another way to do this. How would I do that in MKV?
[14:50:36 CET] <DHE> if your'e doing it live, you probably can't do it in ffmpeg in one shot.
[14:52:05 CET] <DHE> hmm... I'm actually not sure. the docs specify a chapter file but aren't clear on the formatting
[14:52:18 CET] <DHE> maybe you just want to use an external tool to add them once you have your timestamps
[14:54:29 CET] <brejeiro[xi]> I don't want to use an external tool to do that. Can you point me to the docs you referred to?
[14:55:04 CET] <brejeiro[xi]> The thing is the video is getting recorded on a limited HW, so every byte matters!
[14:55:14 CET] <DHE> when in doubt, https://ffmpeg.org/ffmpeg-all.html literally has everything. just takes a while to load. :)
[14:57:49 CET] <brejeiro[xi]> Hell yeah! That rocks! Thank you very much, it sure will be very useful!!
[21:25:06 CET] <zaeph> Hello everyone. Im having trouble getting ffmpeg to accept a palette for colouring sub/idx subtitles. Ive extracted the palette from the .ifo file with lsdvd, but putting `-palette "286df0,&"` right before the input file doesnt change anything. You can find more info here: https://paste.xinu.at/m-wlNiJ/
[21:25:31 CET] <zaeph> (This is a copy-paste from an earlier message sent here. Just trying one last time, and then I'm giving up.)
[21:26:04 CET] <JEEB> don't worry, people often are AFK. just stay around and most likely someone will respond (like I just did)
[21:26:36 CET] <JEEB> ok, so the dvdsub decoder has an AVOption called like that
[21:26:36 CET] <JEEB> libavcodec/dvdsubdec.c: { "palette", "set the global palette", OFFSET(palette_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD },
[21:27:01 CET] <JEEB> and you have defined the palette before input, which is correct for decoder options
[21:28:36 CET] <zaeph> JEEB: Thanks for answering. I've browsed the manual and the web extensively looking for details on the topic, but there was very little to see aside from an exchange on the mailing list.
[21:30:01 CET] <JEEB> the parse_palette function is pretty simple
[21:30:22 CET] <zaeph> The only thing that brought the beginning of a result was putting the subtitle tracks alone in a .mkv container, and then mux them together with mkvtoolnix, but that's because mkvtoolnix threw an error saying that it couldn't find the .IFO style and used its own default.
[21:31:36 CET] <zaeph> I don't know how ffmpeg works, but judging from what what I've tested, this seems to be a problem with that parameter. I wish I could test it out with another file and palette, but I don't have access to any of those right now.
[21:31:46 CET] <c_14> Have you tried using -ifo_palette instead? I have (at some point long, long ago) had that work for me
[21:32:08 CET] <zaeph> c_14: I did try it before the input, and it didn't change anything.
[21:32:13 CET] <c_14> meh
[21:32:16 CET] <zaeph> I didn't try to put *after* the input, though.
[21:32:30 CET] <JEEB> after input is encoding params
[21:32:38 CET] <JEEB> http://up-cat.net/p/5fbeaf6f
[21:32:46 CET] <JEEB> you could test with this
[21:32:51 CET] <JEEB> that should log what the function parsed
[21:32:57 CET] <zaeph> I also tried to see if the the verbose debug had anything to say, like if it couldn't find the .IFO or something, but nothing appeared there.
[21:33:02 CET] <JEEB> also
[21:33:08 CET] <JEEB> I just noticed you did -c:s copy
[21:33:13 CET] <JEEB> that's not going to decode anything
[21:33:26 CET] <JEEB> and thus that makes sense why that palette never got applied :P
[21:33:32 CET] <JEEB> since you were just copying the stream through
[21:34:03 CET] <furq> i mean that sort of makes sense except the palette isn't part of the stream
[21:34:15 CET] <furq> otherwise you wouldn't need to specify it manually
[21:34:33 CET] <JEEB> well the palette/ifo_palette parameters are for the decoder
[21:34:39 CET] <zaeph> JEEB, furq: That's what I thought, and I've tried experimenting with that. I'd agree with furq that it doesn't qualify as the subtitle stream per se, but at the same time, I see your point.
[21:34:44 CET] <furq> yeah i'm sure that's the actual problem
[21:34:56 CET] <furq> i'm just saying it doesn't necessarily make sense from a ui perspective
[21:35:03 CET] <JEEB> yes, that I agree with
[21:35:16 CET] <JEEB> I'm just looking at how it works and noticed the copy codec
[21:35:25 CET] <JEEB> thus not surprising that the option didn't get applied
[21:35:36 CET] <JEEB> (since it's an option of a *decoder*)
[21:35:40 CET] <furq> right
[21:35:58 CET] <zaeph> What should I use then instead of copying the stream? Reencode it to a different format that supports vobsub?
[21:36:17 CET] <furq> there is a dvdsub encoder so i guess try that
[21:36:30 CET] <JEEB> -c:s dvdsub, yup
[21:36:48 CET] <zaeph> Something like that? -codec:s dvdsub -f vob
[21:36:56 CET] <JEEB> no need for -f vob
[21:37:00 CET] <JEEB> since you need matroska, no?
[21:37:11 CET] <furq> dvdsub should mux into matroska
[21:37:13 CET] <zaeph> Oh, yeah, sorry, thought that was the format for the sub itself.
[21:37:26 CET] <JEEB> of course the best solution would be to somehow insert the palette into extradata or wherever it is in lavf land
[21:37:35 CET] <JEEB> and do no re-encoding of subtitles
[21:37:36 CET] <zaeph> Splendid, I'll give it a shot. I might have deleted the concat vob in a fit of desperation earlier today, so give me a minute to concat it back.
[21:37:59 CET] <zaeph> Would there be a convenient way to do that with a mkv?
[21:39:49 CET] <furq> if you mean concat a dvd title into an mkv then makemkv will do it
[21:40:04 CET] <zaeph> Oh no, I was talking about JEEB's point about the extradata.
[21:40:04 CET] <furq> i normally use tccat | ffmpeg
[21:40:09 CET] <furq> oh right
[21:40:20 CET] <zaeph> Sorry, should have mentioned his/her name.
[21:40:34 CET] <furq> well yeah i noticed you're seeking into the vob, so i figured you probably just concatenated every vob and you're then seeking to the title start
[21:40:46 CET] <furq> ideally you should do it in a way that actually parses the titlesets properly
[21:41:13 CET] <furq> a bunch of distros dropped tccat though which is annoying
[21:41:45 CET] <zaeph> furq: I'm going to be honest with you, it's my first time doing this. The only experience I have ripping a DVD resulted in me having a chapter-less, subtitle-less file which was interlaced, so well, can't say it went too well.
[21:42:02 CET] <furq> yeah working with dvds is generally annoying
[21:42:12 CET] <zaeph> Arch seems to have it in transcode, so it seems that I'm in luck.
[21:42:37 CET] <furq> makemkv might be better if you don't mind using a gui tool
[21:42:41 CET] <furq> it'll actually keep the chapters
[21:43:26 CET] <zaeph> So, it will just concat everything together, and I can run ffmpeg after to deinterlace the resulting file?
[21:43:50 CET] <furq> yeah
[21:44:18 CET] <zaeph> All right. I'll try that and report back when it's done.
[21:44:36 CET] <zaeph> I'll still try with the basic concat first to see if I can it to work without copying the subtitle stream, just for legacy.
[21:44:41 CET] <furq> you can pipe tccat straight to ffmpeg, with makemkv you need to go through a temp file
[21:45:14 CET] <zaeph> tccat won't keep the chapters, that's the only difference you've mentioned, right?
[21:46:10 CET] <furq> there are probably others, it's been a while
[21:46:46 CET] <zaeph> Right. Well, it's not something that I'm planning to do often anyway.
[21:48:41 CET] <MotionVector> Hello All, quick question. I encoded a video stream with mpeg4 codec on macbook using avfoundation (via the camera). It didn't really encode at the frame rate that I specified in the cmd line. No matter. Is there a field where this encoded frame rate is kept as part of the headers? Or is the only way for me to determine this is to count number of VOP frames within a given time increment? TIA! Don't want to use ffprobe (I
[21:49:30 CET] <MotionVector> If I should ask this question in the dev channel, I will ask there. Thought I'd start here
[21:49:42 CET] <JEEB> did you output into a container?
[21:50:12 CET] <JEEB> the container might have the PTS from the avdevice
[21:50:28 CET] <JEEB> granted if your input avfoundation device provides that
[21:51:05 CET] <MotionVector> ./ffmpeg -f avfoundation -framerate 29.97 -video_size 640x480 -i "0" -c:v mpeg4 -b:v 800k -g 1 test3_i_30_qvga.mp4
[21:51:17 CET] <JEEB> if you are using ffmpeg.c (the command line API client), then -debug_ts will show you the timestamps received from lavf/lavd
[21:51:22 CET] <JEEB> ok, you are using ffmpeg.c
[21:51:23 CET] <MotionVector> that's the cmd line I used to encode, not sure how to specify a container
[21:51:34 CET] <JEEB> it got guessed from the extension
[21:51:38 CET] <JEEB> thus it's mp4
[21:51:45 CET] <JEEB> so in theory the PTS should be set
[21:52:54 CET] <MotionVector> the mp4 header itself doesn't give me much info.. it has 3 atoms or something like that (one that is a container 'mdat' I think)
[21:53:18 CET] <JEEB> L-SMASH's boxdumper can give you the timestamps coded in the mp4
[21:53:24 CET] <MotionVector> and the actual video starts off with a 00 00 01 B3 (a GOV header)
[21:54:14 CET] <JEEB> boxdumper --timestamp file.mp4 > timestamps.txt
[21:54:26 CET] <MotionVector> ffprobe does give me the net framerate
[21:54:35 CET] <JEEB> although I would recommend checking out the output of -debug_ts
[21:54:38 CET] <JEEB> when encoding
[21:55:00 CET] <JEEB> (you might want to redirect the stderr into a log file a la " 2> encode.log")
[21:55:16 CET] <JEEB> since it will log the timestamps received and converted and passed throughout ffmpeg.c
[21:55:37 CET] <MotionVector> will give the boxdumper a shot. and yes, I agree with your debug_ts comment :) .. this was my first encode using ffmpeg
[21:55:40 CET] <JEEB> if the input has timestamps, it should show them being passed through into the output
[21:56:37 CET] <MotionVector> I do see the timestamps in each frame header (VOP header)
[21:56:49 CET] <MotionVector> well, relative timestamps anyway
[21:57:04 CET] <MotionVector> starting at 00:00:00 and offsets
[21:57:14 CET] <JEEB> well I'm expecting you to complain because the mp4 timestamps seem weird :P
[21:57:18 CET] <MotionVector> (in the byte stream I meant)
[21:57:21 CET] <JEEB> as in, the container ones
[21:57:35 CET] <JEEB> thus I recommended l-smash's boxdumper and -debug_ts in ffmpeg.c
[21:57:37 CET] <MotionVector> no actual encoded bitstream
[21:57:40 CET] <JEEB> yes I know
[22:15:07 CET] <zaeph> JEEB, furq: Guys, you were absolutely right about the `-c:s copy`, that was the problem. Thank you for your wonderful help. :)
[22:15:42 CET] <JEEB> -c:s copy basically says, "for selected subtitle streams, copy the AVPackets without going through a decoder"
[22:16:18 CET] <JEEB> or instead of copying, just "pass the AVPackets without going through a decoder and an encoder"
[22:16:29 CET] <zaeph> Yeah, but I think I was confused by the fact that the palette info was in a remote file, which made it seem like the subtitles themselves didn't have to be reencoded.
[22:17:06 CET] <JEEB> well in theory if someone writes a bit stream filter or an option to either the demuxer or muxer
[22:17:21 CET] <JEEB> you could replace the palette
[22:17:30 CET] <JEEB> hint: nobody has done that
[22:17:46 CET] <zaeph> Right, I get it. Still, I'm not getting quality loss, so I think I'm good to go.
[22:18:04 CET] <zaeph> If there's a loss in quality, it's still much milder than having yellow subtitles.
[22:18:43 CET] <JEEB> for a long time we didn't have similar header changing video packet filtering in FFmpeg, but nowadays we have. so it's not unheard of that such runtime filtering/editing features get implemented
[22:20:12 CET] <zaeph> I'll be on the lookout the next time I get a DVD to rip, then.
[22:22:07 CET] <zaeph> The last thing I need to figure out is how to get the chapters.
[22:22:22 CET] <zaeph> It's a much more trivial issue than the subtitles, though, but I still wonder if I can do it.
[22:22:37 CET] <JEEB> they're in the playlists and I don't think FFmpeg has support for those
[22:22:52 CET] <JEEB> there's probably plenty of things that would extract those
[22:22:57 CET] <furq> it's not something you can do with just ffmpeg
[22:23:08 CET] <zaeph> Apparently mplayer can do that. Mux with mkvtoolnix after?
[22:23:09 CET] <furq> mkvtoolnix has support for chapter files and there are tools that will extract them from an ifo in the right format
[22:23:17 CET] <furq> but i can't think of one for linux off the top of my head
[22:23:39 CET] <JEEB> one could write a tool based on the dvdnav/whatever libraries
[22:23:55 CET] <JEEB> which are cross-platform
[22:52:50 CET] <zaeph> I'm trying something out with ogmrip.
[22:53:35 CET] <zaeph> Well, apparently it just uses mencoder as its backend for getting the chapters, so I'll try that instead.
[23:33:35 CET] <zaeph> All right, I've given up on the automatic retrieval. mkvtoolnix can take an .xml file with the chapters listed in it, so I'll just go that route since it's only one DVD.
[23:33:49 CET] <zaeph> Thanks again for your help figuring everything out.
[00:00:00 CET] --- Sat Feb 23 2019
More information about the Ffmpeg-devel-irc
mailing list