0

Currently i am creating a website where users can upload videos and play them back . The video upload method works fine , the problem is i am trying to create a thumbnail for each video . Instead of representing videos in "< a > " tags i want them to be a picture that a user can click on and then go to another page to play the video . I am trying to create unique thumbnails for each video on upload using ffmpeg . The problem is i get that an error reading header "filename" : Invalid data found when processing input. Any reason behind this ? I am currently running on my localhost. NOTE : The ffmpeg command is working fine on its own .
NOTE : Environment is : Win10 64 , django 1.10 (python 2.7) ffmpeg is the latest version

3
  • Please show the actual command that you are trying to run (not just the Python code), and the full command-line output from ffmpeg.
    – slhck
    Commented Aug 6, 2018 at 12:40
  • MY COMMAND:subprocess.call("ffmpeg -i "+ uploaded_filename +' -vf "thumbnail,scale=1080:1080" -frames:v 1 '+ thumbnail_name ,shell=True) OUTPUT: libavutil 56. 12.100 / 56. 12.100 libavcodec 58. 15.100 / 58. 15.100 libavformat 58. 10.100 / 58. 10.100 libavdevice 58. 2.100 / 58. 2.100 libavfilter 7. 13.100 / 7. 13.100 libswscale 5. 0.102 / 5. 0.102 libswresample 3. 0.101 / 3. 0.101 libpostproc 55. 0.100 / 55. 0.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0000017cd729a480] error reading header output002.mp4: Invalid data found when processing input Commented Aug 6, 2018 at 14:45
  • Please don't use commands but edit your question to include that information. And please show the entire output from your call – what is the output of the ffmpeg command that “is working fine on its own”? Could it be that you are running a different version of ffmpeg from Python?
    – slhck
    Commented Aug 6, 2018 at 16:13

1 Answer 1

0

I ended up changing my method to capture a thumbnail by seeking a specific duration into my video,then capturing the frame's photo using this command
subprocess.call("ffmpeg -ss 00:0:01 -i "+ uploaded_filename +" -frames:v 1 "+ thumbnail_name ,shell=True)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .