Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 16 Oct 2018, 11:22
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to convert WebP formatted images in Tahrpup?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
MochiMoppel


Joined: 26 Jan 2011
Posts: 1662
Location: Japan

PostPosted: Tue 05 Dec 2017, 01:34    Post subject:  How to convert WebP formatted images in Tahrpup?  

My private edition of MMview supports a couple of image formats not (yet) supported in the posted version, and one of them is WebP.

It is easy to convert a WebP image to JPEG with ffmpeg:
Code:
ffmpeg -i input.webp output.jpg

I've learned that ffmpeg is not installed in Tahrpup, so how could this be done in this and other distributions that replaced ffmpeg with avconv? I've already tried avconv, but no dice Crying or Very sad

[Edit]: Cleared Fatdog's name.

.

Last edited by MochiMoppel on Tue 05 Dec 2017, 09:23; edited 2 times in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12794
Location: Gatineau (Qc), Canada

PostPosted: Tue 05 Dec 2017, 03:01    Post subject:  

Hello MochiMoppei.

Good to see you are working on a new project! Smile

In answer to your question:

Google itself has some tools for coding and decoding webp images:
https://developers.google.com/speed/webp/download

I have assembled those tools into a pet, libwebp-0.6.1-linux-x86-32.pet, available
here for the next month: http://www43.zippyshare.com/v/jAcl4HY9/file.html

Also, some webp images may be converted with imagemagick. Please see
answer # 31 on this page:
https://unix.stackexchange.com/questions/70622/command-line-convert-webp-to-jpg

I had no problem viewing the webp original images on the Google developers' page:
https://developers.google.com/speed/webp/gallery1 in my old opera 12.16.
I could have taken a snapshot with SFR's Take-a-Shot or similar to obtain a jpg.

I have successfully used the dwebp utility (from the Google package mentioned
above) to convert image 2.webp on that page to png. This png image can then be
loaded in Puppy's mtpaint for further process.

I have used this dwebp utility on xenialPup. It appears to be "distro-agnostic", but
you and / or other Puppyists may wish to confirm that it can run on other Puppies
than the xenialPup.
.
IHTH.
dwebp-help.jpg
 Description   The 1st option below ( -pam ) can be interesting for Puppyists, because most
Puppies have the pam and pbm image processing utilities.
 Filesize   142.84 KB
 Viewed   466 Time(s)

dwebp-help.jpg


_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8680
Location: qld

PostPosted: Tue 05 Dec 2017, 07:01    Post subject:  

@musher0, I think mochimoppel wants to use what's there already.

But I don't know what's in pups that i haven't used or built but hopefully x264 is there so it can decode a .webp file. I created a file and then took a screenshot in mplayer. Maybe VLC, Xine or MPV can do similar to this.. (my input webp file is '1.webp' and i output to zz.mkv.. use what out format your vpx can support. '1.webp' I used is available from http://www.gstatic.com/webp/gallery/1.webp).

Code:
x264 -o zz.mkv 1.webp ; mplayer -frames 1 -vo jpeg:outdir=/root 1 zz.mkv


Direct the output file wherever but _my_ mplayer defaults to '00000001.jpg'.

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1662
Location: Japan

PostPosted: Tue 05 Dec 2017, 07:45    Post subject:  

musher0: Thanks. I'm aware of the tools you mentioned but I doubt that they are shipped with Tahrpup. I may be wrong.
01micko: Though x264 is installed in Slacko5.6 it doesn't seem to work. I can't even call up the usage info Crying or Very sad
Code:
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory

Last edited by MochiMoppel on Tue 05 Dec 2017, 09:21; edited 1 time in total
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1664

PostPosted: Tue 05 Dec 2017, 08:02    Post subject: Re: How to convert WebP formatted images in Tahrpup/Fatdog?  

MochiMoppel wrote:
I've learned that ffmpeg is not installed in Tahrpup and Fatdog, so how could this be done in these distributions? I've already tried avconv, but not dice Crying or Very sad

Of course there is ffmpeg in Fatdog OOTB.
Tahrpup ships with avconv instead, but just checked and like you said, it can't handle webp...

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1662
Location: Japan

PostPosted: Tue 05 Dec 2017, 09:14    Post subject:  

Sorry, must have mixed it up. I'll correct my posts - of course Laughing
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12794
Location: Gatineau (Qc), Canada

PostPosted: Tue 05 Dec 2017, 12:43    Post subject:  

To 01micko, MochiMoppei and all.

I am not a diviner. Posters should state a complete question properly, with
complete background.

In any case, I do not regret spending three hours yesterday evening
doing research on a valid solution that will benefit all Puppyists.


Have a boring day giving no background to anyone, everyone.

_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12794
Location: Gatineau (Qc), Canada

