[FFmpeg-user] How to hardcode subtitles
Can someone please shed some light on how to hardcode subtitles onto a file that already has a subtitles(not hardcoded)? Mediainfo provides the following information ffprobe version 4.1.3-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2019 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzvbi --enable-libzimg libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat58. 20.100 / 58. 20.100 libavdevice58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc55. 3.100 / 55. 3.100 Input #0, matroska,webm, from 'LImmortale.2019.BluRay.1080xH264.Ita.AC3.5.1.Sub.Eng.Ita.mkv': Metadata: title : Encoded By realDMDJ creation_time : 2020-03-14T08:39:17.00Z ENCODER : Lavf58.20.100 Duration: 01:55:25.15, start: 0.00, bitrate: 3249 kb/s Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 90:67 DAR 160:67], 24 fps, 24 tbr, 1k tbn, 48 tbc (default) Metadata: DURATION: 01:55:25.13000 Stream #0:1(ita): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default) Metadata: title : Surround DURATION: 01:55:25.15200 Stream #0:2(ita): Subtitle: ass (default) (forced) Metadata: DURATION: 01:47:24.38000 Stream #0:3(ita): Subtitle: ass Metadata: DURATION: 01:47:25.75500 Stream #0:4(eng): Subtitle: ass Metadata: DURATION: 01:47:25.75500 Mediainfo provides the following information: General Unique ID: 339833835165267786502206373342323544125 (0xFFA99DAD54CAD8304A7E412718A6103D) Complete name: LImmortale.2019.BluRay.1080xH264.Ita.AC3.5.1.Sub.Eng.Ita.mkv Format : Matroska Format version : Version 4 File size: 2.62 GiB Duration : 1 h 55 min Overall bit rate : 3 250 kb/s Movie name : Encoded By realDMDJ Encoded date : UTC 2020-03-14 08:39:17 Writing application : HandBrake 1.2.2 2019022300 Writing library : Lavf58.20.100 ErrorDetectionType : Per level 1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames: 4 frames Codec ID : V_MPEG4/ISO/AVC Duration : 1 h 55 min Bit rate : 2 800 kb/s Width: 1 920 pixels Height : 1 080 pixels Display aspect ratio : 2.40:1 Frame rate mode : Constant Frame rate : 24.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth: 8 bits Scan type: Progressive Bits/(Pixel*Frame) : 0.056 Stream size : 2.21 GiB (84%) Writing library : x264 core 157 r2935 545de2f Encoding settings: cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=abr / mbtree=1 / bitrate=2800 /
Re: [FFmpeg-user] How to compress .MOV file compatible to Canon camera
Am 16.03.20 um 01:43 schrieb Ulf Zibis: Am 14.03.20 um 21:08 schrieb Carl Eugen Hoyos: Am Sa., 14. März 2020 um 20:39 Uhr schrieb Ted Park : Did you already test the following? $ ffmpeg -i MVI_1324.MOV -acodec copy -vcodec copy out.mov Then the codec time base remains Of course. The question is if the file is still playable after remuxing. It is no more playable on the camera. It's about 100 kB smaller then the original with 84 MB. Maybe you should consider the possibility that it isn’t a technical limitation of the decoder capability but something else introduced by proprietary metadata or implementation detail. There’s a huge user data box in the moov, upon a quick glance it has the camera model, firmware version, etc. I have to imagine it is used somehow. Same question: Is the (original) file still playable if you edit this atom? I now inserted the following: 1. "CEAP" to ftyp (0x18 instead 0x14 bytes) 2. moov atom with qt-faststart 2. udta atom from original at the start of moov atom (increases it from 0x1340E to 0x1344A) Result: Instead of a big "?" I now see a the preview picture on the camera. Unfortunately I still can't play the video because of "Not identified Picture". So we are a little step closer to the solution. Any additional ideas? Yes, it would be a great help of a good tool to show and edit other atoms. Which tool could be this? Which ffmpeg loglevel command would show the atoms, even with less nice format? As I see from the qt-faststart output, I see, that there are some other atoms patched: $ qt-faststart MVI_1324_copy_git.mov MVI_1324_copy_git.MOV ftyp 0 20 wide 20 8 mdat 28 84830220 moov 84830248 13326 patching stco atom... patching stco atom... writing ftyp atom... writing moov atom... copying rest of file... So maybe I have to patch them again after inserting the udta atom, but how? -Ulf ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] How to compress .MOV file compatible to Canon camera
Am 14.03.20 um 21:08 schrieb Carl Eugen Hoyos: Am Sa., 14. März 2020 um 20:39 Uhr schrieb Ted Park : Did you already test the following? $ ffmpeg -i MVI_1324.MOV -acodec copy -vcodec copy out.mov Then the codec time base remains Of course. The question is if the file is still playable after remuxing. It is no more playable on the camera. It's about 100 kB smaller then the original with 84 MB. Maybe you should consider the possibility that it isn’t a technical limitation of the decoder capability but something else introduced by proprietary metadata or implementation detail. There’s a huge user data box in the moov, upon a quick glance it has the camera model, firmware version, etc. I have to imagine it is used somehow. Same question: Is the (original) file still playable if you edit this atom? I now inserted the following: 1. "CEAP" to ftyp (0x18 instead 0x14 bytes) 2. moov atom with qt-fast 2. udta atom from original at the start of moov atom (increases it from 0x1340E to 0x1344A) Result: Instead of a big "?" I now see a the preview picture on the camera. Unfortunately I still can't play the video because of "Not identified Picture". So we are a little step closer to the solution. Any additional ideas? Yes, it would be a great help of a good tool to show and edit other atoms. Which tool could be this? Which ffmpeg loglevel command would show the atoms, even with less nice format? -Ulf Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Remove everything but a single color (range)
On Sun, 15 Mar 2020, Ted Park wrote: I think colorkey filter can still do this. Basically you want the converse of what color keying does right? It should work the same (that is the opposite) way, and you just have to invert the alpha value. I'm not quite sure what you mean by invert the alpha value. I think you mean invert the color I'm using... ie, if want to KEEP colors very close to e6e65c (I've refined the color since my first post), then the "invert" of that would be 1919A3 (at least according to an "opposite color tool" I found). So... after some experimenting... colorkey sort of works if I use the "invert" color and max similarity and blend values: colorkey=color=0x1919A3:similarity=1:blend=1 But the yellow box is pretty faint and there's still too much of the video still visible. NOTE: this ONLY works if I use ffplay, not ffmpeg (see below). try using colorkey or colorhold with higher similarity values first. colorhold does seem to work, but as Dan Bridges points out... On Sun, 15 Mar 2020, Dan Bridges wrote: Note, this filter will only make the discriminated stuff gray, not black or transparent. Perhaps someone else will be able to help. Yes... that's what I see. If I use this: colorhold=color=0xe6e65c:similarity=0.25:blend=0.5 Then the "yellow box" stays yellow and everything else becomes gray scale... like I'm watching a black and white video. But I don't want ANY video... I ONLY want the yellow box floating around the screen. Now I did find something that works (colorhold + chromakey) colorhold=color=0xe6e65c:similarity=0.25:blend=0.0,chromakey=color=black:similarity=.1 but this ONLY works if I use ffplay, so perhaps I'm not using it correctly. **IF** I use ffplay, then this does (mostly) what I want: ffplay -i test.mkv -vf "colorhold=color=0xe6e65c:similarity=0.25:blend=0.0,chromakey=color=black:similarity=.1" I ONLY see the yellow box (although it's a bit spotty), but pretty much all of the rest of the video is completely black. That's what I want. BUT, if I use ffmpeg: ffmpeg -i test.mkv -vf "colorhold=color=0xe6e65c:similarity=0.25:blend=0.0,chromakey=color=black:similarity=.1" test-highlight.mkv Then it behaves as if the chromakey filter isn't used at all. If fact, the above produces the same output (as far as I can tell) as this: ffmpeg -i test.mkv -vf "colorhold=color=0xe6e65c:similarity=0.25:blend=0.0" test-highlight.mkv How can I get the same results with ffmpeg that I see with ffplay? I have similar results using only colorkey with the inverted color. ie, using this (sort of) works: ffplay -i test.mkv -vf "colorkey=color=0x1919A3:similarity=1:blend=1" but this doesn't seem to do anything (at least visibly): ffmpeg -i test.mkv -vf "colorkey=color=0x1919A3:similarity=1:blend=1" test-highlight.mkv Here's the complete output for ffmpeg colorhold,chromakey: $ ffmpeg -i test.mkv -vf "colorhold=color=0xe6e65c:similarity=0.25:blend=0.0,chromakey=color=black:similarity=.1" test-highlight.mkv ffmpeg version N-96974-g425b6a9a2c Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (GCC) configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --enable-libbluray --enable-libcdio libavutil 56. 42.100 / 56. 42.100 libavcodec 58. 75.100 / 58. 75.100 libavformat58. 41.100 / 58. 41.100 libavdevice58. 9.103 / 58. 9.103 libavfilter 7. 77.100 / 7. 77.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc55. 6.100 / 55. 6.100 Input #0, matroska,webm, from 'test.mkv': Metadata: ENCODER : Lavf58.29.100 Duration: 00:01:27.36, start: 0.00, bitrate: 2479 kb/s Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480 [SAR 32:27 DAR 16:9], 30 fps, 30 tbr, 1k tbn, 60 tbc (default) Metadata: ENCODER : Lavc58.54.100 libx264 DURATION: 00:01:27.33300 Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: ENCODER : Lavc58.54.100 ac3 DURATION: 00:01:27.35600 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (ac3 (native) -> vorbis (libvorbis)) Press [q] to stop, [?] for help [swscaler @ 0x2447600] No accelerated colorspace conversion found from yuv420p to argb. [libx264 @ 0x21ea280] using SAR=32/27 [libx264 @ 0x21ea280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x21ea280] profile High 4:4:4 Predictive, level 3.0, 4:4:4, 8-bit [libx264 @ 0x21ea280] 264 - core 157 r2980 34c06d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html -
Re: [FFmpeg-user] Remove everything but a single color (range)
Am 15.03.2020 um 11:13 schrieb Dan Bridges: Is it possible to "remove" everything in a video except a specific color (or maybe a range... ie close to a specific color. By "remove" I mean covert every that is NOT the color(s) I want to black or transparent. I have a video that contains a yellowish box that moves about the screen. I want to isolate ONLY the yellowish box. Everything else should become black or transparent. Try the colorhold filter: From http://paulbourke.net/miscellaneous/ffmpeg/FFmpeg_Book.pdf You'd better use the original link to my book. Then you always get the latest version: http://www.astro-electronic.de/FFmpeg_Book.pdf In this case the colorkey filter is the better solution, because the original poster wanted the background black or transparent. Michael ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] "Non-monotonous DTS in output stream" error, previous and current values are equal
On 03/15/2020 09:02 AM, Crazy Red Elephant via ffmpeg-user wrote: Are they actually disruptive, or could you just keep the original stream as is, knowing 1 out of 120 frames or something will be dropped when playing back? To me, yes. I know some other users also reported something about playback issues numerous times but the stream provider doesn't seem to care. I think I mentioned before that remuxing the video with MKVToolNix and the "generate timestamps" option checked... Can you help me find the "generate timestamps" option? I can't find it. I'd like to see what it does with a VOB that has 8 PGCs that are okay, but the 9th & 10th PGCs have audio in advance of video by about 4400ms. Regards, Mark. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] "Non-monotonous DTS in output stream" error, previous and current values are equal
> Are they actually disruptive, or could you just keep the original stream as > is, knowing 1 out of 120 frames or something will be dropped when playing > back? To me, yes. I know some other users also reported something about playback issues numerous times but the stream provider doesn't seem to care. I think I mentioned before that remuxing the video with MKVToolNix and the "generate timestamps" option checked kinda solves the problem but I'm not sure if the video and audio streams are synced after that... Also that produces an .mkv while I need .mp4 ‐‐‐ Original Message ‐‐‐ On Tuesday, February 25, 2020 8:49 PM, Ted Park wrote: > Hi, > > > I tried adding "-fflags +ignpts" before input but that didn't help, there > > are still DTS warnings, however, this time the values are not equal for > > some reason (except the first pair) > > I think igndts is more likely to affect the result but not sure in what way. > > Since you have bad timestamps in your original file, you’ll probably have to > settle for workarounds. Like the first two frame drops seem unavoidable, they > both have dts 0 and one has pts 0. > > The warnings do tell you how it handles the problem when it adjusts the > timestamps so they’re not the same, with the caveat that it might not be > accurate. You could also generate new timestamps based on frame rate but that > might not be accurate, and cause audio sync issues. > > As I recall you said you downloaded the files directly, so the timestamp > related frame drops probably happens to everyone who plays that stream? Are > they actually disruptive, or could you just keep the original stream as is, > knowing 1 out of 120 frames or something will be dropped when playing back? > I’m pretty sure this is your best bet for keeping audio and video > synchronized. > > Regards, > Ted Park > > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Remove everything but a single color (range)
>Is it possible to "remove" everything in a video except a specific color (or maybe a range... ie close to a specific color. By "remove" I mean covert every that is NOT the color(s) I want to black or transparent. I have a video that contains a yellowish box that moves about the screen. I want to isolate ONLY the yellowish box. Everything else should become black or transparent. Try the colorhold filter: From http://paulbourke.net/miscellaneous/ffmpeg/FFmpeg_Book.pdf The 3 parameters are: "color" is the color to be preserved, can be specified by name or by RGB values, for example "orange" can be replaced by #FFA500 "similarity" is a percentage, 0.01 means only the specified color is preserved, 1.0 means all colors are preserved. "blend" is a percentage, 0.0 makes pixels fully gray, higher values result in more preserved color ffmpeg -i input_filename -vf colorhold="FBED54":0.01:0 output_filename This produces tight colour discrimination. If too tight, increase the 2nd parameter from 0.01 until you get what you want. Note, this filter will only make the discriminated stuff gray, not black or transparent. Perhaps someone else will be able to help. A screenshot from an example using similarity=0.5 (a fairly sloppy match) and your colour: https://dl.dropbox.com/s/isipbbtb2bjj7wy/filtered.jpg Dan. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Remove everything but a single color (range)
Hello, > Is it possible to "remove" everything in a video except a specific color (or > maybe a range... ie close to a specific color)? > > By "remove" I mean covert every that is NOT the color(s) I want to black or > transparent. > > I have a video that contains a yellowish box that moves about the screen. I > want to isolate ONLY the yellowish box. Everything else should become black > or transparent. I think colorkey filter can still do this. Basically you want the converse of what color keying does right? It should work the same (that is the opposite) way, and you just have to invert the alpha value. > The specific color is "fbed54" according to the color picker in Gimp. > > FYI. My knowledge of "colors" in general is extremely limited... let's put it > this way, I'm pretty sure RGB stands for Red Green Blue... that's about the > extent of it. So, a specific example would be very helpful. RGB does stand for red, green and blue, and the color “#FBED54” would be a base-16 representation of how much of the three primary colors make up that specific color. The three colors are represented by two hexadecimal (base-16) digits each, with the hidden radix point on the left. So in this case, it would mean Red has a value of (0.)FB, which is 15/16 + 11/256 = 98.5%, green would be 14/16+13/256=92.6% and so on. The thing is video usually uses a different scheme of representing/storing color, so using rgb values to key the subject out might not be ideal. But still, try using colorkey or colorhold with higher similarity values first. Regards, Ted Park ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".