[SUPPORT] - Compressarr


Recommended Posts

Compressarr Support

 

Links:

 

Compressarr is an application to take a filtered set of media from Radarr, Sonarr or a folder and process it with customisable FFmpeg presets. It will even attempt to find the best settings for each video. Then you can import the result back into Radarr/Sonarr.

 

Please use GitHub to report any bugs & read the wiki/readme. 

Please ask any questions here.

 

If someone wants to design a better logo, please, PLEASE, go for it. 

Edited by OFark
Shameless begging for a decent logo. Addition of Sonarr support.
  • Like 1
Link to comment

Keep getting "Initializing Presets" at the top and can't save a job to start. (see screenshot)

 

Also getting a debug error when trying to save even a basic ffmpeg profile for testing. For reference, I have an intel setup, not nvdia, which is why i'm choosing to use vaapi.

 

 

image.thumb.png.62fd1fdb2af33b300223beae1f3b758c.png

 

 

2021-05-29T01:14:09.4573812-05:00 0HM92D2TDTQSF:00000002 [ERR] {SourceContext: "Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost", TransportConnectionId: "cVEIOsITmh9f-_HHvm0VWg", RequestPath: "/_blazor", ConnectionId: "0HM92D2TDTQSF"} Unhandled exception in circuit '"9zBxGwnM4yDP_f5erFPpb29zF55XM0AxZbF9Gdr8CDQ"'. (47be2d5d)
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
   at Compressarr.Settings.FFmpegFactory.FFmpegPresetBase..ctor(FFmpegPreset preset) in /src/Compressarr/Settings/FFmpegFactory/FFmpegPresetBase.cs:line 22
   at Compressarr.Application.ApplicationService.<>c.<SaveAppSetting>b__94_0(FFmpegPreset x) in /src/Compressarr/Application/ApplicationService.cs:line 99
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)
   at Newtonsoft.Json.Linq.JToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.FromObject(Object o)
   at Compressarr.Application.ApplicationService.SaveAppSetting() in /src/Compressarr/Application/ApplicationService.cs:line 99
   at Compressarr.Presets.PresetManager.AddPresetAsync(FFmpegPreset newPreset) in /src/Compressarr/Presets/PresetManager.cs:line 630
   at Compressarr.Shared.PresetView.savePreset() in /src/Compressarr/Shared/PresetView.razor:line 217
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

 

 

 

 

  • Like 1
Link to comment

This tool looks awesome.  I'm trying to test conversion settings and functionality.  I've created a filter for one movie.  I set libx265 as the encoder.  When I try to run the job, I get a File Length Mismatch error.  Any ideas?

 

Quote

16:26:52 - Begin Initialisation

16:26:53 - Begin Testing

16:26:53 - Job is for Movies, Connecting to Radarr

16:26:53 - Connected to Radarr

16:26:53 - Fetching List of files from Radarr

16:26:56 - Files Returned

16:26:56 - Building Workload

16:26:56 - Workload compiled

16:26:56 - Checking Destination Folder

16:26:56 - Writing Test.txt file

16:26:56 - Test succeeded

16:26:56 - Initialisation succeeded

16:27:07 - Started Job at: 06/03/2021 16:27:07

16:27:07 - Now Processing: A Random Movie (2018).mkv

16:27:08 - Xabe.FFmpeg.Exceptions.ConversionException: ffmpeg version 4.2.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, matroska,webm, from '/movies/movies/A Random Movie (2018)/A Random Movie (2018).mkv': Metadata: title : A.Random.Movie.2018.1080p.BluRay.x264 CREATION_TIME : 2019-08-22T05:11:01Z ENCODER : Lavf57.7.2 Duration: 01:54:00.96, start: 0.000000, bitrate: 6204 kb/s at Xabe.FFmpeg.FFmpegWrapper.<>c__DisplayClass11_0.<RunProcess>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Xabe.FFmpeg.Conversion.Start(String parameters, CancellationToken cancellationToken) at Compressarr.JobProcessing.ProcessManager.EncodeAVideo(DataReceivedEventHandler dataRecieved, ConversionProgressEventHandler dataProgress, String arguments, CancellationToken token) in /src/Compressarr/JobProcessing/ProcessManager.cs:line 95

16:27:08 - File length mismatch

 

Edited by jmmille
typo
Link to comment

The "File length mismatch" is due to the fact that FFmpeg threw an error and the output file length isn't the same as the input, a very basic check for "did this work", before we proceed.

 

