Start Trim not to Keyframe, causing "no video" on output

H.264 source video, created a conversion task that tries to trim X seconds off the start of the video.

2022-01-04T15:39:01 MCEBuddy.Engine.ConversionJob → Trimming video recording
2022-01-04T15:39:01 MCEBuddy.Transcode.TrimVideo → Start Trim : 5
2022-01-04T15:39:01 MCEBuddy.Transcode.TrimVideo → Stop Trim : 5

→ Checking output file size [KB] → 1,177,094.00
→ FFMpeg output file size [KB] → 1,177,094.00
2022-01-04T15:39:09 MCEBuddy.Transcode.TrimVideo → TrimVideo trying to replace file Source : C:\Program Files\MCEBuddy2x\working0\The A-Team - s01e02 - Mexican Slayride_ Part 2.ts Temp : C:\Program Files\MCEBuddy2x\working0\The A-Team - s01e02 - Mexican Slayride_ Part 2-temp.ts
2022-01-04T15:39:09 MCEBuddy.Engine.ConversionJob → Trimming successful, setting trim parameters to 0 to avoid retrimming

THAT output file cannot be processed, so the output file has no video.

2022-01-04T15:39:37 MCEBuddy.Transcode.ConvertWithFfmpeg → Command line parameters → -threads 0 -y -i “C:\Program Files\MCEBuddy2x\working0\The A-Team - s01e02 - Mexican Slayride_ Part 2.ts” -ss 0 -vcodec copy -sn -acodec copy “C:\Program Files\MCEBuddy2x\working0\The A-Team - s01e02 - Mexican Slayride_ Part 2-converted.mp4”
WARNING> 2022-01-04T15:39:37 MCEBuddy.Transcode.ConvertWithFfmpeg → No Video stream detected, removing support for video stream

Changing NO other parameters, just removing the START TRIM, makes the job complete successfully.

Seems like we need an option to cut on the closest keyframe?

Bug?

Research seems to suggest we should be finding the closest keyframe to the duration, and then cutting to that spot.

2022-01-04T20:58:45 MCEBuddy.AppWrapper.FFmpeg --> Process arguments  -hide_banner -probesize 100M -analyzeduration 300M -y -i "C:\Program Files\MCEBuddy2x\working0\The Expanse - s05e01 - Exodus.ts" -ss 5 -t 3103 -map 0:a -acodec copy -map 0:1 -vcodec copy "C:\Program Files\MCEBuddy2x\working0\The Expanse - s05e01 - Exodus-temp.ts"

Quite a few suggestions on this thread : How to split a video using FFMPEG so that each chunk starts with a key frame? - Stack Overflow

However there may be a easy(er) fix:

 The documentation indicate that if -ss is passed BEFORE -i, then it act as a seek....

I’m not able to find a way to get this order to reverse - guessing we’ll need a patch to resolve this.

I started playing with the CLI commands, and FFMPEG on the command line, and I can replicate the failure. Sadly, moving “-ss” in front of the input file doesn’t fix it.

Interestingly, choosing something OTHER than a TS file as the output does. (taken from here : audio - How to find a "safe" point for -SS using FFMPEG to avoid breaking A/V sync? - Stack Overflow)

so this fails:

ffmpeg -y -ss 5 -i "The Expanse - s05e01 - Exodus.ts" -map 0:a -acodec copy -map 0:1 -vcodec copy "The Expanse - s05e01 - Exodus-temp.ts"

But this works:

ffmpeg -y -ss 5 -i "The Expanse - s05e01 - Exodus.ts" -acodec copy -map 0:1 -vcodec copy "The Expanse - s05e01 - Exodus-temp.mp4"

or this:

ffmpeg -y -ss 5 -i "The Expanse - s05e01 - Exodus.ts" -acodec copy -map 0:1 -vcodec copy "The Expanse - s05e01 - Exodus-temp.mkv"

Update: “Skip Remuxing Files” works around this issue, so it confirms the cause as FFMPEG/TS container. (aside from being much much slower) Maybe a checkbox to use MP4 or MKV instead of TS when remuxing?

However, it brings up another issue. Cutting the start of a clip appears to remove subtitles. :frowning:

