[FFmpeg-user] Problem: extracted alpha plane from a grayscale PNG is shifted by 1 pixel to the left
I have a strange problem with extracting alpha plane from an grayscale PNG with alpha channel. So I have an image with alpha in it and use this command: ffmpeg -i 1-open-patch.png -vf alphaextract -pix_fmt gray testgray_alpha.png or ffmpeg -i 1-open-patch.png -vf alphaextract testgray_alpha.png (wich works same way I think) Problem: the output alpha plane is shifted 1 pixel to the left. The data is ok - but the position is 1 pixel shifted. The problem appears only with ya8 pixel format. If I use same but RGBa image the output plane is correctly positioned. Windows 10 latest build Console output: ffmpeg -i 1-open-patch.png -vf alphaextract testgray_alpha.png ffmpeg version N-93532-g772c73e61f Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20190212 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 48.101 / 58. 48.101 libavformat58. 26.101 / 58. 26.101 libavdevice58. 7.100 / 58. 7.100 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc55. 4.100 / 55. 4.100 Input #0, png_pipe, from '1-open-patch.png': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, ya8(pc), 800x600 [SAR 2835:2835 DAR 4:3], 25 tbr, 25 tbn, 25 tbc File 'testgray_alpha.png' already exists. Overwrite ? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (png (native) -> png (native)) Press [q] to stop, [?] for help Output #0, image2, to 'testgray_alpha.png': Metadata: encoder : Lavf58.26.101 Stream #0:0: Video: png, gray, 800x600 [SAR 2835:2835 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc58.48.101 png frame=1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.853x video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Mikhail ___ 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] FFmpeg website (ffmpeg.org)
Hi, [Offtopic] I am using the online documentation a lot, especially this page https://ffmpeg.org/ffmpeg-filters.html Frankly, I find the site quite hard to read. (IMO, so please don't take as offense) I have published a userstyle for Firefox (with Stylish plugin) that adresses the issues and tends to make it more reader-friendly, i.e. basically it is a remake of the css of ffmpeg.org, but only for most significant styles. Link: https://userstyles.org/styles/153930/greengray-ffmpeg-org (or just search for 'ffmpeg' on userstyles.org) To use it, you must install the Stylish plugin. I have made a windows/firefox only version because I don't have linux now at hand. @maintainers: you might forward this to the site maintainers so they might borrow the design for the actual website if there is a wish. Regards, Mikhail ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] feature proposal - avoid overwriting the input file
James Girotti wrote: > On Tue, Oct 10, 2017 at 4:40 PM, Mikhail V wrote: > > > Currently it is possible to delete the input file if I specify same > > filename in output, > > for example: > > > > ffmpeg -y -i input input > > > > Aren't you specifying that with '-y' you want to "overwrite output file > without asking" Sure, I am. But anybody can miss the typo, and its not so easy to notice in console or text editor, its just two chars in a pile of chars. > > > > or simply: > > ffmpeg -i input input > > (this will promt y/n) > > > > I believe this is the default behavior for any output file that is present > whether it matches input or not (in my example both foo.mkv and bar.mkv > file present): I see your point, yes I can do it with any existing file so there is no fool-proof for general case. But you know, if I delete some wrong output file, then still I have some consolation because I don't lose the input file :) Losing some random output file is not so bad usually from my experience because I probably notice somthing gone wrong within short time and sources for that file still (hopefully) exist. > > Was quite funny actually :) Funniest thing that I could not recover the > > file > > because it is same name. > > > > That reminds me of when I accidentally did 'rm -rf /*' Yeh, wrong batch renaming can cause a lot of interesting situations. > > > > So, it would be nice if ffmpeg compare the output path with all input paths > > and exit with an error. > > > > Is it possible for you to run your command without '-y' or if you're using > a script, then to compare your input and output before passing them to > ffmpeg? Actually this happened to me without '-y'. That time I have just reflexively typed 'y' and enter when prompted [Y/N]. And I can understand because this reflex of mine was trained by doing a lot of trial-and error encodings in the past. In batch scripts I never use '-y' options. Probability of such accident raises when copy-pasting file paths from a file manager into ready full command line strings. And what I am wondering, what can be really *against* such feature. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] A spelling error in a warning message?
Sometimes I get a warning: > Warning: data is not aligned! This can lead to a speedloss "Speedloss" should be "speed loss" I suppose? Mikhail ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Pixel average color filter
Dear ffmpeg team, I need a filter which fills output frame with average color of input. Currently I need it to do row-wise average. Pseudo-code: - take first pixel row - calculate average color in this row and fill output row with this color - take next row - repeat same operation ... and so for all input frame rows So the output frame will be filled with the average color of input frame row-wise. Is there such filter or something similar so I can get similar results? Regards, Mikhail V ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] tools for viewing frames and results
On 10/11/2016 2:24 PM, Mikhail V wrote: On 10/9/2016 12:24 AM, Xen wrote: Is there any way in Linux to obtain an accurate frame/time number through a GUI that can be used with ffmpeg? I know Avidemux hardly works at all, VLC will not reliably show frames. Pitivi is not an option, I haven't tried Kdenlive because it crashed the first time I used it. Haven't attempted OpenShot or Cinerella and "DragonPlayer" is too worthless to exist. What is a good tool to view results after you've created a video? Because VLC closes its window and constantly resizes stuff it is not very suitable. GMplayer in Debian doesn't work. (Kubuntu). I suppose you just want a decent player with frame-by-frame navigation. I use MPC-HC player (https://mpc-hc.org/ ). It is much better than VLC for this purpose, you can navigate frame by frame and show time with milliseconds, and even set custom keyboard shortcuts. If you want to see exact frame number I don't think there is such a player. Sorry, didn't know this Windows only player, just seen it on their site. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] tools for viewing frames and results
On 10/9/2016 12:24 AM, Xen wrote: Is there any way in Linux to obtain an accurate frame/time number through a GUI that can be used with ffmpeg? I know Avidemux hardly works at all, VLC will not reliably show frames. Pitivi is not an option, I haven't tried Kdenlive because it crashed the first time I used it. Haven't attempted OpenShot or Cinerella and "DragonPlayer" is too worthless to exist. What is a good tool to view results after you've created a video? Because VLC closes its window and constantly resizes stuff it is not very suitable. GMplayer in Debian doesn't work. (Kubuntu). I suppose you just want a decent player with frame-by-frame navigation. I use MPC-HC player (https://mpc-hc.org/ ). It is much better than VLC for this purpose, you can navigate frame by frame and show time with milliseconds, and even set custom keyboard shortcuts. If you want to see exact frame number I don't think there is such a player. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Selecting/dropping frames without re-encoding
On 8 October 2016 at 00:31, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > 2016-10-08 0:01 GMT+02:00 Mikhail V <mikhail...@gmail.com>: >> BTW after that manipulations a fair question arizes: why >> ffmpeg does not support something like: >> "... -f image2 -i filelist.txt output" > > (This command tries to read a frame / imagefile called filelist.txt) > It does, it is called -f concat and is just an alternative of your > python script. > > Carl Eugen Hi again. Since you say that "-f concat" should work same as -f image2 to create video from images, probably you can pour some light on what I am doing wrong then. Note that ideally I need an MOV file because Sony Vegas cannot open MXF files for some reason so MOV container is preferred. So I have a file "concat.txt" in my case it holds following data: file 'frame0001' file 'frame0003' file 'frame0005' file 'frame0007' file 'frame0009' file 'frame0011' So it is simply a list of odd frames generated by my script. Now to create a MXF I use this command: $ffmpeg -f concat -r 25 -i concat.txt -vcodec copy out.mxf Which is probably not correct? but I don't know exact right command. The result seems correct BUT ffmpeg spits out errors on each frame (here is only last part of the output): [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 62 times frame= 813 fps= 46 q=-1.0 size= 365042kB time=00:00:00.08 bitrate=37380251.6kbits/s [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 140 times frame= 954 fps= 52 q=-1.0 size= 428351kB time=00:00:00.08 bitrate=43863093.2kbits/s [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 138 times frame= 1093 fps= 58 q=-1.0 size= 490762kB time=00:00:00.08 bitrate=50253979.6kbits/s [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 142 times frame= 1236 fps= 64 q=-1.0 size= 554969kB time=00:00:00.08 bitrate=56828776.4kbits/s [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 142 times frame= 1379 fps= 70 q=-1.0 size= 619176kB time=00:00:00.08 bitrate=63403573.2kbits/s [mxf @ 028f2461b200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 0 Last message repeated 120 times frame= 1500 fps= 74 q=-1.0 Lsize= 673506kB time=00:00:00.08 bitrate=68966967.7kbits/s speed=0.00395x video:672000kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.224039% As said the resulting file is correct, but what does these errors mean I am not sure. Anyway if I use -f image2 to generate a same video no errors appear - how is that? What is correct command then for concat if I am doing it wrong? Now the same command for mov container. MOV is also valid for DNxHD codec and actually is preferred in my case since MXF files cannot be opened by Sony Vegas. $ffmpeg -f concat -r 25 -i concat.txt -vcodec copy out.mxf And the output (last part of it, since it also spits out errors on each frame): [mov @ 014afd95b200] Non-monotonous DTS in output stream 0:0; previous: 1258, current: 0; changing to 1259. This may result in incorrect timestamps in the output file. [mov @ 014afd95b200] Non-monotonous DTS in output stream 0:0; previous: 1259, current: 512; changing to 1260. This may result in incorrect timestamps in the output file. [mov,mp4,m4a,3gp,3g2,mj2 @ 014aff2a0420] moov atom not found [concat @ 014afd956640] Impossible to open 'out.mov' concat.txt: Invalid data found when processing input frame= 750 fps= 43 q=-1.0 Lsize= 336002kB time=00:00:00.13 bitrate=19882772.1kbits/s speed=0.00788x video:336000kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000698% In this case it produces a file but it is _incorrect_ See FFPROBE for mov file - fps is nonsense: $ffprobe out.mov ffprobe version N-79107-g30d1213 Copyright (c) 2007-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
Re: [FFmpeg-user] Selecting/dropping frames without re-encoding
> You can do: > $ ffmpeg -i input -vcodec copy -f image2 frame%4d > > Now make symbolic links to every second frame but > with sequential numbers (Don't ask me how). > $ ffmpeg -f image2 -vcodec dnxhd -i linked_frames%4d -vcodec copy out.mxf > (25fps is the default for the image2 demuxer, use -framerate to change it) Great, this worked for me. I don't know symlinks yet however so I have just deleted every second frame with a python script and then ran that command - worked fine, a video file produces correctly. > Or simply concatenate the frames you like with "cat" and do: > $ ffmpeg -i concatenated_file -vcodec copy out.mxf Well with concatenate I am also not very familiar, but I will look in Moritz' solution. I tried to pass a list with only filenames to concat filter but that did not work, seems the list must contain time points as in Moritz' solution to work at all. BTW after that manipulations a fair question arizes: why ffmpeg does not support something like: "... -f image2 -i filelist.txt output" It would ease all those strange manipulations and would not need symlinks or whatever. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Selecting/dropping frames without re-encoding
On 6 October 2016 at 10:07, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > 2016-10-05 23:08 GMT+02:00 Mikhail V <mikhail...@gmail.com>: >> On 5 October 2016 at 19:55, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: >>> 2016-10-05 15:45 GMT+02:00 Mikhail V <mikhail...@gmail.com>: >>> >>>> Is it possible that ffmpeg cannot do this without re-encoding? >>> >>> You can export single frames and delete half of them using a >>> shell script. > >> Sure I can :) Also I can just directly recode it in 25 fps in any codec. >> So I suppose the answer is - I can't do it without re-encode. > > If you want to drop every second frame without re-encoding at > all, you can export all frames as single frames and use a shell > script to drop half of them. I admit I am not fully getting your idea then. I want the output as same video file. If I export as images then it is just a folder with images. Yes they will be not changed, but if I want them back in a DNxHD video file, how can I guarantee that the information will be not changed due to compression? Do you mean this is possible somehow to put the images back in video file without touching the image information? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Selecting/dropping frames without re-encoding
On 5 October 2016 at 19:55, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > 2016-10-05 15:45 GMT+02:00 Mikhail V <mikhail...@gmail.com>: > >> Is it possible that ffmpeg cannot do this without re-encoding? > > You can export single frames and delete half of them using a > shell script. > > Carl Eugen Sure I can :) Also I can just directly recode it in 25 fps in any codec. So I suppose the answer is - I can't do it without re-encode. I was just wondering why there is no such function for intraframe codecs, would be very handy in my opinion. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Selecting/dropping frames without re-encoding
On 5 October 2016 at 18:06, Erik Dobberkauwrote: >> Hello, >> >> I have a camera recording which is an MXF file and the codec is DNxHD >> I suppose it is a single-frame codec so literally it is a container of >> images which are independently stored in the file. >> Recordings are taken at 50 fps progressive. > > > Hi Michail, > > this is a TV standard, 720p50. Nothing exotic. > > >> Now what I want is to extract only half of the frames, so that it becomes >> 25 fps > > > Why would you want to do that? > You're getting standard-incompliant video. In other words: This is wrong. You are right, but what is standard depend on situation, currently the only working mode for me is 25 progressive. I know 50 fps would be better of course, but it does not depend on me but the prescriptions from the broadcaster. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Selecting/dropping frames without re-encoding
Hello, I have a camera recording which is an MXF file and the codec is DNxHD I suppose it is a single-frame codec so literally it is a container of images which are independently stored in the file. Recordings are taken at 50 fps progressive. Now what I want is to extract only half of the frames, so that it becomes 25 fps Note that I need to do it _without re-encoding_ for two reasons: 1. Conversion must be as fast as possible, files can be really huge 2. No changes to original information should occur Theoretically this is an elementary operation, it should just take every second frame from source and write to output leaving everything else as is. I have tried several options whith "-r ..." and added "-c:v copy" These commands I have tried: ffmpeg -i Capture0006V_720p.mxf -r 25 -c:v copy out1.mxf ffmpeg -r 50 -i Capture0006V_720p.mxf -r 25 -c:v copy out1.mxf ffmpeg -r 2 -i Capture0006V_720p.mxf -r 1 -c:v copy out1.mxf But they all produce again 50 fps video, so I suppose stream copy just ignores all "-r" options so I don't know what can I do to achieve what I want. I have searched a lot, so I've registered here hoping for solution. Is it possible that ffmpeg cannot do this without re-encoding? If no, how can one do this? Thanks in advance. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".