Play video and audio from ESP32!

Поделиться
HTML-код
  • Опубликовано: 14 июл 2024
  • As you know, due to the lack of resources on the ESP32, it is hard to play the video. However, if you separate the MJPEG image and audio AAC from the video, you can make it playable on ESP32.
    My project is based on a Mini Retro TV project that already works great. Based on this, I made it possible to change the channel of several video clips on the SD card using the touch screen.
    Timestamps
    0:00 - Intro
    1:00 - Mini Retro TV
    2:48 - Download Sample Videos
    2:59 - Make MJPEG, AAC FILE (FFMPEG)
    3:16 - Copy Files to SD Card
    4:08 - Added Touch Action
    4:57 - Organize Video Clips on SD Card
    5:07 - Lego Housing Case
    5:29 - All Done!
    [Mini Retro TV]
    www.instructables.com/Mini-Re...
    [FFMPEG]
    ffmpeg.org/
    //Video Encoding
    ffmpeg -i SampleVideo_640x360_10mb.mp4 -vf "fps=30,scale=-1:240:flags=lanczos,crop=288:in_h:(in_w-288)/2:0" -q:v 11 288_30fps.mjpeg
    //Aduio Encoding
    ffmpeg -i SampleVideo_640x360_10mb.mp4 -ar 44100 -ac 1 -ab 24k -filter:a loudnorm -filter:a "volume=5dB" 44100.aac
    [Sample Videos]
    sample-videos.com/
    [Project Github]
    github.com/0015/ThatProject/t...
    #VideoPlayer #MINITV #ESP32 #Lego #ThatProject
  • НаукаНаука

