Michael Rampe
Forum Replies Created
-
1. Looks like it is one or the other according to the docs.
2. Scene detection can be a bit tricky but I did get a method working a while ago after some searching….
ffprobe -show_frames -f lavfi "movie=Input.mp4,select=gt(scene\,.1)" | grep "pkt_pts_time="
| sed 's/.*pkt_pts_time=([0-9.]{8,})\|.*/\1/'This gives me a list of times, like this:
214.347467
649.982667
657.289967
664.897567
664.964300
694.960933
722.088033
732.598533
733.432700
733.933200
739.472067
740.339600
754.954200
769.935833
799.899100
829.962467
1192.191000
1193.358833Basically using the “select” filter with the FFprobe app: https://www.ffmpeg.org/ffmpeg-filters.html#select_002c-aselect
…with some unix fanciness to get a clean text output. The grep/sed pipes wont work under windows…FFprobe is a separate binary to FFmpeg but you should be able to get a static build from the same place you got the other one.
Michael
-
Nice.
I don’t think blackdetect does frames although there is a similar filter called blackframe which does according to the docs.
https://www.ffmpeg.org/ffmpeg-filters.html#blackframe
Just replace -vf blackdetect…. With -vf blackframe
Keep in mind that frame numbers in ffmpeg start at 0 not 1 so you might need to offset the result by 1 if you are using it in some editing packages.
Michael
-
Download a static build for windows from https://www.ffmpeg.org (hit the downloads tab)
There are heaps of “getting started with ffmpeg on windows” guides on the web. Do some googling as I am not a big windows user…. I mostly work on unix systems (osx or Linux flavors).
One thing I do know, you will want to replace the /dev/null in my example with NUL in windows Cmd. (That bit of the command just pipes the output to nowhere so you don’t have to deal with temp files) Apart from that, the previously posted command should work just fine and give you a list of black frames detected.
Good luck,
Michael
-
The filters are all installed by default… no need to download them.
basic syntax (on a unix like system) is:
ffmpeg -i inputfile.mp4 -vf blackdetect=d=0.1:pix_th=.1 -f rawvideo -y /dev/nulld=0.1 expresses the minimum length of black to detect in seconds. Lower this if you want single frames.
pix_th=.1 is the level of black to detect between 0 and 1. a setting of one will flag all frames, a setting of .01 should only grab black. tweak as needed.What system are you working on? (Mac, Windows or Linux?)
Do you have a recent FFmpeg installed already?Michael
-
-
wow. I have not looked at my code on this in a long time….
I am using a very recent compile (V2.x) and I am not getting size anymore either.
I am, however getting pkt_size for H.264 streams. It looks like it is in Bytes to me… maybe try to upgrade?
[FRAME]
media_type=video
key_frame=1
pkt_pts=1539
pkt_pts_time=61.560000
pkt_dts=1539
pkt_dts_time=61.560000
pkt_duration=1
pkt_duration_time=0.040000
pkt_pos=10862541
pkt_size=56311
width=854
height=480
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=1539
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]FYI, my line was: ffprobe -show_frames -i tests_cut1_x264.mov
and my version is:
ffprobe version N-54992-g63c0113 Copyright (c) 2007-2013 the FFmpeg developers
built on Jul 28 2013 19:42:17 with Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
configuration: –enable-gpl –enable-postproc –enable-swscale –enable-libmp3lame –enable-libfaac –enable-libx264 –enable-nonfree –enable-shared –arch=x86_64 –extra-cflags=/usr/local/lib –enable-avfilter –enable-libfreetype –enable-frei0r –cc=clang
libavutil 52. 40.100 / 52. 40.100
libavcodec 55. 19.100 / 55. 19.100
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 81.103 / 3. 81.103
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100Michael
p.s. Glad this is still useful after all this time. I was very much a newbie when I did this;-) If you get a new version of this graphing stuff going, please post!
-
[Peter Robertson] “i’m using max osx. And i remember i could not enable some of the options like libfaac, libfaad and nonfree. “
No. You have to install these libraries separately first. libfaad is now redundant. libx264, libfaac and libmp3lame are a must for a very basic set.
Michael
-
[Peter Robertson] “How do I find my configuration options to see if I have AAC codec installed.”
Just type $ ffmpeg
… and look for –enable-libfaac
here is mine on the box I am on today:$ ffmpeg
ffmpeg version N-48401-gfc86f86 Copyright (c) 2000-2013 the FFmpeg developers
built on Jan 11 2013 14:13:05 with gcc 4.2.1 (GCC) (Apple Inc. build 5664)
configuration: –enable-gpl –enable-postproc –enable-swscale –enable-avfilter –enable-libmp3lame –enable-libx264 –enable-libfaac –enable-libfreetype –disable-shared –enable-static –enable-pthreads –arch=x86_64 –enable-nonfree –enable-frei0r –extra-cflags=-I/usr/local/include –extra-ldflags=-L/usr/local/lib
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 85.100 / 54. 85.100
libavformat 54. 59.100 / 54. 59.100
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 30.102 / 3. 30.102
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100 -
[Peter Robertson] “add ‘-strict -2’ if you want to use it.”
This is how you fix it. Just add this to your encode options.
Basically, this is the built-in AAC encoder that is still in development. I have found it to work very well. The other option if you want to encode AAC audio is to compile and link libfaac which is an external library.
Post your configure options for more help, you may have libfaac already.
Michael
-
Hi Dave,
OK. I have created a replica of your file – 1 prores video track (stream 0:0) and 14 mono audio streams (streams 0:1 though 0:14) and one timecode track (stream 0:15). (NOTE: my audio was 16 bit, not sure if 6 bit was a typo in your post but it will not matter anyway)
You can achieve what you are after with simple mapping.
$ ffmpeg -i 14ch.mov -map 0:1 1.wav -map 0:2 2.wav -map 0:3 3.wav -map 0:4 4.wav -map 0:5 5.wav -map 0:6 6.wav -map 0:7 7.wav -map 0:8 8.wav -map 0:9 9.wav -map 0:10 10.wav -map 0:11 11.wav -map 0:12 12.wav -map 0:13 13.wav -map 0:14 14.wav
This split all 14 discrete streams to 14 individual wav files.
Stream mapping:
Stream #0:1 -> #0:0 (pcm_s16le -> pcm_s16le)
Stream #0:2 -> #1:0 (pcm_s16le -> pcm_s16le)
Stream #0:3 -> #2:0 (pcm_s16le -> pcm_s16le)
Stream #0:4 -> #3:0 (pcm_s16le -> pcm_s16le)
Stream #0:5 -> #4:0 (pcm_s16le -> pcm_s16le)
Stream #0:6 -> #5:0 (pcm_s16le -> pcm_s16le)
Stream #0:7 -> #6:0 (pcm_s16le -> pcm_s16le)
Stream #0:8 -> #7:0 (pcm_s16le -> pcm_s16le)
Stream #0:9 -> #8:0 (pcm_s16le -> pcm_s16le)
Stream #0:10 -> #9:0 (pcm_s16le -> pcm_s16le)
Stream #0:11 -> #10:0 (pcm_s16le -> pcm_s16le)
Stream #0:12 -> #11:0 (pcm_s16le -> pcm_s16le)
Stream #0:13 -> #12:0 (pcm_s16le -> pcm_s16le)
Stream #0:14 -> #13:0 (pcm_s16le -> pcm_s16le)Let me know if this solves it….
Michael