BrettSheleski / comchap

Commercial detection script to add chapters into video file
MIT License
136 stars 26 forks source link

Comcut losing audio on all MKV files recorded with Vorbis audio streams #40

Open glenstewart opened 4 years ago

glenstewart commented 4 years ago

comcut.txt

Comcut was losing audio on all MKV files recorded with Vorbis audio streams. I found that by converting to AAC audio, the problem is solved, and the audio channel isn't dropped.

My use is capturing video with audio from the desktop, which contain commercials. Comcut removes the commercials. The default audio format from a pulseaudio (Ubuntu) capture is Vorbis. Here's the command for that: ffmpeg -loglevel error -video_size "$V" -f x11grab -i :0.0 -f pulse -i default -ac 2 -preset veryfast "$F"

Updated code attached.

BrettSheleski commented 4 years ago

Comcut should preserve the original audio and video formats as-is in the resulting file.

Could you give me an example of how you are calling comcut? Are you specifying a different output file name, or having it just overwrite the input file (default)?

An easy solution you could do is write a simple wrapper script that does the conversion first, then passes the converted file to comcut.

glenstewart commented 4 years ago

Hi Brett,

comcut --comskip-ini=/usr/lib/plexmediaserver/Resources/comskip.ini 'FILE NAME (2015).mkv'

While debugging the problem, I exited the comcut script before it deleted all the working files, and ran "mediainfo" on all the .ts and final .mkv files it made. None of the files had the Audio channel (the original did). I tested it repeatedly on multiple recordings, and they all had the same symptom during conversion.

The recording script came from the Answer 1 here: https://unix.stackexchange.com/questions/488063/record-screen-and-internal-audio-with-ffmpeg

I wondered if converting the Vorbis audio (which I didn't recall seeing before) to AAC (which is very common) would solve the problem, and it did.