mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.53k stars 201 forks source link

Conversion problem every time with 720p Disney shows #1287

Closed morpheus2n2 closed 4 years ago

morpheus2n2 commented 4 years ago

NO matter what every time there's a Disney show that needs converting if its in 720p it will always fail 100% of the time. When it comes to the 1080p versions this is more 40% of the time.

Here is the log from the most recent failing.

> 2020-07-26 05:47:15 - SABPostProcess - INFO - SAB post processing started.
> 2020-07-26 05:47:15 - resources.readsettings - INFO - C:\Users\morph\AppData\Local\Programs\Python\Python38-32\python.exe
> 2020-07-26 05:47:15 - resources.readsettings - INFO - Loading config file C:\Converter\config\autoProcess.ini.
> 2020-07-26 05:47:15 - resources.readsettings - WARNING - Force-convert is true, so convert-mp4 is being overridden to true as well
> 2020-07-26 05:47:15 - SABPostProcess - INFO - Performing conversion
> 2020-07-26 05:47:15 - SABPostProcess - INFO - Processing file D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mkv.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Input Data
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - {
> "format": "matroska,webm",
> "format-fullname": "Matroska / WebM",
> "video": {
> "index": 0,
> "codec": "h264",
> "pix_fmt": "yuv420p",
> "profile": "high",
> "fps": 23.976023976023978,
> "level": 3.1,
> "field_order": "progressive"
> },
> "audio": [
> {
> "index": 1,
> "codec": "aac",
> "channels": 2,
> "samplerate": 48000,
> "language": "eng",
> "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
> }
> ],
> "subtitle": [
> {
> "index": 2,
> "codec": "subrip",
> "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
> "language": "eng"
> }
> ],
> "attachment": []
> }
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Reading video stream.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Video codec detected: h264.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Profile: high.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Reading audio streams.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Audio detected for stream 1 - aac eng 2 channel.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Creating copy audio stream from source stream 1.
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Default audio stream set to eng copy 2 channel stream [default-more-channels: True].
> 2020-07-26 05:47:15 - resources.mediaprocessor - INFO - Reading subtitle streams.
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 2 - subrip eng.
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 2.
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - dxva2 hwaccel is supported by this ffmpeg build and will be used [hwaccels].
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Output Data
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - {
> "source": [
> "D:\\Downloads\\Completed\\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\\566523a821e44e638a2a9fc75e41fce5.mkv"
> ],
> "format": "mp4",
> "video": {
> "codec": "h264",
> "map": 0,
> "bitrate": 2500,
> "crf": -1,
> "maxrate": null,
> "bufsize": null,
> "level": 5.1,
> "profile": null,
> "pix_fmt": null,
> "field_order": "progressive",
> "width": null,
> "filter": null,
> "debug": "video.max-bitrate"
> },
> "audio": [
> {
> "map": 1,
> "codec": "copy",
> "channels": 2,
> "bitrate": 256,
> "filter": null,
> "samplerate": null,
> "language": "eng",
> "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
> "bsf": null,
> "title": "Stereo",
> "debug": "universal-audio"
> }
> ],
> "subtitle": [
> {
> "map": 2,
> "codec": "mov_text",
> "language": "eng",
> "encoding": "",
> "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
> "title": "",
> "debug": "subtitle.embed-subs"
> }
> ],
> "attachment": []
> }
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Preopts
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - [
> "-fix_sub_duration",
> "-hwaccel",
> "dxva2"
> ]
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Postopts
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - [
> "-threads",
> "0",
> "-metadata:g",
> "encoding_tool=SMA"
> ]
> 2020-07-26 05:47:16 - resources.mediaprocessor - INFO - Starting conversion.
> 2020-07-26 05:47:22 - resources.mediaprocessor - ERROR - Error converting file, FFMPEG error.
> Traceback (most recent call last):
> File "C:\Converter\resources\mediaprocessor.py", line 1312, in convert
> for timecode in conv:
> File "C:\Converter\converter\__init__.py", line 273, in convert
> for timecode in self.ffmpeg.convert(outfile, optlist,
> File "C:\Converter\converter\ffmpeg.py", line 690, in convert
> raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
> converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
> 2020-07-26 05:47:23 - resources.mediaprocessor - ERROR - C:\ffmpeg\bin\ffmpeg.exe -fix_sub_duration -hwaccel dxva2 -i D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mkv -vcodec libx264 -map 0:0 -field_order progressive -vb 2500k -metadata:s:v BPS=2500000 -metadata:s:v BPS-eng=2500000 -c:a:0 copy -map 0:1 -metadata:s:a:0 title=Stereo -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 language=eng -disposition:s:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mp4
> 2020-07-26 05:47:23 - resources.mediaprocessor - ERROR - ffmpeg version git-2020-06-26-7447045 Copyright (c) 2000-2020 the FFmpeg developers
> built with gcc 9.3.1 (GCC) 20200621
> 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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
> libavutil      56. 55.100 / 56. 55.100
> libavcodec     58. 93.100 / 58. 93.100
> libavformat    58. 47.100 / 58. 47.100
> libavdevice    58. 11.100 / 58. 11.100
> libavfilter     7. 86.100 /  7. 86.100
> libswscale      5.  8.100 /  5.  8.100
> libswresample   3.  8.100 /  3.  8.100
> libpostproc    55.  8.100 / 55.  8.100
> Input #0, matroska,webm, from 'D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mkv':
> Metadata:
> encoder         : libebml v1.4.0 + libmatroska v1.6.0
> creation_time   : 2020-07-25T20:40:53.000000Z
> Duration: 00:48:16.00, start: 0.000000, bitrate: 3459 kb/s
> Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 96k tbc (default)
> Metadata:
> BPS-eng         : 3330731
> DURATION-eng    : 00:48:15.977000000
> NUMBER_OF_FRAMES-eng: 69434
> NUMBER_OF_BYTES-eng: 1205715394
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
> Metadata:
> BPS-eng         : 126770
> DURATION-eng    : 00:48:16.003000000
> NUMBER_OF_FRAMES-eng: 67874
> NUMBER_OF_BYTES-eng: 45890844
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:2(eng): Subtitle: subrip
> Metadata:
> BPS-eng         : 99
> DURATION-eng    : 00:48:03.330000000
> NUMBER_OF_FRAMES-eng: 1024
> NUMBER_OF_BYTES-eng: 35760
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream mapping:
> Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
> Stream #0:1 -> #0:1 (copy)
> Stream #0:2 -> #0:2 (subrip (srt) -> mov_text (native))
> Press [q] to stop, [?] for help
> [libx264 @ 0000021f5ec809c0] using SAR=1/1
> [libx264 @ 0000021f5ec809c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
> [libx264 @ 0000021f5ec809c0] profile High, level 3.1, 4:2:0, 8-bit
> [libx264 @ 0000021f5ec809c0] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 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=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, mp4, to 'D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mp4':
> Metadata:
> encoding_tool   : SMA
> encoder         : Lavf58.47.100
> Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), nv12(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 2500 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)
> Metadata:
> BPS             : 2500000
> DURATION-eng    : 00:48:15.977000000
> NUMBER_OF_FRAMES-eng: 69434
> NUMBER_OF_BYTES-eng: 1205715394
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> BPS-eng         : 2500000
> encoder         : Lavc58.93.100 libx264
> Side data:
> cpb: bitrate max/min/avg: 0/0/2500000 buffer size: 0 vbv_delay: N/A
> Stream #0:1(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (default)
> Metadata:
> title           : Stereo
> BPS-eng         : 126770
> DURATION-eng    : 00:48:16.003000000
> NUMBER_OF_FRAMES-eng: 67874
> NUMBER_OF_BYTES-eng: 45890844
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874) (default)
> Metadata:
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> BPS-eng         : 99
> DURATION-eng    : 00:48:03.330000000
> NUMBER_OF_FRAMES-eng: 1024
> NUMBER_OF_BYTES-eng: 35760
> _STATISTICS_WRITING_APP-eng: mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
> _STATISTICS_WRITING_DATE_UTC-eng: 2020-07-25 20:40:53
> encoder         : Lavc58.93.100 mov_text
> frame=   67 fps=0.0 q=25.0 size=       0kB time=00:00:03.32 bitrate=   0.1kbits/s speed=5.23x    
> frame=  108 fps= 92 q=24.0 size=       0kB time=00:00:05.11 bitrate=   0.1kbits/s speed=4.36x    
> frame=  147 fps= 88 q=22.0 size=       0kB time=00:00:06.82 bitrate=   0.1kbits/s speed=4.08x
> 2020-07-26 05:47:23 - resources.mediaprocessor - ERROR - D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mp4 deleted.
> 2020-07-26 05:47:23 - SABPostProcess - ERROR - Converting file failed D:\Downloads\Completed\Ravens.Home.S04E01.Raven.About.Bunkd.720p.DSNY.WEB-DL.AAC2.0.x264-LAZY\566523a821e44e638a2a9fc75e41fce5.mkv.
> 2020-07-26 05:47:23 - SABPostProcess - ERROR - No valid files found for conversion in download, aborting.
> 2020-07-26 05:47:23 - SABPostProcess - ERROR - Unexpected exception.
> Traceback (most recent call last):
> File "C:\Converter\SABPostProcess.py", line 75, in <module>
> sys.exit(1)
> SystemExit: 1
mdhiggins commented 4 years ago

Had to find that file causing the crash to reproduce

The subtitle track in that file is causing a crash. I ripped the subtitle file out and noticed they're using some HTML tags in the subtitle file which FFMPEG doesn't like and is causing the crash

I stripped the HTML out and the conversion is successful

No good fixes for this as its an FFMPEG/source file problem but that's your diagnosis

I would either not download from that source, turn off subtitles (at least turn of embedded subtitles as its the crash when converting from subrip to mov_text) or just not use that release group

could also open a ticket with FFMPEG and post this as an example of a crash

morpheus2n2 commented 4 years ago

That's interesting lol Thanks for looking at it, will just add that group to the block list 👍