[2.5.6] 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