freeswitch / spandsp

SpanDSP is a low-level signal processing library that modulates and demodulates signals commonly used in telephony, such as the "noise" generated by a fax modem or DTMF touchpad.
Other
144 stars 118 forks source link

faxing with T.85 compression cuts bottom #25

Open char11 opened 3 years ago

char11 commented 3 years ago

Faxing from freeswitch to freeswitch with ECM on and T.85 L0 compression cuts bottom. With T.6 or ECM off and T.4 everything is ok. fax00000073.pdf fax00000074.pdf

coppice-git commented 3 years ago

Neither of those PDF files look quite right. There seems to be one pixel row missing from the longer one, and one character row missing from the shorter one. If there is a problem in spandsp it must be provoked by something specific in this particular image, as most pages transfer accurately. Can I get a source image file and the related received files using the different compression schemes?

char11 commented 2 years ago

This is the original. a4_p.pdf

coppice-git commented 2 years ago

The problem with fax00000073.pdf lacking the last pixel row is also present in a4_p.pdf, so it seems we can ignore that. \

If I extract the TIFF images from fax00000073.pdf and fax00000074.pdf they are not sendable as FAXes, because their resolution is set to 72dpi by 72dpi for some reason. If I edit the files to have a proper FAX resolution I can send the images between 2 instances of spandsp, using T.85 L0 compression, and the result looks OK. I tried this with an audio connection and with a T.38 connection. I did not use Freeswitch. I did the tests using my testbench for spandsp. I wonder if something in Freeswitch causes the file to be closed before the last part is written when T.85 L0 is used?

akihirobessy commented 2 years ago

Hi char11,

I'm facing the issue same as you now. When I set the ECM as true and send a fax from freeswitch via spandsp, on receive side the bottom of docs is cut by about 3 to 4 mm. I use T.30-fax, G711ulaw, fax_use_ecm as true, and create tiff from pdf by gs command with option -r204x98 -dNOPAUSE -dBATCH -dSAFER -dPDFFitPage -sDEVICE=tiffg3.

Could you please tell me your solution after that if you had already resolved?