Комментарии • 50

  • @ThatProject
    @ThatProject  Год назад +1

    For more projects - ruclips.net/user/ThatProject
    That Project Github Repository - github.com/0015/ThatProject
    Join FB Group - facebook.com/groups/138965931539175

  • @TT-it9gg
    @TT-it9gg Год назад +1

    Just done the MJPEG+MP3.
    Nice to see you made MJPEG+AAC. Good job!

  • @surflaweb
    @surflaweb Год назад

    Amazing project. Excellent work. Keep it up!

  • @Charles-lt9rr
    @Charles-lt9rr Год назад

    Thanks very much my dear. You are great!!!

  • @teddykim1107
    @teddykim1107 Год назад

    Nice bro, I guess you might be Chinese aren't you? Your accent sounds like my friend. I am Korean and I have very strong Korean accent on my english too. By the way, your project looks awesome and I am amazed by your works with ESP32. It is hard to keep recording video with great quality of the projects. I would like to record my project but..... I found out doing project + video recording + editing are not easy taking time twice. Especially, your project is meaningful and your idea is really fresh. The completion level is also great. Nice job so far and I am looking forward seeing more project on this channel. Thanks.

  • @baldhead69
    @baldhead69 Год назад

    Good project. Are you using tearing support in this screen/project ?

    • @ThatProject
      @ThatProject  Год назад

      No, absolutely not. It doesn't have that kind of luxury function.

  • @jlcamry
    @jlcamry Год назад

    nice~funny TV

  • @jameszahary
    @jameszahary Год назад

    nice - i used lego to embed a video camera, and another set for the streaming "flippy-screen" - cheaper than a digital printer, and kids can build it into bigger projects.

  • @dynamight1124
    @dynamight1124 6 месяцев назад +1

    I love this, I am planning on a similar project however using a single button to change channel. I am no coding expert but can usually get things going with some tips! Looks like I need to change the 'touchTask' into something that relates to button presses, got any suggestions to set me in the right direction?

    • @ThatProject
      @ThatProject  6 месяцев назад

      How about adding a button interrupt?

  • @randoarchive
    @randoarchive 9 месяцев назад

    At the end of your video, you do a demo of the final result. Many of the videos have visible glitching. Is this due to screen tearing? A mismatch in refresh rate? Or is it struggling to keep up with the frame rate?

    • @ThatProject
      @ThatProject  9 месяцев назад +2

      ESP32 doesn't have a codec to play a media file. So it's decoding with software to play both video and audio at the same. This is a pretty heavy task on ESP32. Glitches may occur because the entire screen cannot be redrawn within a certain time.

  • @TucksProjects
    @TucksProjects 10 месяцев назад

    Did you make the pcb with the MINI TV text on it? Or is it possible to buy that?

    • @ThatProject
      @ThatProject  10 месяцев назад

      This was a just prototype. You need to make it by yourself with the small display.

  • @creativemario3039
    @creativemario3039 Год назад +1

    I always program with the arduino ide
    I don't know how to program on
    visual studio code
    do you have a tutorial on how to
    Or a video from an another channel ?

    • @ThatProject
      @ThatProject  Год назад +1

      This project was done with Arduino IDE. Are you talking about ESP-IDF? It's tricky but worth learning. Looking at examples is very helpful. I don't have a tutorial on that yet. I'll try to make it if I have a chance. Thanks.

  • @digital945
    @digital945 Год назад

    if there a remote with basic keys it would awsome hope you will ad it for your viewers... dont forget everyone have a kid inside😁

  • @rinderkn
    @rinderkn 9 месяцев назад

    Nice work. Would this also work with a RP2040 microcontroller?

    • @ThatProject
      @ThatProject  9 месяцев назад

      Unfortunately, it won't work in RP2040 with my code. You need to change the code for it.

  • @Elshan_Mammadov_
    @Elshan_Mammadov_ 5 месяцев назад

    Nice project. I will do such a project too. So, can we add the channels we want to the device?

    • @ThatProject
      @ThatProject  5 месяцев назад

      What do you mean by "add channels"? In this project, I just showed the channel number to determine which file is selected from SD card. Is that what you think?

    • @Elshan_Mammadov_
      @Elshan_Mammadov_ 5 месяцев назад

      @@ThatProject I mean, for example, I want to add a television channel. For example, is it possible to add the CNN news channel?

    • @ThatProject
      @ThatProject  5 месяцев назад

      @@Elshan_Mammadov_ Do you mean in real-time?
      Then it is impossible. Currently, the task of separating the image and audio cannot be performed inside the ESP32, so you must first separate the image data and audio data from the original video.

    • @Elshan_Mammadov_
      @Elshan_Mammadov_ 5 месяцев назад

      @@ThatProject I understand. Thank you for the information.

  • @mylaughingtv
    @mylaughingtv Год назад

    Hi, Can connect setup box output to esp32 as input and see all video on webserver?

    • @ThatProject
      @ThatProject  Год назад

      The small size of video files might be possible, but at the moment I have no idea how to configure the system for it. I'll try it if I have a good idea.

  • @randoarchive
    @randoarchive 9 месяцев назад

    At 1:51 , you say we need something running at 80Mhz, but I can't quite understand what it is you're mentioning. Could you clarify that part please? EDIT: I used AI to create subtitles, and it says you said "A display that operates at 80Mhz". I don't know if that's accurate, but I do know that I can't find any specs on any display that shows its Mhz. At best, Hz, but usually its speed is measured in ms. I guess I'm barking up the wrong tree?

    • @ThatProject
      @ThatProject  9 месяцев назад +2

      The 80Mhz is the maximum speed of the APB Clock of ESP32. Also, it can be the maximum speed of the SPI interface if the display IC supports it.

    • @randoarchive
      @randoarchive 9 месяцев назад

      Thank you@@ThatProject

  • @junhaozhang533
    @junhaozhang533 Год назад

    is that possible to run on esp8266? with mjpeg only?

    • @ThatProject
      @ThatProject  Год назад

      I don't think so. The base project mentions only ESP32 not ESP8266 so not sure about it.

  • @davisje011
    @davisje011 6 месяцев назад

    trying to get this to loop a video, but it keeps restarting even though I removed the command from the controller.
    I know it has something to do with clearing the buffers, But I cant get them to work.

    • @ThatProject
      @ThatProject  5 месяцев назад

      What display are you using? Try using only 50% of your current screen size. As you said, it seems like it's not emptying all the buffers in time.

    • @davisje011
      @davisje011 5 месяцев назад

      @ThatProject 2" st7789. I'm currently running a single core code right now, but like the smoothness of dual core.
      I'm using them for props, the videos need to loop seamlessly unless an interrupt to change files happens.
      In the code I'm using, the originator added free(_mjpeg_Buf);
      At the end of the video, it allows it to loop without crashing.
      I just don't know how to do that for the dual core, because I would think it would need to free 2 buffers, correct? NULL doesn't work.

    • @ThatProject
      @ThatProject  5 месяцев назад

      @@davisje011 The use of 2 cores is to reduce bottlenecks and increase FPS by separating the decoding and drawing parts of the image when drawing the screen.
      I also had a similar problem, and in the end, when one file was finished playing, I had to set it to the next file name and then reset it to play the next video. In order to make it without restarting, you will need to clear everything allocated to memory at the end of the video and reset both the video and audio tasks. I don't know how effective this will be.

    • @dutchflyingpilot
      @dutchflyingpilot 27 дней назад

      Mine works. No restarts! I've created a void and run the code from there. At the end of the video the void returns to the main loop where it gets called again.
      Make sure to initialize the sd card-reader inside the void again otherwise it will crash and resets.
      Also add a small delay (2000 or so) before the video closes. It compensates for a a/v length-difference and thus avoiding a crash. Usefull for longer clips.

  • @maicon7777777
    @maicon7777777 8 месяцев назад

    Would be nice if has an A/V or HDMI connection 😅

  • @miniaturascastillo-minic6564
    @miniaturascastillo-minic6564 3 месяца назад

    EL PROYECTO SE PUEDE HACER CON TTGO - T - DISPLAY ????

    • @ThatProject
      @ThatProject  3 месяца назад

      There is a high possibility that it will not work because TTGO T Display does not have PSRAM.

    • @dutchflyingpilot
      @dutchflyingpilot 27 дней назад

      Works perfect on a TTGO S3 Display,. Make sure to use the Arduino_ESP32LCD8 databus driver, together with the Arduino_st7789 GFX driver.
      Define all LCD pins (according to the data bus), the Pin_POWER (15) and BUTTON pins (0 and 14).
      Do not forget to power on the display in Setup (PIN_POWER_ON)
      Connect your SD card reader to pins 10 (CS), 11 (MISO), 12 (CLK), 13 (MOSI)

    • @ThatProject
      @ThatProject  27 дней назад

      @@dutchflyingpilot Good to know! Thank you!

  • @aleksandr2394
    @aleksandr2394 Год назад

    Cute project. Where can I find the ctp 1.69 lcd module like that from your video?

    • @ThatProject
      @ThatProject  Год назад

      Check this one. www.alibaba.com/product-detail/Optional-Capacitive-Touch-Panel-Smart-Watch_1600283882399.html

  • @jasonnation6615
    @jasonnation6615 9 месяцев назад

    I would pay you to make me one of those.

  • @Ipsissimus
    @Ipsissimus 8 месяцев назад

    I can't understand you well bro. :(

  • @Marques330
    @Marques330 9 месяцев назад

    What is the exact name of the lcd display you have in the video, could you provide me with a link if possible? Thank you

    • @ThatProject
      @ThatProject  9 месяцев назад

      I'm not sure because it's been so long. I'll let you know when I find out.

  • @agrominigps
    @agrominigps 11 месяцев назад +1

    Hello! fails to compile :(
    log file:
    drive.google.com/file/d/1gL1YQ0BjoKZwliLLDg1qTCOJHMYiHpr1/view?usp=sharing
    I used: ESP32 by Espressif Systems 2.0.11 installed
    Please upload libraries to google drive