PostPosted: Thu 07 Dec 2017, 17:54    Post subject:  

Sorry for having been a grouch the other day.

Mutatis mutandis, the following two lines will give MochiMppei what he wants in a
cinch, using Google's dwebp and netpbm's pnmtojpeg:
Code:
dwebp 2.webp -ppm -o 2.ppm
pnmtojpeg -quality=99 2.ppm > 2.jpg

BFN
TahrPup-606_has_pnmtojpeg.jpg
 Description   
 Filesize   33.29 KB
 Viewed   195 Time(s)

TahrPup-606_has_pnmtojpeg.jpg


_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)

Last edited by musher0 on Fri 08 Dec 2017, 00:15; edited 2 times in total
Back to top
View user's profile Send private message 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1543

PostPosted: Thu 07 Dec 2017, 21:49    Post subject:  

MochiMoppel wrote:
01micko: Though x264 is installed in Slacko5.6 it doesn't seem to work. I can't even call up the usage info Crying or Very sad
Code:
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory

Interesting. I looked at mine in Slacko 5.7 and x264 --help gave the same message as you. It looks like three of the libraries (pulled from ffmpeg-2.0-i686-s14.0.pet) are .01 version too new for x264-snapshot-20120804-2245-i686.pet, and you either have to download x264-20120712-i486-1gv.txz from Salix to match ffmpeg2 or use ffmpeg-0.11.1-i686.pet to match the x264.

edit: Another option that worked for me was the x264-20131101-2245-i686_slk600.pet from Slacko 14.1 instead of Salix.
Screenshot.png
 Description   symlinking the 55s to 54 and 52 to 51 for puppy-20120804 wasn't enough
 Filesize   34.94 KB
 Viewed   274 Time(s)

Screenshot.png

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12794
Location: Gatineau (Qc), Canada

PostPosted: Fri 08 Dec 2017, 00:29    Post subject:  

Hello all.

I just added proof that tahrPup-606 has the pnmtojpeg utility in my message above:
http://murga-linux.com/puppy/viewtopic.php?p=976446&sort=lastpost#976446

Since pnmtojpeg is 13,9 Kb, and already in tahrPup, IMO it's not worth updating /
correcting the whole libav library -- if converting a webp image to jpg is the only
thing you wish to do. You embark the rather small webp package from Google (one
can even trim it further), you adapt my two-liner, and you're on your way.

But of course the Earth is round (sort of), and people are free!!!

BFN.

_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1662
Location: Japan

PostPosted: Fri 08 Dec 2017, 03:38    Post subject:  

Sailor Enceladus wrote:
Another option that worked for me was the x264-20131101-2245-i686_slk600.pet from Slacko 14.1.
Yeah, the --help option works now, that's a start Laughing
Unfortunately that doesn't mean that it can convert any webp image into a mkv container. When I try 01micko's x264 command I get an empty mkv file, accompanied by a funny error message:
Code:
lavf [info]: 187x310p 0:1 @ 0/0 fps (cfr)
resize [error]: resolution 187x310 is not compliant with colorspace i420

Even if it would work I couldn't use it as a workaround for Tahrpup users: Tahrpup (I tested 6.0.5) doesn't ship with x264 ...
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5216
Location: Republic of Novo Zelande

PostPosted: Thu 20 Sep 2018, 14:39    Post subject:  

MochiMoppel wrote:
Though x264 is installed in Slacko5.6 it doesn't seem to work. I can't even call up the usage info Crying or Very sad
Code:
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory

I gave this a go on my Slacko 5.6 derivative and had to progressively symlink existing (newer) versions of libavformat, libavcodec and libavutil but still no apparent result:

Code:
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavcodec.so.54: cannot open shared object file: No such file or directory
# /usr/bin/x264 --help
/usr/bin/x264: error while loading shared libraries: libavutil.so.51: cannot open shared object file: No such file or directory
# /usr/bin/x264 --help



EDIT :Then I installed sailors pet (the one highlighted by MM) (had to do it manually as it refused to install automatically) and now -- help does work as you said. Where to from here? Anything I can try?

Code:
# /usr/bin/x264 --help
x264 core:138 r111M d37a857
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
  or YUV4MPEG (*.y4m),
  or Avisynth if compiled with support (yes).
  or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
 .264 -> Raw bytestream
 .mkv -> Matroska
 .flv -> Flash Video
 .mp4 -> MP4 if compiled with GPAC support (no)
Output bit depth: 8 (configured at compile time)

Options:

  -h, --help                  List basic options
      --longhelp              List more options
      --fullhelp              List all options