WARNING> 2022-01-05T07:59:40 MCEBuddy.Engine.ConversionJob --> SKIPPING REMUXING, this may lead to conversion failure since all underlying apps may not support all file formats.
WTV commercial detection is only supported by donator version of Comskip (http://www.kaashoek.com/comskip/).
WARNING> --> CCExtractor failed or no result. Disabling sentence capitalization and retrying
WARNING> --> CCExtractor failed to extract closed captions
WARNING> 2022-01-05T08:00:08 MCEBuddy.Transcode.CCandSubtitles --> No valid SRT file found, retrying with forced DVB detection
WARNING> --> CCExtractor failed or no result. Disabling sentence capitalization and retrying
WARNING> --> CCExtractor failed to extract closed captions
WARNING> 2022-01-05T08:00:18 MCEBuddy.Transcode.CCandSubtitles --> No valid SRT file found
WARNING> 2022-01-05T08:00:18 MCEBuddy.Engine.ConversionJob --> Extracting closed captions failed from original file, trying to extract closed captions from the remuxed file
WARNING> --> CCExtractor failed or no result. Disabling sentence capitalization and retrying
WARNING> --> CCExtractor failed to extract closed captions
WARNING> 2022-01-05T08:00:27 MCEBuddy.Transcode.CCandSubtitles --> No valid SRT file found, retrying with forced DVB detection
WARNING> --> CCExtractor failed or no result. Disabling sentence capitalization and retrying
WARNING> --> CCExtractor failed to extract closed captions
WARNING> 2022-01-05T08:00:37 MCEBuddy.Transcode.CCandSubtitles --> No valid SRT file found
WARNING> 2022-01-05T08:00:37 MCEBuddy.Engine.ConversionJob --> No SRT file found after extraction

Will need a copy of the original video and the conversion log to our server so we can analyze what’s going on and replicate it.

Also try updating your ffmpeg to the latest version and see if that helps.

Happy to @Goose - PM me details on where to upload the files and logs, and I’ll get them in your hands immediately.

have updated ffmpeg - doesn’t seem to help.

Upload instructions are here: Welcome to MCEBuddy - README BEFORE POSTING

:man_facepalming:

Will get it done. :slight_smile:

** uploaded as request - appreciate the time **

Just joined so I can add to this. Glad I found this thread, i am experiencing the same issue. It is related for me to PlayonCloud recordings. I think something changed on their side, because I can take recordings I did about a month ago on playon and run it through MCEBuddy and no issues. The Skip Remuxing Files does not work for me, causes the audio to be delayed. however removing the cut start, it does work, you just have the playon intro now

1 Like

FWIW, I can make them cut right in FFMPEG by hand if I use MP4 or MKV instead,

ffmpeg -ss $TRIM_DURATION -noaccurate_seek -i "$INPUT_FILENAME" -avoid_negative_ts make_zero -map 0 -c copy "$OUTPUT_FILENAME"

+1 to what @toadman mentioned. I too can repro this with when I add a “Start Cut” and “End Cut” on PlayOn recordings. Does not repro with live TV recordings of the same show (WMC / .wtv).

This occurs on 2 separate machines with one being older HW and another being newer HW. Same failure when converting to HVEC, MP4 or no conversion. Both machines were working successfully a couple weeks ago with no other changes other listed above.

Let me know if uploading any log files or recordings will help.

@dlasher let me know if this isn’t the same issue you are seeing, I don’t want to hijack your thread with an alternate issue.

Exactly the same issue, videos sourced from PlayOn, thanks for checking @schnood

I thought I would post what I think is another example. I went ahead and uploaded the log files to the mcebuddy server if helpful. Similar to a few others, when processing a Playon Cloud recording with a Cut Start, it does not show a video after processing. Running it a second time without a Cut, and it processes & plays fine. For kicks, I re-ran a Playon file from the desktop version (v4.5) with a Cut Start of 4 seconds and it plays back fine.

References for the uploaded log files (also zipped here):
Log files.zip (695.1 KB)

Log # 1: is from a Playon Cloud recording, with a Cut Start of 6 seconds. After it processes, no video shows.

Log # 2: This log is from the same source file, but with no cut. It processes & plays back fine

Log # 3: This log is from Playon – desktop version (a few months ago, using v4.5). I set it up with Cut Start of 4 seconds, and it processes and plays back fine.

@Goose is there any additional info that would help? Is this on the books as an “official” issue?

I am also having the same issue.

Here is some more information on the issue and a circumvention.

I had a TV show that was recorded using Playon.

I took the .mp4 and using a file converter tool converted it to .mp4 (with the idea that this would add any segments missing from the original that MCEBuddy is having problems with).

I then had MCEBuddy remove the first and last 5 seconds.

This worked fine.

I then had MCEBuddy remove all commercials using the Comskip option.

This worked fine.

It appears that Playon has changed to no longer write all the segments that MCEBuddy is expecting.

Until this is fixed, I will be following this process.

I hope this helps others.

Thanks for the logs and sample files. It appears that the MP4 file being produced by the latest version of PlayOn isn’t compliant with the specs and has errors which is throwing ffmpeg off when it tries to remux it from MP4 to TS for processing the file AND while trying to trim the start. During this process it’s losing some critical metadata about the video stream so it can’t be played back.

The short term solution is to enable the option to enable the option Skip remuxing files in the Conversion Task → Expert settings page to avoid having MCEBuddy remuxing the MP4 to TS and instead work directly on the MP4 files - which should avoid this issue.

The long term solution is to report it to PlayOn so they can fix it, as @scott_mb has tested that it’s working fine with PlayOn version 4.5

Anyone on this group going to contact playon?

I contacted Playon support. Since the original videos are playable, they are not treating this as a bug on their side.