skip to Main Content

Well, I’m using this project to create a Telegram bot which receives URL of .mp4 files, downloads them on server and uploads them to Telegram.

Issue

Everything works fine so far, except converting certain .mp4 files.

For example if I use a sample .mp4 video from https://sample-videos.com/. Then it works fine and converts it successfully.

But if I use a video from some random website which is also simple .mp4 file, it doesn’t work and throws this error:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1932420] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1932420] moov atom not found
data/720P_1500K_210306701.mp4: Invalid data found when processing input

2

Answers


  1. This really depends on the software that handles the upload.
    The moov atom is either located at the beginning, or at the end of the file.
    If the software only looks at the first part of the file, and the moov atom is at the end, it will not know how to deal with that file until the file upload is completed.

    What you could do, prior to uploading, is move the moov file to the start of the video, it’s more likely that the software only checks for the moov atom at the start of the file.
    With ffmpeg, the command is:

    ffmpeg -i input -c:v copy -c:a copy -movflags faststart output.mp4
    

    That would move it to the start of the file.
    You will need to do this for every video though.

    Login or Signup to reply.
  2. Try using ffprobe on the video. If you are having issues with the probe too.. It could be that it is corrupted.

    you can also try to do this before encoding

    ffmpeg -i input.mp4 -c copy input_first_clean_pass.mp4
    

    and then launch the command on input_first_clean_pass.mp4

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search