Example usage:

      Constant quality mode:
            x264 --crf 24 -o <output> <input>

      Two-pass with a bitrate of 1000kbps:
            x264 --pass 1 --bitrate 1000 -o <output> <input>
            x264 --pass 2 --bitrate 1000 -o <output> <input>

      Lossless:
            x264 --qp 0 -o <output> <input>

      Maximum PSNR at the cost of speed and visual quality:
            x264 --preset placebo --tune psnr -o <output> <input>

      Constant bitrate at 1000kbps with a 2 second-buffer:
            x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input>

Presets:

      --profile <string>      Force the limits of an H.264 profile
                                  Overrides all settings.
                                  - baseline,main,high,high10,high422,high444
      --preset <string>       Use a preset to select encoding settings [medium]
                                  Overridden by user settings.
                                  - ultrafast,superfast,veryfast,faster,fast
                                  - medium,slow,slower,veryslow,placebo
      --tune <string>         Tune the settings for a particular type of source
                              or situation
                                  Overridden by user settings.
                                  Multiple tunings are separated by commas.
                                  Only one psy tuning can be used at a time.
                                  - psy tunings: film,animation,grain,
                                                 stillimage,psnr,ssim
                                  - other tunings: fastdecode,zerolatency

Frame-type options:

  -I, --keyint <integer or "infinite"> Maximum GOP size [250]
      --tff                   Enable interlaced mode (top field first)
      --bff                   Enable interlaced mode (bottom field first)
      --pulldown <string>     Use soft pulldown to change frame rate
                                  - none, 22, 32, 64, double, triple, euro (requires cfr input)

Ratecontrol:

  -B, --bitrate <integer>     Set bitrate (kbit/s)
      --crf <float>           Quality-based VBR (0-51) [23.0]
      --vbv-maxrate <integer> Max local bitrate (kbit/s) [0]
      --vbv-bufsize <integer> Set size of the VBV buffer (kbit) [0]
  -p, --pass <integer>        Enable multipass ratecontrol
                                  - 1: First pass, creates stats file
                                  - 2: Last pass, does not overwrite stats file

Input/Output:

  -o, --output <string>       Specify output file
      --sar width:height      Specify Sample Aspect Ratio
      --fps <float|rational>  Specify framerate
      --seek <integer>        First frame to encode
      --frames <integer>      Maximum number of frames to encode
      --level <string>        Specify level (as defined by Annex A)
      --quiet                 Quiet Mode

Filtering:

      --vf, --video-filter <filter0>/<filter1>/... Apply video filtering to the input file

      Filter options may be specified in <filter>:<option>=<value> format.

      Available filters:
      crop:left,top,right,bottom
      resize:[width,height][,sar][,fittobox][,csp][,method]
      select_every:step,offset1[,...]

#


EDIT 2 :Then I downloaded the 1.webp 01micko linked and tried his command:
Code:
# x264 -o zz.mkv 1.webp ; mplayer -frames 1 -vo jpeg:outdir=/root 1 zz.mkv
lavf [info]: 550x368p 0:1 @ 0/0 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
x264 [info]: profile High, level 2.2
x264 [info]: frame I:1     Avg QP:28.36  size: 22591                           
x264 [info]: mb I  I16..4: 31.2% 18.3% 50.6%
x264 [info]: 8x8 transform intra:18.3%
x264 [info]: coded y,uvDC,uvAC intra: 83.8% 85.8% 47.7%
x264 [info]: i16 v,h,dc,p:  6% 33% 43% 18%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 29% 27%  7%  7%  3%  9%  3%  8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 23% 28%  7%  6%  4%  7%  4% 11%
x264 [info]: i8c dc,h,v,p: 48% 39% 10%  2%
x264 [info]: kb/s:4518.20

encoded 1 frames, 28.11 fps, 4662.40 kb/s
Creating config file: /root/.mplayer/config
MPlayer SVN-r36362-snapshot-4.7.1 (C) 2000-2013 MPlayer Team

Playing 1.
File not found: '1'
Failed to open 1.


Playing zz.mkv.
libavformat version 55.12.100 (external)
Mismatching header version 55.13.102
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  550x368  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
Load subtitles in ./
jpeg: Progressive JPEG disabled.
jpeg: Baseline JPEG enabled.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 55.18.102 (external)
Mismatching header version 55.23.100
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0xb6d663f4]using unscaled yuv420p -> rgb24 special converter
VO: [jpeg] 550x368 => 550x368 RGB 24-bit
jpeg: /root - Output directory already exists and is writable.
V:   0.0   0/  0 ??% ??% ??,?% 0 0


Exiting... (End of file)
#


It created files 00000001.jpg (which was a jpg version of the original image - but with a skinny black strip down the RHS) and zz.mkv (which was just a black image)
00000001.jpg
 Description   
 Filesize   58.85 KB
 Viewed   48 Time(s)

00000001.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1849s ][ Queries: 13 (0.0188s) ][ GZIP on ]