I'm not particularly happy with Xabe's output from FFmpeg errors, there's always a lot of data to plough through to get to the reason. But I cannot see an error in there. It looks like FFmpeg just bailed with no error message. But there something we can do:

In the options page make sure the "Insert file names into FFmpeg previews" is on, then go to the Jobs page click the (i) button next to your movie and copy the argument that it creates. Go to the Compressarr Docker, in Unraid, and open it's console. (Click the Icon, select Console) FFmpeg is a global app in the console so just type "ffmpeg" a space and then paste in the arguments that we copied earlier. This should do exactly the same thing that Compressarr was trying to do, and you should get an error. FFmpeg usually prints it at the end in Red, but clues can appear through the output in yellow. If the error isn't obvious, let me know what it says and I'll see if I can help.

Edited by OFark
Typo
Link to comment
11 hours ago, OFark said:

The "File length mismatch" is due to the fact that FFmpeg threw an error and the output file length isn't the same as the input, a very basic check for "did this work", before we proceed.

 

I'm not particularly happy with Xabe's output from FFmpeg errors, there's always a lot of data to plough through to get to the reason. But I cannot see an error in there. It looks like FFmpeg just bailed with no error message. But there something we can do:

In the options page make sure the "Insert file names into FFmpeg previews" is on, then go to the Jobs page click the (i) button next to your movie and copy the argument that it creates. Go to the Compressarr Docker, in Unraid, and open it's console. (Click the Icon, select Console) FFmpeg is a global app in the console so just type "ffmpeg" a space and then paste in the arguments that we copied earlier. This should do exactly the same thing that Compressarr was trying to do, and you should get an error. FFmpeg usually prints it at the end in Red, but clues can appear through the output in yellow. If the error isn't obvious, let me know what it says and I'll see if I can help.

Thanks for the response.  I'm trying this and when I go to the console, and try to run ffmpeg, it says the command isn't found.  See the attached screenshot.  I tried it with the arguments originally, but once it told me ffmpeg wasn't found, I figured there must be a bigger issue.

ffmpeg.png

 

Edit:

I went into the console and CD'd into /config/FFmpeg and ran ./ffmpeg with the arguments given within compressarr.  The error made me realize I had chosen a hardware decoder (vaapi) when I didn't provide one to the docker.  I removed the hardware decoder and it seems to be running now.

 

Thanks!

Edited by jmmille
update
Link to comment

Ohh yeah, that's my fault. I'm currently working on the Nvidia support branch which has FFmpeg everywhere, the non-Nvidia doesn't. 

You do have VAAPI enabled and available if it's in the drop down options. Or at least FFmpeg is reporting it's available. Depending on your CPU you may need extra parameters. This, however, I haven't had time to learn just yet, so I can't help you with those right now. If you want to take a look at FFmpeg and Vaapi you maybe able to learn more.

Link to comment
  • 1 month later...

Hi I am trying to solve this error on the compressarr when encoding my library.

 

Error:

