Jump to content

Search the Community

Showing results for tags 'ccextractor'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Emby Premiere Purchase/Subscription Support
    • Feature Requests
    • Tutorials and Guides
  • Emby Server
    • General/Windows
    • Android Server
    • Asustor
    • FreeBSD
    • Linux
    • NetGear ReadyNAS
    • MacOS
    • QNAP
    • Synology
    • TerraMaster NAS
    • Thecus
    • Western Digital
    • DLNA
    • Live TV
  • Emby Apps
    • Amazon Alexa
    • Android
    • Android TV / Fire TV
    • Windows & Xbox
    • Apple iOS / macOS
    • Apple TV
    • Kodi
    • LG Smart TV
    • Linux & Raspberry Pi
    • Roku
    • Samsung Smart TV
    • Sony PlayStation
    • Web App
    • Windows Media Center
    • Plugins
  • Language-specific support
    • Arabic
    • Dutch
    • French
    • German
    • Italian
    • Portuguese
    • Russian
    • Spanish
    • Swedish
  • Community Contributions
    • Ember for Emby
    • Fan Art & Videos
    • Tools and Utilities
    • Web App CSS
  • Testing Area
    • WMC UI (Beta)
  • Other
    • Non-Emby General Discussion
    • Developer API
    • Hardware
    • Media Clubs

Blogs

  • Emby Blog

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. ShotToTheDome

    Emby post-processing dvr script for linux

    I thought I'd post my emby post-processing dvr script. Tested and working on Debian Linux 8.9 Files processed end up being named *originalvideoname*.ts.mkv so i can search by that and make sure recordings have no issues. After I look at them, I manually rename to just .mkv. I do not have automatically convert recordings checked or the two preserve boxes checked under live tv --> settings. Script flow: see if lockfile exists. if so wait 60 sec create lockfile commerical scan and commerical cutting ccextractor to pull out closed captions and convert to srt file Encode to h264 using ffmpeg and combine in srt file from previous step Trim off first 60 sec from recording (due to iptv delay you get a minute from previous show. I have recordings set to last 1 min longer in emby record. The shows using my OTA tuners start early by 1 min to compensate) Remove srt/extra files Overwrite original ts recording delete lockfile Depends on: comskip, comcut (comchap optional), ccextractor, ffmpeg I eventually want to fool around with a nvidia gtx 1050 and see how nevnc with hevc/h265 works on the ffmpeg encoding line. Software h265 encoding on very fast saves an additional 30-40% space on same setting as h264 on medium but my encoding framerate goes from 420fps (14x) to 69fps (2.3x) on dual Xeon e5-2670s. The picture looks pretty much identical when i look at them side by side post.sh emby script #!/bin/csh set path = ($path /usr/local/bin) set lockFile = '/tmp/dvrProcessing.lock' set origFile = "$1" set tmpFile = "$1.tmp" set tmpEncode = "$1.mkv" set tmpEncode2 = "$1.2.mkv" set tmpSrt = "$1.srt" set dvrPostLog = '/path/to/embydvr/dvrProcessing.log' set dvrLockLog = '/path/to/embydvr/dvrLock.log' #Wait if post processing is already running while ( -f $lockFile ) echo "'$lockFile' exists, sleeping processing of '$origFile'" | tee $dvrLockLog sleep 60 end #Create lock file to prevent other post-processing from running simultaneously echo "Creating lock file for processing '$origFile'" | tee -a $dvrPostLog touch $lockFile #Mark and cut commercials echo "cut from '$origFile'" | tee -a $dvrPostLog /path/to/embydvr/comchap/comcut --lockfile=/tmp/comchap.lock --comskip-ini=/path/to/embydvr/comskip.ini "$origFile" #Pull CC from file to SRT file echo "Pulling Closed captions from '$origFile' to SRT file" | tee -a $dvrPostLog ccextractor "$origFile" -o "$tmpSrt" #Encode file to H.264 with mkv container using ffmpeg and mux in CC srt echo "Re-encoding '$origFile' to MKV file while adding cc data" | tee -a $dvrPostLog /usr/bin/ffmpeg -i "$origFile" -i "$tmpSrt" -map 0 -map 1 -acodec copy -scodec copy -c:v libx264 -preset medium -crf 23 -profile:v high -level 4.1 -deinterlace "$tmpEncode" #Trim off first minute echo "Remove first 60 sec of file" | tee -a $dvrPostLog /usr/bin/ffmpeg -ss 00:01:00 -i "$tmpEncode" -vcodec copy -acodec copy -scodec copy "$tmpEncode2" #Remove SRT file echo "Remove SRT file" | tee -a $dvrPostLog rm -f "$tmpSrt" #Remove tmpEncode file echo "Remove tmpEncode file" | tee -a $dvrPostLog rm -f "$tmpEncode" #Rename transcoded file to temp file in case no subtitles echo "Rename 2nd transcoded file to tmp file" | tee -a $dvrPostLog mv -f "$tmpEncode2" "$tmpFile" #Overwrite original ts file with the transcoded file echo "Removing '$origFile'" | tee -a $dvrPostLog mv -f "$tmpFile" "$origFile" #Rename .ts file to .ts.mkv echo "Renaming '$origFile' to .mkv" | tee -a $dvrPostLog mv -f "$origFile" "$1.mkv" #Remove lock file echo "Done processing '$origFile' removing lock" | tee -a $dvrPostLog rm $lockFile exit 0
×
×
  • Create New...