Author Topic: Thumbnails for home movies  (Read 1201 times)

kyfalcon

  • Guru
  • ****
  • Posts: 390
    • View Profile
Thumbnails for home movies
« on: December 30, 2011, 10:41:42 pm »
What is the best way to create thumbnails for home movies? 00012.m2ts gives me no idea what I'm about to watch and I now have hundreds of these finally working.

Thanks,
Kevin

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3059
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Thumbnails for home movies
« Reply #1 on: December 31, 2011, 10:14:42 am »
Watch the movie, and click snapshot.

kyfalcon

  • Guru
  • ****
  • Posts: 390
    • View Profile
Re: Thumbnails for home movies
« Reply #2 on: December 31, 2011, 08:57:00 pm »
Posde I watched the movie and clicked thumbnail answered the question, did regen/reload but nothing. My movies are m2ts files, is this going to be an issue?

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Thumbnails for home movies
« Reply #3 on: January 01, 2012, 01:45:25 am »
Any time you click the thumbnail button on orbiter, it will take a snapshot of what is currently playing, and the result is instantly passed into the media database, the moment you press one of the items in the datagrid.

-Thom

kyfalcon

  • Guru
  • ****
  • Posts: 390
    • View Profile
Re: Thumbnails for home movies
« Reply #4 on: January 02, 2012, 06:14:58 am »
Thom that worked for my avi files but not my .m2ts files. Is there another way to do this for those?

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Thumbnails for home movies
« Reply #5 on: January 02, 2012, 05:44:04 pm »
hm looks like Get Video Frame needs to be implemented for MPlayer_Player. Perhaps a call to scrot could handle this? (I do this in Game Player and MythTV Player).

-Thom

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3059
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Thumbnails for home movies
« Reply #6 on: January 02, 2012, 07:33:10 pm »
kyfalcon,

if you want to be able to use MPlayer to create these snapshots as well, feel free to open a trac ticket feature request. Thanks.

EDIT: Make it a bug. Get Videoframe is implemented in MPlayer_Player, so it must be a bug, why it does not work.
« Last Edit: January 02, 2012, 07:38:52 pm by posde »

kyfalcon

  • Guru
  • ****
  • Posts: 390
    • View Profile
Re: Thumbnails for home movies
« Reply #7 on: January 02, 2012, 08:17:25 pm »
Created a ticket. Noticed in MPlayer log that the call to screenshot times out and is aborted.

05   01/02/12 16:08:44.567      MPlayer_Player::Log MPlayerEngine::GetScreenshot - timeout waiting for screenshot maker, aborting <0xb6dcab70>
« Last Edit: January 03, 2012, 04:12:22 pm by kyfalcon »

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1081
    • View Profile
Re: Thumbnails for home movies
« Reply #8 on: January 02, 2012, 10:39:40 pm »
I think it might have something to do with converting the grab to a jpg.

I have no idea what I am doing, just looking around.
I never quit... I just ping out.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Thumbnails for home movies
« Reply #9 on: January 03, 2012, 02:24:57 am »
A quick fix would be to call scrot, to make the screenshot. Example code for this is in src/MythTV_Player/MythTV_Player.cpp .. ::CMD_Get_Video_Frame().

-Thom

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1081
    • View Profile
Re: Thumbnails for home movies
« Reply #10 on: January 03, 2012, 03:14:45 am »
I will take a stab at this.

Starting to make sense... need to start dealing in real code anyway. I know this is simple, but it will take me a little while. I need to look up the things I do not think I understand... and some I do. Got to start somewhere. Here I have a working example, so I just need to create similar sizing variables being called under PLUTO_SAFETY_LOCK.
I never quit... I just ping out.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3059
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Thumbnails for home movies
« Reply #11 on: January 03, 2012, 12:57:00 pm »
A quick fix would be to call scrot, to make the screenshot. Example code for this is in src/MythTV_Player/MythTV_Player.cpp .. ::CMD_Get_Video_Frame().

why should one use scrot, when the snapshot facility is already implented in Mplayer_player?

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Thumbnails for home movies
« Reply #12 on: January 03, 2012, 05:37:33 pm »
Because I am not sure with niz's changes that there is a screenshot command in the engine that he wrote.

-Thom

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1081
    • View Profile
Re: Thumbnails for home movies
« Reply #13 on: January 03, 2012, 05:54:54 pm »
I can tell you that Xine_Player has its own
JpegEncoderDecoder.cpp/h and MPlayerPlayer does not.

If you will tell me how you want it done, it feels like a great place to start for me... esp as it involves X params. I can try and implement the same practices used by Xine_Player.
I never quit... I just ping out.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: Thumbnails for home movies
« Reply #14 on: January 03, 2012, 06:00:30 pm »
in the end, Get Video Frame expects two output parameters, the string containing the thumbnail to send to the caller, and an integer specifying the format.

In the case of Xine Player, xine-lib is linked, and the xine-lib API has facilities to take a picture of the displayed surface, and return it.

I merely suggested scrot because you can run scrot, it writes a file of the exact size specified by the width and height parameters, and you can use PlutoUtils::ReadFileIntoBuffer to send the resulting file to a buffer, for which a pointer can be returned.

-Thom