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

Flac not copying #1259

Closed AverageUnknown closed 4 years ago

AverageUnknown commented 4 years ago

Flac is not being copied over even when defined in the Autoprocess.ini:

[Audio]
max-channels = 0
codec = flac,pcm_s24le,dts,truehd,eac3,ac3,aac
languages = eng,jpn
default-language = eng
channel-bitrate = 256
filter = 
copy-original = False
aac-adtstoasc = False
first-stream-of-language = False
allow-language-relax = True
prefer-more-channels = True
ignore-truehd = 
sample-rates = 44100, 48000
default-more-channels = True

Mediainfo:

General
Unique ID                                : 168014501500912117587527661049198835418 (0x7E666A7BE88412B649BF784B38BA76DA)
Complete name                            : test.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 95.5 MiB
Duration                                 : 1 min 31 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 8 788 kb/s
Writing application                      : Lavf58.29.100
Writing library                          : Lavf58.29.100
ErrorDetectionType                       : Per level 1

Video
ID                                       : 1
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=15
Format settings, picture structure       : Frame
Codec ID                                 : V_MPEG2
Codec ID/Info                            : MPEG 1 or 2 Video
Duration                                 : 1 min 31 s
Bit rate mode                            : Variable
Maximum bit rate                         : 8 264 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields (2 fields per block)
Scan order                               : Top Field First
Compression mode                         : Lossy
Time code of first frame                 : 01:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Default                                  : Yes
Forced                                   : No
Color range                              : Limited

Audio
ID                                       : 2
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Codec ID                                 : A_FLAC
Duration                                 : 1 min 31 s
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Compression mode                         : Lossless
Writing library                          : Lavc58.54.100 flac
Language                                 : Japanese
Default                                  : Yes
Forced                                   : No

6Lcnqa4F72

mdhiggins commented 4 years ago

Very strange because if flac is your first codec it also should not be converting to pcm_s24le. You don't have multiple config files or something do you? It should always choose the first codec so even if it wouldn't copy for some reason it should convert flac to flac.

Can you post the output of manual.py instead of that gif so I can look closer. And if you have that test file and can share it that would be helpful too.

AverageUnknown commented 4 years ago

output:

C:\Users\Jacob\Desktop\sickbeard_mp4_automator-master>python manual.py
Manual processor started.
Python 64-bit 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)].
Guessit version: 3.1.1.
C:\Users\Jacob\AppData\Local\Programs\Python\Python38\python.exe
Loading config file C:\Users\Jacob\Desktop\sickbeard_mp4_automator-master\config\autoProcess.ini.
Force-convert is true, so convert-mp4 is being overridden to true as well
Enter path to file:
#: C:\Users\Jacob\Desktop\tes3t.mkv
Processing file C:\Users\Jacob\Desktop\tes3t.mkv
Input Data
{
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "mpeg2video",
        "pix_fmt": "yuv420p",
        "profile": "main",
        "fps": 29.97002997002997,
        "level": 0.8,
        "field_order": "tt"
    },
    "audio": [
        {
            "index": 1,
            "codec": "flac",
            "channels": 2,
            "samplerate": 48000,
            "language": "jpn",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [],
    "attachment": []
}
Reading video stream.
Video codec detected: mpeg2video.
Pix Fmt: yuv420p.
Profile: main.
Reading audio streams.
Audio detected for stream 1 - flac jpn 2 channel.
Creating pcm_s24le audio stream from source stream 1.
Default audio stream set to jpn pcm_s24le 2 channel stream [default-more-channels: True].
Reading subtitle streams.
Scanned for external subtitles and found 0 results in your approved languages.
Output Data
{
    "source": [
        "C:\\Users\\Jacob\\Desktop\\tes3t.mkv"
    ],
    "format": "mkv",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 8788.331,
        "crf": 15,
        "maxrate": null,
        "bufsize": null,
        "level": 5.1,
        "profile": null,
        "pix_fmt": null,
        "field_order": "tt",
        "width": null,
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "pcm_s24le",
            "channels": 2,
            "bitrate": 512,
            "filter": null,
            "samplerate": null,
            "language": "jpn",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "title": "Stereo",
            "debug": "audio"
        }
    ],
    "subtitle": [],
    "attachment": []
}
Preopts
[]
Postopts
[
    "-threads",
    "16",
    "-metadata:g",
    "encoding_tool=SMA",
    "-tune",
    "film",
    "-preset",
    "slow"
]
Starting conversion.
[####################] 100%
C:\Users\Jacob\Desktop\tes3t.mkv created.

Only 1 autoProcessing.ini file:

image

autoprocess.ini: https://pastebin.com/ArhwpiQ5

Sample file: https://www.mediafire.com/file/2jqx840fi9qdjbi/tes3t.mkv/file

mdhiggins commented 4 years ago

Sample file works fine for me and copies appropriately

I'm noticing 2 problems with your setup that suggest you do in fact have 2 config files

First is that the autoProcess.ini you linked in your screenshot is in the setup folder and the one that's being read is in your config folder Loading config file C:\Users\Jacob\Desktop\sickbeard_mp4_automator-master\config\autoProcess.ini

Additionally the audio codecs you have listed in the pastebin show: codec = pcm_s24le,flac,dts,truehd,eac3,ac3,aac

And the codecs from your original post are codec = flac,pcm_s24le,dts,truehd,eac3,ac3,aac

These don't match. That at least explains why it opted to encode with pcm_s24le but I would sort out your config file structure and I suspect this will resolve

AverageUnknown commented 4 years ago

Ah that makes a bit more sense, Its working now after fixing that.

I havent been here in a while and am used to the config being in the main dir.

Thanks for the help.