SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-19-2016, 08:53 AM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 134
FFmpeg generate thumbnail from transport stream

In the IOS client I am writing I am providing the capability to generate 15 thumbnail images with one image for each 20 seconds from the current stop you are at. This is great when playing back a tv show with commercials. This lets you skip most or all of the commercials. I have this working but the server side thumbnail generation is slower than I would like. This is because I haven't been able to generate thumbnails directly on a .ts stream, I am having to convert them to mp4 first then generate the images. The following is what I am using and is working:
ffmpeg -i 1.ts -c:a copy -c:v copy -bsf:a aac_adtstoasc 1.mp4
and then I generate the thumbnail using:

ffmpeg -ss 1.73 -i 1.mp4 -qscale:v 16 -vframes 1 -s 265x148 1.jpg
This works but it takes longer. How do I generate a thumbnail image without first having to create a .mp4 file. Yes I have tried just giving it the .ts file with the -vframe 1 line but it doesn't produce the correct image.

Last edited by davidb; 02-19-2016 at 08:57 AM.
Reply With Quote
  #2  
Old 02-19-2016, 09:10 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by davidb View Post
In the IOS client I am writing I am providing the capability to generate 15 thumbnail images with one image for each 20 seconds from the current stop you are at. This is great when playing back a tv show with commercials. This lets you skip most or all of the commercials. I have this working but the server side thumbnail generation is slower than I would like. This is because I haven't been able to generate thumbnails directly on a .ts stream, I am having to convert them to mp4 first then generate the images. The following is what I am using and is working:
ffmpeg -i 1.ts -c:a copy -c:v copy -bsf:a aac_adtstoasc 1.mp4
and then I generate the thumbnail using:

ffmpeg -ss 1.73 -i 1.mp4 -qscale:v 16 -vframes 1 -s 265x148 1.jpg
This works but it takes longer. How do I generate a thumbnail image without first having to create a .mp4 file. Yes I have tried just giving it the .ts file with the -vframe 1 line but it doesn't produce the correct image.
If this is a sagetv mediafie, you can use the sagetv API for this.

https://github.com/stuckless/sagetv-...mbAPI.java#L56

In Phoenix, this is what is used to create the thumbnail strip, and it relies on the underlying MediaFileAPI.GenerateThumbnail api.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg error creating thumbnail jusjoken SageTV Github Development 47 02-27-2016 12:11 PM
Transport Stream .vs Program Stream Polypro SageTV Software 24 07-01-2011 01:28 PM
MPEG2 Transport Stream vs Program Stream GollyJer SageTV Software 8 03-05-2007 08:06 PM
HDHomeRun Transport Stream flavius Hardware Support 1 02-20-2007 01:01 AM


All times are GMT -6. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.