Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blurred stripe effect #4

Open
hvuitsme opened this issue Oct 19, 2024 · 18 comments
Open

blurred stripe effect #4

hvuitsme opened this issue Oct 19, 2024 · 18 comments

Comments

@hvuitsme
Copy link

hvuitsme commented Oct 19, 2024

I don't know what caused the stripes on my screen (about 20% of the screen) and I don't know if it's because of my configuration or not, but every video has the same problem. Currently, there is an error in the MJPEG_JPEGDEC project:

/*******************************************************************************

  • Start of Arduino_GFX setting
  • Arduino_GFX try to find the settings depends on selected board in Arduino IDE
  • Or you can define the display dev kit not in the board list
  • Defalult pin list for non display dev kit:
  • ESP32 various dev board : CS: 5, DC: 27, RST: 33, BL: 22, SCK: 18, MOSI: 23, MISO: nil
  • ESP32-C3 various dev board : CS: 7, DC: 2, RST: 1, BL: 3, SCK: 4, MOSI: 6, MISO: nil
  • ESP32-S2 various dev board : CS: 34, DC: 38, RST: 33, BL: 21, SCK: 36, MOSI: 35, MISO: nil
  • ESP32-S3 various dev board : CS: 40, DC: 41, RST: 42, BL: 48, SCK: 36, MOSI: 35, MISO: nil
    ******************************************************************************/
    #include <Arduino_GFX_Library.h>

// #define GFX_BL DF_GFX_BL // default backlight pin, you may replace DF_GFX_BL to actual backlight pin
#define GFX_BL 48

/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX gfx = create_default_Arduino_GFX();
#else /
!defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus *bus = create_default_Arduino_DataBus();

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
// Arduino_GFX gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 3 / rotation /, false / IPS */);
Arduino_GFX gfx = new Arduino_ST7789(bus, 42 / RST /, 2 / rotation /, true / IPS /, 170, 320, 35, 0, 35, 0);
#endif /
!defined(DISPLAY_DEV_KIT) */
// #define GFX_SPEED 32000000UL
#define GFX_SPEED 80000000UL

// I2C
#define I2C_SDA 18
#define I2C_SCL 8
#define I2C_FREQ 800000UL
// #define I2C_FREQ 400000UL

#define SD_SCK 12
#define SD_MOSI 11 // cmd
#define SD_MISO 13 // d0
#define SD_D1 14
#define SD_D2 9
#define SD_CS 10 // d3

// I2S
#define I2S_DEFAULT_GAIN_LEVEL 0.5
#define I2S_OUTPUT_NUM I2S_NUM_0
#define I2S_MCLK -1
#define I2S_BCLK 16
#define I2S_LRCK 2
#define I2S_DOUT 17
#define I2S_DIN -1

// SPI.begin(12 /* CLK /, 13 / D0/MISO /, 11 / CMD/MOSI /);
// if (!SD.begin(10 /
CS */, SPI, 80000000L, ROOT))

IMG_20241019_135854

@moononournation
Copy link
Owner

I think because 170 not divisible by 4. You may try 168 instead.

@hvuitsme
Copy link
Author

hvuitsme commented Oct 19, 2024

I think because 170 not divisible by 4. You may try 168 instead.

i tried with changing width to 172 and it is also multiple of 4, but the problem is still not fixed, similar to 168

-168x320:

Arduino_GFX gfx = new Arduino_ST7789(bus, 42 / RST /, 0 / rotation /, true / IPS */, 168, 320, 35, 0, 35, 0);

ffmpeg -y -i nino.mp4 -ac 2 -ar 44100 -af loudnorm -c:a mp3 -c:v mjpeg -q:v 7 -vf "fps=30,scale=-1:320:flags=lanczos,crop=168:in_h:(in_w-168)/2:0" nino_30fps_mjpeg.avi

IMG_20241019_155351

-172x320:

Arduino_GFX gfx = new Arduino_ST7789(bus, 42 / RST /, 0 / rotation /, true / IPS */, 172, 320, 35, 0, 35, 0);

ffmpeg -y -i nino.mp4 -ac 2 -ar 44100 -af loudnorm -c:a mp3 -c:v mjpeg -q:v 7 -vf "fps=30,scale=-1:320:flags=lanczos,crop=172:in_h:(in_w-172)/2:0" nino_30fps_mjpeg.avi

IMG_20241019_161842

@moononournation
Copy link
Owner

No idea, can you also try 160?

@hvuitsme
Copy link
Author

hvuitsme commented Oct 19, 2024

No idea, can you also try 160?

-160x320:

Arduino_GFX gfx = new Arduino_ST7789(bus, 42 / RST /, 0 / rotation /, true / IPS */, 160, 320, 35, 0, 35, 0);

ffmpeg -y -i nino.mp4 -ac 2 -ar 44100 -af loudnorm -c:a mp3 -c:v mjpeg -q:v 7 -vf "fps=30,scale=-1:320:flags=lanczos,crop=160:in_h:(in_w-160)/2:0" nino_30fps_mjpeg.avi

IMG_20241019_222417

actually mjpeg doesn't need the size to be a multiple of 4, cinepak does, but I tried with 160 as above, it shows that MJPEG_JPEGDEC is really having a problem

@hvuitsme
Copy link
Author

hvuitsme commented Nov 1, 2024

Is this problem solved? @moononournation

@moononournation
Copy link
Owner

moononournation commented Nov 2, 2024

just make a quick test without any problems:

https://youtu.be/8FvUHyNDvdo?si=b2-n3f9uQAglc2TK

@moononournation
Copy link
Owner

no problems even 320x170:

https://youtube.com/shorts/XSSRo25HxVA

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

no problems even 320x170:

https://youtube.com/shorts/XSSRo25HxVA

I'm not sure what the cause is, maybe my arduino lastest ver.

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

Also I tried again with many different types of esp32 s3 circuits but the results were the same with MJPEG_JPEGDEC

@moononournation
Copy link
Owner

aviplayer is using ESP32_JPEG library

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

aviplayer is using ESP32_JPEG library

sorry I entered the word AVI wrong

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

Up to now you said there is no problem on your side but I have done everything but the screen is still the same (using cinepak the screen is still normal without that problem)

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

I also tried again with the following line and still couldn't fix it.

ffmpeg -y -i nino.mp4 -ab 32k -ac 2 -ar 44100 -af loudnorm -c:a mp3 -c:v mjpeg -q:v 9 -vf "fps=30,scale=320:-1:flags=lanczos,crop=320:170:0:(in_h-172)/2" nino_30fps_mjpeg.avi

https://github.com/hvuitsme/AviMjpeg_JPEGDEC

@moononournation
Copy link
Owner

yes, I did not had this problems. please get update and try the avimjpeg example.

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

yes, I did not had this problems. please get update and try the avimjpeg example.

I feel a bit sad that it can be used for long videos but it has an error that cannot be fixed =((

@moononournation
Copy link
Owner

no error indeed

@hvuitsme
Copy link
Author

hvuitsme commented Nov 3, 2024

no error indeed

I'm not talking about your side, but my side, for some unknown reason.
That AVI JPEGDEC I need to run long duration video

@hvuitsme
Copy link
Author

I currently test the current MJPEG_JPEGDEC project and it shows that for horizontal orientation there is no such problem (only for vertical orientation there is such problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants