[FFmpeg-user] PGM to JPEG-LS identify error

Sebastian Wieseler Sebastian.Wieseler at hft-leipzig.de
Tue Jul 5 03:38:35 CEST 2011


Hello!

Quoting James Darnley <james.darnley at gmail.com>:

> On 29/06/2011, Sebastian Wieseler <Sebastian.Wieseler at hft-leipzig.de> wrote:
>> $ ffmpeg -f image2 -vcodec pgm -pix_fmt gray16be -i barbara-pgm.pgm -f
>> image2
>> -vcodec jpegls -pix_fmt gray16le barbara-ffmpeg-tojpegls.jls
>
> What does ffmpeg say when you do this?

Okay. Yesterday I tried something with the latest git-HEAD:

sebastian at sebastian-desktop:~/Documents$ ffmpeg -f image2 -vcodec pgm -i
barbara-pgm.pgm -f image2 -pix_fmt gray16le -vcodec jpegls
barbara-from_pgm_to_jls.jls
ffmpeg version 0.7, Copyright (c) 2000-2011 the FFmpeg developers

    built on Jul 4 2011 10:40:30 with gcc 4.4.3
    configuration:
    libavutil 51. 11. 0 / 51. 11. 0
    libavcodec 53. 7. 0 / 53. 7. 0
    libavformat 53. 5. 0 / 53. 5. 0
    libavdevice 53. 2. 0 / 53. 2. 0
    libavfilter 2. 24. 1 / 2. 24. 1
    libswscale 2. 0. 0 / 2. 0. 0

Input #0, image2, from 'barbara-pgm.pgm':

    Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

        Stream #0.0: Video: pgm, gray, 720x576, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x984c4a0] w:720 h:576 pixfmt:gray tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x984bde0] auto-inserting filter 'auto-inserted scaler 0' 
between
the filter 'src' and the filter 'out'
[scale @ 0x984d0c0] w:720 h:576 fmt:gray -> w:720 h:576 fmt:gray16le flags:0x4
Output #0, image2, to 'barbara-from_pgm_to_jls.jls':

    Metadata:

        encoder : Lavf53.5.0
        Stream #0.0: Video: jpegls, gray16le, 720x576, q=2-31, 200 kb/s, 90k
tbn, 25 tbc

Stream mapping:

    Stream #0.0 -> #0.0

Press [q] to stop, ? for help
frame= 1 fps= 0 q=0.0 Lsize= -0kB time=00:00:00.04 bitrate= -4.4kbits/s
video:660kB audio:0kB global headers:0kB muxing overhead -100.003254%

>> $ file barbara-compressed.pgm
>> barbara-compressed.pgm: data
>
> Isn't this another pgm?

No sorry. It is another JPEG-LS file - "compressed". Sorry, the 
extension isn't
clear enough - it's JEPG-LS.

>> I also played around with "gray16be" and "gray16le" but this doesn't work
>> out.
>
> Why are you using this at all when your other programs said it was 8 bit?

So should I use gray8a instead?
Incompatible pixel format 'gray8a' for codec 'jpegls', auto-selecting format
'bgr24'
And this does not work either!

>
>> FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.1, Copyright (c) 2000-2009
>
> Have you tried a newer version?

Yesterday, git-HEAD, yes.


Do be more verbose:
I have an university project with a JPEG-LS implementation (en/decrypt) 
which is
only able to work with gray (pgm) images currently.
So I tried to interchange with ffmpeg, but it seems incompatible at 
all. Encode
a pgm to jpeg-ls with ffmpeg and tried to decode it back with my source code
from university, it failed all the time.

So my current tasks was actually, to implement color images (ppm), but 
I do not
know how. ;(

So is this actually a ffmpeg bug, or simply the "they do not work together"
note? :/


The output from my university project:
sebastian at sebastian-desktop:~/Documents$ JPEG-LS2fast/d_locom -i
barbara-from_pgm_to_jls.jls -o barbara-from_jls_to_pgm.pgm

Decoding, image decoder JPEG-LS v05/2001

        Input (d_JPEG-LS): barbara-from_pgm_to_jls.jls
        Output (d_JPEG-LS): barbara-from_jls_to_pgm.pgm
        **Not a JPEG-LSm-Stream!**

         T1=127, T2=224, T3=776  LIMIT=31511691  RESET=1040
Dauer  0.000 Sekunden
ready.






More information about the ffmpeg-user mailing list