Im getting error “deprecated pixel format used, make sure you did set range correctly using ffmpeg”.. can someone check my code below?

前端 未结 2 938
闹比i
闹比i 2020-12-17 09:49

This is my code using ffmpeg i want to have video thumbnail but im not familiar in ffmpeg can someone know the error i got.

[swscaler @ 0x7ff8da028c00] depre         


        
相关标签:
2条回答
  • 2020-12-17 10:04

    I just change the path of the destination of the image:

    # path of image on the server
    $image = '/users/xx/xxxx/sample/upload/image.jpg'; 
    

    Then used the following:

    # $ffmpeg - path of ffmpeg on the server
    # $video_url - path of the video file on the server
    
    shell_exec($tmp = "$ffmpeg -i $video_url -pix_fmt yuvj422p -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&1");  
    
    0 讨论(0)
  • 2020-12-17 10:25

    According to ffmpeg forum this can be ignored when called from the command line and i always ignored it. One thing you can try (test with a dummy file PLEASE) is to add -pix_fmt yuvj422p to your last line so it look like this:

    shell_exec($tmp = "$ffmpeg -i $video_url -pix_fmt yuvj422p -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&1");
    

    As i said, test it please as i cannot guaratee the results but as far as i'm concerned i'Ve used ffmpeg thousand of times and everything looks just fine even with the warning.

    https://lists.ffmpeg.org/pipermail/ffmpeg-user/2014-February/020151.html

    Afaict, the warning is primarily meant for library users, ffmpeg users should not be affected.

    OK, will just ignore it then.

    0 讨论(0)
提交回复
热议问题