10:44:50 - System.IO.FileNotFoundException: Could not find file '/tmp/Compressarr/encFile.mp4'. File name: '/tmp/Compressarr/encFile.mp4' at System.IO.FileInfo.get_Length() at Compressarr.JobProcessing.ArgumentService.TestAutoPreset(AutoPresetResult test, List`1 sampleFiles, WorkItem wi, FFmpegPreset preset, CancellationToken token) in /src/Compressarr/JobProcessing/ArgumentService.cs:line 582 at Compressarr.JobProcessing.ArgumentService.CalculateBestOptions(WorkItem wi, CancellationToken token) in /src/Compressarr/JobProcessing/ArgumentService.cs:line 294 at Compressarr.JobProcessing.ArgumentService.SetArguments(FFmpegPreset preset, WorkItem wi, CancellationToken token, Boolean force) in /src/Compressarr/JobProcessing/ArgumentService.cs:line 97 at Compressarr.JobProcessing.JobManager.PrepareWorkItem(WorkItem wi, FFmpegPreset preset, CancellationToken token) in /src/Compressarr/JobProcessing/JobManager.cs:line 450 at Compressarr.JobProcessing.JobManager.RunJob(Job job) in /src/Compressarr/JobProcessing/JobManager.cs:line 584

 

From my investigation i found that the file created by compressarr in the tmp location is "sample1.mkv" and there wasn't any encFile.mp4 to be seen.

 

Hope that someone can enlighten me on how to solved this problem thank you.

My guess is that maybe some of my configuration is incorrect but i am not sure where.

Link to comment

Hi, Thanks for the feedback.

 

The encFile.mp4 is created when it encodes the sample. So the sample.mkv is a short sample of the original video and the encfile.mp4 is the result of, or is supposed to be the result of, a test encode with FFmpeg. I assume, as you didn't mention it, there are no FFmpeg errors mentioned in the log?

 

A week or so ago I released a version that should have stepped over any issues creating samples, but it looks like it's falling over in the right place, so to speak. So that error line matches current code base. Honestly I'm surprised it got that far if it didn't actually create any files. 

 

I'll add some error checking, and maybe a better error message, in the next version. Though that's probably not going to solve your issue. Have a look in the Logs folder at the log files, see if there's a message from FFmpeg about why it may have failed to encode. If you can't figure it out, send me the latest log file that contains the error and the appsettings.json file from the application root, a screenshot/copy&paste of the options page info at the bottom, and I'll take a look. 

Link to comment

Ok found it, probably too tired for this but I found it.

When using an encoder that doesn't have the pass number built into specific options it wasn't passing through the fact that the first pass was indeed the first pass and no log file was being generated. X265 doesn't have this issue, and I was mostly using that for testing. Ok I guess I must have only been using that for testing, I missed it.

 

So I've fixed it, Docker is currently building it.

 

I'm no expert but countless hours of testing has given me enough experience to offer this advice:

8kbit/s is no where near enough data for anything resembling watchable, unless it's tiny frame size.

If your trying to save space I would recommend the following:

  • Remove the bit rate
  • Auto calculate the Quality control
  • Use the "Happy Medium" auto calculation feature with what your willing to accept for compression 60% Compression and 98.5% SSIM is my usual, but it depends on your requirements.
  • Use libx265 encoder, it's soo much better for compression than x264
  • Software encoding is much better than hardware encoding for quality everyday

These are just my recommendations, and I may be completely wrong, due to your requirements. 

 

Thank you again for squashing a bug.

Link to comment

Hey OFark,

 

Thanks for the reply, I will try your recommended settings.

 

And Along i assumed the 8 be 8Mbit/s maybe it should be more indicative on the configuration site. That's my feedback as the raddar table shows value in Mbit/s hence my assumption.

3 hours ago, OFark said:

8kbit/s

 

I am trying to do the encoding using my nvidia card as i want to reserve the CPU for some other task. So based on your experience x265 is better in terms of quality and compression?

 

My requirements is to make my video files smaller and as much as it can maintain the quality.

 

Very happy to help will post more bug is i find any haha thanks for helping out really appreciate it

regards

Link to comment

8kbits vs 8mbps. Yes I see that confusion. FFmpeg defaults to kbits, hence why I'm using that. I'll make that a bit clearer in the next release.

 

X265, basically, creates the same quality video with less data, because it's using more compressible B-Frames. Which is a massivly over simplified answer, but still valid.

 

FFmpeg is throwing an error: 

x265 [error]: fps mismatch with 1st pass (1199/50 vs 24/1)
[libx265 @ 0x55ecbd2ee900] Cannot open libx265 encoder.

 

1199/50 is sooooo close to 24/1, but not quite. I'll see what I can do about that but in the mean time, could you try leaving the Framerate option in the FFmpeg preset blank, this will use the existing video's framerate, and see if that works, please?

 

I'll see if I can find some time today to see why it might be doing that, maybe tomorrow.

Link to comment

Thank for the prompt reply, I understand no worries, so my frame rate setting is the problem. Will remove it and see if it works.

 

Apologies after removing the framerate I saw the "Same As Source", haha I was assuming I have to give it a value hence  place 29.8 as I pluck this value off some article for best video encoding settings.

 

regards

 

Link to comment
5 hours ago, AlexKoh said:

Thank for the prompt reply, I understand no worries, so my frame rate setting is the problem. Will remove it and see if it works.

 

Apologies after removing the framerate I saw the "Same As Source", haha I was assuming I have to give it a value hence  place 29.8 as I pluck this value off some article for best video encoding settings.

 

regards

 

 

Does it work with a Same as source option?

Link to comment

So that error:

 

[mp4 @ 0x55572bad8e80] track 1: codec frame size is not set
[mp4 @ 0x55572bad8e80] Could not find tag for codec subrip in stream #3, codec not currently supported in container

 

Isn't a problem I can fix. That's basically saying that the file type you've chosen (MP4) doesn't support the subtitle coming from the source.

The original file is a Matroska MKV container, and MKV supports a lot more than MP4 does, although MP4 is supported more on older devices, MKV is a lot more universal.

 

I'll do some research into how I can better manage Subtitle options, but for now, if MKV files are the source type, with subtitles, your going to need to keep using MKV.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.