[FFmpeg-user] FFprobe sometimes freezing instead of exiting?
Stuart Bruce
stuartrbruce at gmail.com
Sat Apr 21 15:25:14 EEST 2018
Hello
I've got a Windows Visual Studio .NET application which, amongst other
things, uses FFprobe to get some basic information about the stream content
of movie files. My application starts FFprobe as a thread with arguments,
reads the StandardOutput until FFprobe exists, then works with the data
that FFprobe has provided.
Sometimes, FFprobe will complete finish the requested task of showing all
the stream info, but then it will 'freeze' instead of exiting immediately-
it can sit there for a variable amount of time, sometimes a few seconds,
sometimes several minutes, neither busy nor exiting, just sort of stuck.
Since my application is waiting for FFprobe to exit, users are left waiting
(sometimes impatiently...)
So my question/problem is this: is there a way I can stop FFprobe from
sometimes 'sticking' like this, and ensuring that once the analysis is
done, it closes nice and promptly?
More details:
The arguments being called to FFprobe are simply this:
-show_streams "E:\Tests\2018-04-21\Timecode.mov"
I have pasted FFprobe's console output below. Because it's the last line,
I'm guessing that it's something to do with "Unsupported codec with id 0
for input stream 2". In the case of the media I'm testing with, stream 2 is
a timecode stream (sample stream output is also pasted below).
I've also pasted below what is (I think) the relevant bit of my VB.NET code
in case it's pertinent at all.
If it helps, you can download the basic MOV that I created in Avid Media
Composer for testing purposes from here:
http://www.twentypenguins.co.uk/misc/ffpmeg_tests/Timecode.mov
and you can see a screengrab of the 'stuck' FFprobe console window here:
http://www.twentypenguins.co.uk/misc/ffpmeg_tests/F
Fprobe-freeze-issue_21Apr18.JPG
Any comments or suggestions about what I should do to get ffprobe.exe to
always exit promptly would be much appreciated.
Thanks
Stuart
Console output:
ffprobe version N-90796-ge5ba5fab49 Copyright (c) 2007-2018 the FFmpeg
developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv
--enable-libass --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
libavutil 56. 15.100 / 56. 15.100
libavcodec 58. 19.100 / 58. 19.100
libavformat 58. 13.100 / 58. 13.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 18.100 / 7. 18.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Aardman EditReader
tests\2018-04-21\Timecode.mov':
Metadata:
creation_time : 2018-04-21T12:23:13.000000Z
timecode : 01:00:00:00
Duration: 00:30:00.00, start: 0.000000, bitrate: 875 kb/s
Stream #0:0(eng): Audio: pcm_s16be (twos / 0x736F7774), 44100 Hz, mono,
s16, 705 kb/s (default)
Metadata:
creation_time : 2018-04-21T12:23:13.000000Z
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
smpte170m/smpte170m/bt709), 640x360, 160 kb/s, 25 fps, 25 tbr, 25k tbn, 50k
tbc (default)
Metadata:
creation_time : 2018-04-21T12:23:14.000000Z
handler_name : Apple Alias Data Handler
encoder : H.264
Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2018-04-21T12:47:58.000000Z
handler_name : Apple Alias Data Handler
timecode : 01:00:00:00
Unsupported codec with id 0 for input stream 2
.NET code that calls FFprobe and gets the results, (where probeProcess is
a System.Diagnostics.Process that has already been pointed to ffprobe.exe):
probeProcess.StartInfo.Arguments = "-show_streams -select_streams v " +
Chr(34) + filePath + Chr(34)
probeProcess.StartInfo.UseShellExecute = False
probeProcess.StartInfo.RedirectStandardOutput = True
probeProcess.StartInfo.RedirectStandardError = True
probeProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
probeProcess.StartInfo.CreateNoWindow = True
probeProcess.Start()
Dim probeStreamReader As StreamReader = probeProcess.StandardOutput
streamData = probeStreamReader.ReadToEnd
myStreamReader.Close()
Stream data that is logged before FFprobe 'freezes':
[STREAM]
index=0
codec_name=pcm_s16be
codec_long_name=PCM signed 16-bit big-endian
profile=unknown
codec_type=audio
codec_time_base=1/44100
codec_tag_string=twos
codec_tag=0x736f7774
sample_fmt=s16
sample_rate=44100
channels=1
channel_layout=mono
bits_per_sample=16
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=79380000
duration=1800.000000
bit_rate=705600
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=79380000
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2018-04-21T12:23:13.000000Z
TAG:language=eng
TAG:handler_name=Apple Alias Data Handler
[/STREAM]
[STREAM]
index=1
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_time_base=1/50
codec_tag_string=avc1
codec_tag=0x31637661
width=640
height=360
coded_width=640
coded_height=368
has_b_frames=1
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=31
color_range=tv
color_space=smpte170m
color_transfer=bt709
color_primaries=smpte170m
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/25000
start_pts=0
start_time=0.000000
duration_ts=45000000
duration=1800.000000
bit_rate=160529
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=45000
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2018-04-21T12:23:14.000000Z
TAG:language=eng
TAG:handler_name=Apple Alias Data Handler
TAG:encoder=H.264
[/STREAM]
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_tag_string=tmcd
codec_tag=0x64636d74
id=N/A
r_frame_rate=0/0
avg_frame_rate=25/1
time_base=1/600
start_pts=0
start_time=0.000000
duration_ts=1080000
duration=1800.000000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2018-04-21T12:47:58.000000Z
TAG:language=eng
TAG:handler_name=Apple Alias Data Handler
TAG:timecode=01:00:00:00
[/STREAM]
--
Stuart Bruce - stuart at stuartbruce.co.uk - www.stuartbruce.co.uk
More information about the ffmpeg-user
mailing list