Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when subtitle language is not detected #12

Closed
mstrelan opened this issue Feb 27, 2013 · 4 comments
Closed

Error when subtitle language is not detected #12

mstrelan opened this issue Feb 27, 2013 · 4 comments

Comments

@mstrelan
Copy link
Contributor

In some scenario (not sure what) s.language is not a string, but a "NoneType". This causes the script to fail. See traceback below.

Traceback (most recent call last):

File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\postConversion.py", line 18, in

convert = MkvtoMp4(path, settings.ffmpeg, settings.ffprobe, settings.delete, settings.output_extension, settings.relocate_moov)

File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\mkvtomp4.py", line 44, in init

print "Subtitle stream detected: " + s.language

TypeError: cannot concatenate 'str' and 'NoneType' objects

@mdhiggins
Copy link
Owner

Could you do an

ffprobe.exe -show_streams <video_file>

for the video in question and show me the output?

@mstrelan
Copy link
Contributor Author

C:\Users\Michael>ffprobe -show_streams D:\input.mkv
ffprobe version N-49972-g4a6fa79 Copyright (c) 2007-2013 the FFmpeg
developers
built on Feb 15 2013 00:27:28 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libg
sm --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --e
nable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --e
nable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
--enable-
libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable
-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 17.101 / 52. 17.101
libavcodec 54. 91.103 / 54. 91.103
libavformat 54. 63.100 / 54. 63.100
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 37.101 / 3. 37.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, matroska,webm, from 'D:\input.mkv':
Metadata:
creation_time : 2013-02-19 08:48:34
Duration: 00:40:58.88, start: 0.000000, bitrate: 4428 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR
16:9],
23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
(default)
Stream #0:2: Subtitle: subrip (default)
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/2000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1280
height=720
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=31
timecode=N/A
is_avc=1
nal_length_size=4
id=N/A
r_frame_rate=2997/125
avg_frame_rate=2997/125
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
nb_frames=N/A
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
TAG:language=eng
[/STREAM]
[STREAM]
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
sample_rate=48000
channels=6
bits_per_sample=0
dmix_mode=-1
ltrt_cmixlev=-1.000000
ltrt_surmixlev=-1.000000
loro_cmixlev=-1.000000
loro_surmixlev=-1.000000
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=384000
nb_frames=N/A
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
TAG:language=eng
[/STREAM]
[STREAM]
index=2
codec_name=subrip
codec_long_name=SubRip subtitle
profile=unknown
codec_type=subtitle
codec_time_base=1/1000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
nb_frames=N/A
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
[/STREAM]

On 27 February 2013 23:34, Michael Higgins notifications@github.com wrote:

Could you do an

ffprobe.exe -show_streams

and show me the output?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-14173691
.

@mdhiggins
Copy link
Owner

I think I have a fix worked out for this but if you could post the info above it would help me make sure I've fully addressed the issue before it goes live.

@mstrelan
Copy link
Contributor Author

mstrelan commented Mar 3, 2013

Sorry, not sure what you're after. Did you get the ffprobe output?

@mdhiggins
Copy link
Owner

I pushed the new release that should fix this, let me know if its working so I can close the issue

@mstrelan
Copy link
Contributor Author

mstrelan commented Mar 4, 2013

Nope, doesn't work. It will never enter the condition elif key.lower() == 'tag:language': if tag:language doesn't exist for a stream. Would it be better to initialise self.language = 'und' before looking for the tag:language key, and then if the key does exist it can overwrite it to eng (or whatever the val is)?

@mdhiggins
Copy link
Owner

Found a file with the same problem, it is now resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants