Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey guys, need a hand here. So I've been seeing that there's a lot of issue with parsing the output that ffmpeg gives out depending on the version. Already got it to tell me which codecs it supports by updating to the .dev version because everything was a no.
however when I try encoding a test file, I get this error (even though it's supported by ffmpeg)
The file could not be transcoded because the video codec is not supported
Command: /usr/local/bin/ffmpeg -i "/tmp/test_1.mp4" -v -1
Not sure what the issue is - gonna paste my ffmpeg info here.
ffmpeg N-31267-g4e59c8e libavutil 51. 11. 0 / 51. 11. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 5. 0 / 53. 5. 0 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 24. 3 / 2. 24. 3 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 ffmpeg version N-31267-g4e59c8e, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 6 2011 16:33:59 with gcc 4.4.3 configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab libavutil 51. 11. 0 / 51. 11. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 5. 0 / 53. 5. 0 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 24. 3 / 2. 24. 3 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0
Attached is a dump of ffmpeg -formats
Running ubuntu
Comment | File | Size | Author |
---|---|---|---|
#18 | ffmpeg_wrapper_class-codec-exception-1215400-18.patch | 727 bytes | osopolar |
#16 | ffmpeg_wrapper_class-codec-exception-1215400-16.patch | 732 bytes | osopolar |
#4 | ffmpeg_codecs.png | 573.47 KB | antoniotorres |
#1 | formats.txt | 7.79 KB | antoniotorres |
Comments
Comment #1
antoniotorres CreditAttribution: antoniotorres commentedAck, forgot the file.
Comment #2
antoniotorres CreditAttribution: antoniotorres commentedI don't mind downgrading to another version of ffmpeg or whatever, just trying to get this thing to encode mov's and avi's :)
Comment #3
arthurf CreditAttribution: arthurf commentedwhat does admin/config/ffmpeg_wrapper say about your installed codecs?
Comment #4
antoniotorres CreditAttribution: antoniotorres commentedHere
Comment #5
antoniotorres CreditAttribution: antoniotorres commentedis that what you needed?
Comment #6
arthurf CreditAttribution: arthurf commentedCan you try running the conversion you want to do on the command line and see if it works? Something like:
/usr/local/bin/ffmpeg -i "/tmp/test_1.mp4" test.flv
Comment #7
antoniotorres CreditAttribution: antoniotorres commentedIt Worked
Comment #8
ronin17 CreditAttribution: ronin17 commentedI'm having the same issue.
Using ffmpeg from the command line works perfectly fine, but ffmpeg_wrapper keeps giving me the "The file could not be transcoded because the video codec is not supported" error.
I'm using ffmpeg version N-31422-g45ecc7a.
Comment #9
arthurf CreditAttribution: arthurf commented@ronin17 are codecs showing in admin/config/ffmpeg_wrapper?
Comment #10
antoniotorres CreditAttribution: antoniotorres commentedany word on my encoding results?
Thanks infinitely for any assistance you can provide. I can pay for your time if you help me figure this out as well.
Comment #11
antoniotorres CreditAttribution: antoniotorres commentedTested latest dev version, no dice still.
Comment #12
arthurf CreditAttribution: arthurf commentedTry setting can_decode_file() to return TRUE. If that works then it is likely an issue with how the codecs are being detected.
Comment #13
antoniotorres CreditAttribution: antoniotorres commentedyeah it works. any way I can help patch this?
Comment #14
arthurf CreditAttribution: arthurf commentedI think I may have tracked this down to a change that I made to how ffmpeg reports back "not available". The function was checking for 'na' instead of 'N/A' which is the new way that ffmpeg returns data. Please give the dev version a try again.
Comment #15
osopolarThe interesting line is:
Stream #0.1(eng): Video: h264 (High), yuv420p, 720x480 [PAR 8:9 DAR 4:3], 2535 kb/s, 29.97 fps, 29.97 tbr, 1001 tbn, 59.94 tbc
The function get_file_data($filepath) will determine a codec called "h264 (High)". But in the codec list from get_formats() will be only a codec called "h264".
I have the same problem with the codec "h264 (Main)" in my local machine (using Mac ports, ffmpeg version 0.7.1). I thought about adding the following to get_file_data():
How much exceptions will there be? How many surprises will ffmpeg have for us? I guess I need to dive in the ffmpeg documentation.
Another way would be to fix the regex to only read the first word, because in the codec list aren't codecs with spaces.
Comment #16
osopolarAdded the patch for the quick workaround.
I think the best is to modify the regex, to just take the first word as codec. I saw codecs with letters and digits and underscore but nothing else, not hyphen and no space in the name.
Comment #17
osopolarComment #18
osopolarThere are a lot of different h264 profiles: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles. Recently I got "h264 (Constrained Baseline)". Let's fix this with an regex. But I don't kow, which one to touch.
If this applies to all of them, maybe use this:
Comment #19
arthurf CreditAttribution: arthurf commented@osopolar yes I've seen this as well on recent versions of ffmpeg and accompanying libraries. I'm not sure if it is safe to assume that the text in the parentheses is safe to ignore, but I don't know if there is another choice.
I think your patch is a good idea but I think it needs to be moved up into the main if/else statement because otherwise $ffmpeg->errors is still going to be set.
Comment #20
osopolarThe codec is detected well, but it is named "h264 (Main)" instead of just "h264". Later we the module is comparing the name of the video codec with the codec list of ffmpeg and won't find it.
I guess there should be something written in the ffmpeg specifications, but currently I don't have time to research.
Comment #21
mfbTracking
Comment #22
vivek1989 CreditAttribution: vivek1989 commentedhow to convert wmv file