Chubby Arse 23 Posted November 10, 2015 Share Posted November 10, 2015 Hi all, I've been playing with Comskip on my Media Portal recordings. My recordings are in .ts files. The recording in particular that I'm trying to gives the following data in MediaInfo: General ID : 4 (0x4) Complete name : C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.ts Format : MPEG-TS File size : 3.97 GiB Duration : 2h 8mn Overall bit rate mode : Variable Overall bit rate : 4 403 Kbps Video ID : 48 (0x30) Menu ID : 137 (0x89) Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : 27 Duration : 2h 8mn Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Standard : Component Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Audio ID : 64 (0x40) Menu ID : 137 (0x89) Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Muxing mode : LATM Codec ID : 17 Duration : 2h 8mn Bit rate mode : Variable Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy Delay relative to video : -475ms Language : English descriptor_tag_extension : 6 Text ID : 80 (0x50) Menu ID : 137 (0x89) Format : DVB Subtitle Codec ID : 6 Duration : 2h 8mn Delay relative to video : 3s 934ms Language : English I've successfully generated edl files one of my recordings - here's the content I am trying to apply. Here's the log file from generating the edl: St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.log 5.00 257.80 0 1295.40 1560.36 0 2749.56 3014.24 0 4202.24 4467.20 0 5762.88 6082.48 0 7306.20 7731.40 0 I've tried to use Mencoder to apply the edl using the following command line: "C:\Media Utilities\Mencoder\mencoder.exe" -oac copy -ovc copy "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.ts" -edl "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.edl" -o "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27_Edited.ts" Which gave me the following result: Audio format 0x4c34504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it. I've attached the complete log file: Attempt1.txt So I tried the following with -oac pcm: "C:\Media Utilities\Mencoder\mencoder.exe" -oac pcm -ovc copy "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.ts" -edl "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.edl" -o "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27_Edited.ts" And got "Too many audio packets in the buffer: (4096 in 3495096 bytes). I've attached the complete log file: Attempt2.txt Lastly, I tried this: "C:\Media Utilities\Mencoder\mencoder.exe" -oac copy -fafmttag 0x706d -ovc copy "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.ts" -edl "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27.edl" -o "C:\Temp\ComskipTests\St Trinian's 2_ The Legend of... - Channel 4 HD - 2015-09-27_Edited.ts" and got the "Too many audio packets in the buffer: (4096 in 3414814 bytes)." I've attached the complete log file: Attempt3.txt Can anyone help get get this applied. I tried to find out if ffmpeg could process edl files and produce a direct stream copy of the edited source - but it looks like that can only do one cut at a time into a new file and then join the edits (files) together. I've also read that mencoder is only really suitable for avi file processing - but anything other approach is not well documented and quite thin on the ground. Once I understand what is going on, I plan to do a POC where emby could possibly support this out-of-the-box, but that seems a long way away! Thanks - any help or insight is appreciated. Link to comment Share on other sites More sharing options...
Griffo 3 Posted November 11, 2015 Share Posted November 11, 2015 (edited) It may be a stupid questions, but what exactly are you actually trying to achieve? To get mencoder to remux the TS file while removing the segments specified in the EDL file? it might be worth downloading mcebuddy, set it to do a comskip and remux for you in .ts and look at the log file to see what it does, it's the most reliable tool for tv recording post processing i've seen, he's got the process down pat. Edited November 11, 2015 by Griffo Link to comment Share on other sites More sharing options...
Chubby Arse 23 Posted November 11, 2015 Author Share Posted November 11, 2015 Thanks for the response - you are right - I'm trying edit out the adverts from a ts file. As I'm doing a proof-of-concept, using MCEBuddy isn't an option as I'm trying to determine if it's a feature that can be implemented in Emby. I had a look at his source code last night and he uses ffmpeg to create a video file for each part of the file that is being retained (that isn't a advert break) and joins them together to create a single file. It's a technique I've read about elsewhere too. So I'm going to create a wrapper that does that as well. 1 Link to comment Share on other sites More sharing options...
KRA 39 Posted November 11, 2015 Share Posted November 11, 2015 I like where you are going, but imho it's the wrong way to do it. If anything Emby should support reading the edl file. Unfortunately this is something both clients and servers need to support. Server needs it when transcoding, so this is a ffmpeg issue, there is a ticket for it but it's 3 years old and open, ffmpeg has the ability to cut, but not read the edl, so you could do it with ffmpeg but you would need a parser for the edl file that would apply the output to ffmpeg commandline. But also the clients need to read edl files if they access the files directly and not streamed from emby server. Your approach is the "easy" to implement solution, but I don't see how it would fit into emby, it would have to be a plugin where you specify what folders to run this. But doesn't all TV-Server backends already support this ? If not, I believe one would be better off just installing MCEBuddy like suggested. 1 Link to comment Share on other sites More sharing options...
Damstas 9 Posted November 11, 2015 Share Posted November 11, 2015 +1 to ChubbyArse's idea! Implentation directly to Emby would be good. Link to comment Share on other sites More sharing options...
Chubby Arse 23 Posted November 11, 2015 Author Share Posted November 11, 2015 I like where you are going, but imho it's the wrong way to do it. If anything Emby should support reading the edl file. Unfortunately this is something both clients and servers need to support. Server needs it when transcoding, so this is a ffmpeg issue, there is a ticket for it but it's 3 years old and open, ffmpeg has the ability to cut, but not read the edl, so you could do it with ffmpeg but you would need a parser for the edl file that would apply the output to ffmpeg commandline. But also the clients need to read edl files if they access the files directly and not streamed from emby server. Your approach is the "easy" to implement solution, but I don't see how it would fit into emby, it would have to be a plugin where you specify what folders to run this. But doesn't all TV-Server backends already support this ? If not, I believe one would be better off just installing MCEBuddy like suggested. Thanks for the input - however, I am considering a post record process that would read the edl (that was generated during recording) and edit the recorded file and archive the output. I'm thinking in particular of films: Emby schedules the film (there is already meta data associated with it as Emby generates it for the guide) Emby records the stream on scheduled Comskip will read the target filename and generate the edl whilst the recording is in progress (I've not tried this but it is cited as possible) Once the recording and the edl generation is complete - the file edl is parsed (I've looked at the MCEBuddy code source today) and ffmpeg is called to generate the non-advert parts Once the parts are created - ffmpeg joins them together Emby saves the film into the users nominated "Movies" folder and it appears on the next refresh. This is only at the POC stage (I'm literally installing my HDHR as I type) and no doubt is going to be fraught with issues - but you got to have a dream eh? Link to comment Share on other sites More sharing options...
mediacowboy 438 Posted November 12, 2015 Share Posted November 12, 2015 (edited) If you are able to get this from a poc to alpha or beta. I would be willing to help you test. As this would cut down on the way I obtain my TV shows right now. Edited November 12, 2015 by mediacowboy Link to comment Share on other sites More sharing options...
Damstas 9 Posted November 12, 2015 Share Posted November 12, 2015 Would this feature work with PVR plugins too, if they provide enough information with the metadata? Link to comment Share on other sites More sharing options...
KRA 39 Posted November 14, 2015 Share Posted November 14, 2015 Thanks for the input - however, I am considering a post record process that would read the edl (that was generated during recording) and edit the recorded file and archive the output. I'm thinking in particular of films: Emby schedules the film (there is already meta data associated with it as Emby generates it for the guide) Emby records the stream on scheduled Comskip will read the target filename and generate the edl whilst the recording is in progress (I've not tried this but it is cited as possible) Once the recording and the edl generation is complete - the file edl is parsed (I've looked at the MCEBuddy code source today) and ffmpeg is called to generate the non-advert parts Once the parts are created - ffmpeg joins them together Emby saves the film into the users nominated "Movies" folder and it appears on the next refresh. This is only at the POC stage (I'm literally installing my HDHR as I type) and no doubt is going to be fraught with issues - but you got to have a dream eh? You have to do what makes you happy, but for me this seems like much effort for very little gain to make a emby plugin for this. If you are using a tv-server you can already do this, and MCEBuddy makes it rather easy. I must admit I havn't used it in a while so I might be missing something but I don't believe I do. I do however see a point here if using EmbyTV, and not a tv-server backend. But still I believe it's much work for little gain. Comskip is a real hassle to setup to work correct, so to use it you would already have to be at some level of computing skill so it's not like installing MCEBuddy would be too demanding on most people anyway. I've never gotten comskip to work 100% I remember back in the days with MythTV where this just worked "out of the box". Those where the analog days, now with digital broadcasting one would believe it should work better but... Maybe the broadcasters have become smarter and use tricks to fool the comskip software/hardware out there. I did some testing on using memcoder a few years back to cut out comercials but I never managed to get it working with streamcopy, only transcoding worked. Anyways, good luck on you project. Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted November 14, 2015 Share Posted November 14, 2015 Personally I'd prefer not to use mcebuddy. Under wmc I used dvrmstoolbox with practically no set up and almost perfect results. Had to join the early access versions of both dvrmstoolbox and comskip but it was great. The dvrmstoolbox creator is on this board as a mod I believe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now