OK - I have compiled and installed a brand-spanking new FFMPEG to try to get mp4 encoding to work (FLV seems OK). Thumbnails aren't generated on upload (as they are with FLV) and here's the output I get - it looks like a file error as opposed to transcoding. Here we go:
Video conversion failed for preset html5_mp4. FFMPEG reported the following output: FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers built on Dec 6 2010 15:08:39 with gcc 4.0.1 (Apple Computer, Inc. build 5370) configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --enable-nonfree --mandir=/opt/local/share/man --enable-shared --enable-pthreads --disable-indevs --cc=/usr/bin/gcc-4.0 --arch=ppc libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.19. 0 / 1.19. 0 libswscale 1.11. 0 / 1.11. 0 libpostproc 51. 2. 0 / 51. 2. 0 Seems stream 0 codec frame rate differs from container frame rate: 5994.00 (5994/1) -> 29.97 (2997/100) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sites/default/files/videos/original/[video].mov': Duration: 00:00:31.46, start: 0.000000, bitrate: 9879 kb/s Stream #0.0(eng): Video: h264, yuv420p, 640x480, 8341 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc Stream #0.1(eng): Audio: pcm_s16be, 48000 Hz, 2 channels, s16, 1536 kb/s File 'sites/default/files/videos/converted/[video].mp4' already exists. Overwrite ? [y/N] Not overwriting - exiting
Again, this looks like a file thing. Any ideas? Thanks! (We will get this bad boy working!)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ffmpeg watchdog.txt | 20.9 KB | zuzu83 |
Comments
Comment #1
hypertext200Upload a new files and see, it should work.
Comment #2
bcobin commentedUsing the same dev (no reinstall) - same behavior. I see the dev is still dated 12/5 - have you changed it? Should I reinstall? Thanks!
Comment #3
hypertext200There is no any new updates to works it on with the presets. What you need to do is check the watchdog, and you will need to install proper FFMPEG version with its libs. First try to run in command line then you can see how its working, afterthat you can add the command in to the preset by creating new or editing existing one.
Read more about presets http://video.heidisoft.com/content/whats-new-video-module-6x-42-alpha2
Comment #4
bcobin commentedThanks, heshan - in this case, though, it doesn't look like there's a transcoding issue; the error looks like it has to do with overwriting an mp4 file:
I'm also unsure about enabling multiple presets, either - but I'll experiment more here and start with one.
I'll try encoding via command line tomorrow and see if I can track this down further; thanks for your help!
Comment #5
zuzu83 commentedhello,
I had the same problem, I modified the command in the preset file and it was resolved.
Now I have another problem:
The file-conversion begins "I see in /tmp"
-Then he disappears and no file Mp4
The watchdog says "sh: / tmp/testone06122010-14-55.mp4: Permission denied"
The version before "Alpha2 worked well"
I use FileField FileFieldPath "FileField Paths failed to move file (sites/default/files/testone06122010-11-25.wmv) to (media/2010/95/95-testone06122010-11-25.wmv)."
Comment #6
hypertext200@charlie836, I think that because of we are moving file from original location.
Comment #7
zuzu83 commentedI use filefieldpath to move my files, but once converted the video with the PRESET MP4, it gives me an error and the converted MP4 file disappeared.
Comment #8
zuzu83 commentedNew bug
PRESET COMMAND
and
Filefieldpath error
I watched the file during conversion to MP4 it was well placed in the /tmp and once completed the file has disappeared and is no longer in any case
Comment #9
bcobin commented@charlie836: I think this is actually would be a separate issue: "Video problem with FileField Paths" - I'd open up a separate thread to help keep track of it, but that's just me. I'm therefore reopening the issue, if you don't mind, heshan - there's a lot more going on here, as you'll see.
Getting back to the original topic, I invoked the preset5_mp4 command via command line - here's the issue:
The command uses two-pass encoding, so ffmpeg needs permission to overwrite the mp4 file generated after the first pass in order to generate the final output file. If you run the command manually, all you need to do is hit "y" at the prompt and ffmpeg will complete the transcription successfully.
AFAIK, the module needs to deal with this, or two-pass encoding won't work.
Digging around, I was able to figure out how to modify the FFMPEG command so that it doesn't require the overwrite file confirmation:
Pass 1: ffmpeg -y -i [video_source] -an -pass 1 -vcodec libx264 -vpre slow_firstpass -b 500k -threads 0 -f mp4 /dev/null
Pass 2: ffmpeg -y -i [video_source] -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -vpre slow -b 500k -threads 0 -f mp4 [output_file.mp4]
Via command line, this works great - I generated a 1.9mb output file from 19.5mb h264 mov source... and the results are spectacular. Yowsa!
There's another issue here, though: the two-pass encoding generates a .log and a .log.mbtree on each pass, which the Drupal process doesn't seem to allow. FFMPEG fails with the error message "Cannot read file 'ffmpeg2pass.log': No such file or directory Error reading log file 'ffmpeg2pass.log' for pass-2 encoding"
That's one part of it. The other part is that once the log file generation issue can be solved, you still have all those files hanging around after transcoding - you'd want to delete them. Digging around further, I think there may be a relatively simple solution here:
http://e-mats.org/2009/10/supporting-2-pass-parallel-encoding-with-x264-...
So to sum up, there needs to be a three-step solution to two-pass encoding:
1. Modification of the command as described above
2. Allow generation of the required .log files in the right (temporary) directory
3. Cleanup of the log files afterwards
In the meantime, I'm using '!cmd_path -i !videofile -acodec libfaac -ab 96k -vcodec libx264 -vpre slow -crf 22 -threads 0 !convertfile' in the preset and it seems to work OK.
IMO, getting two-pass encoding to work would be well worth it - the results are excellent. Hope this helps!
UPDATE: Got the above command to work once; I now get a "sites/default/files/temp/[video].mp4: Permission denied" error and mp4 transcoding fails. I don't know why there's a permissions problem; all folders are writable. So I guess it's back to Flash... ugh.
Comment #10
bcobin commentedUsing one-pass mp4 encoding with latest (12/05) dev build fails with "sh: line 1: sites/default/files/temp/[video].mp4: Permission denied" error. One-pass mp4 encoding with 12/04 dev build is OK.
I'm currently working on two new sites; when one site worked and the other didn't, I was able to track this down to the module version.
Summary (as of 12/08):
• It looks like a change that was introduced between the latest and previous dev builds breaks mp4 encoding.
• Two-pass mp4 encoding fails in any event - modified (one-pass) preset in above post seems to work.
Comment #11
bcobin commentedRe: comment #8: I get the same result in the latest dev (12/11) without filefield paths - the video seems to convert successfully in the files/temp folder and when the module tries to move the converted video into the /files/videos/converted folder, the process fails with a "Permission denied" error in the log. This is with one-pass mp4 encoding as described in #9; with two-pass encoding, the process fails almost immediately with a similar error.
This looks like a permissions issue, although I've tried setting permissions wide open on the folders in question. Any ideas?
Comment #12
zuzu83 commentedI have the same problem ... I have not found a solution yet
Comment #13
killer_tilapia commentedThe solution for me lies in the video_presents.
In my setup the flash present would fail to convert. Like this one:
Now, mucking through the hq_flash.inc file, which is the presents file, I found the command line:
Apparently, ffmpeg doesn't like the options. So, I changed it to something I know that works:
The "-y" options allows for overwrites and I defaulted the rest of options. The ffmpeg manual is a lot of help here.
It works fine now.
I am using Turnkey Drupal.
Comment #14
bcobin commentedIn my case, Flash hasn't been the problem; I similarly changed the preset to one-pass encoding and it worked fine. (As you'll see in the initial post, I mention that FLV is OK.)
My problem is with mp4 encoding, which consistently fails as described above. iPhones and iPads will not read Flash and mp4 x264 seems the most likely option to use a single file that will play across all major platforms.
Comment #15
bcobin commentedChecking back in on this - to be succinct, the process fails when the system tries to move the processed mp4 file from files/temp (in my case) to the converted folder. The encoding process works fine (with one-pass), but when the system tries to move the file, it throws the "Permission denied" error (in the log) and the processed file (in sites/temp) is deleted.
BD video works fine encoding mp4, so it's not an FFMPEG thing. Been going nuts trying to solve this - any ideas? Thanks...
Comment #16
rv0 commentedsubscribe
Comment #17
sterndata commentedI'm unable to get any conversions to work. If I disable conversion, video files upload and play, but I'm trying to transcode them (for now) into Flash. Uploading a wmv results in "The video conversion process has failed. You might want to submit a simpler video format like mpeg or divx avi. If the problem persists please contact website administrators" The patch in #13 doesn't work for me.
Comment #18
hypertext200@bcobin, do you have permissions set to that folder for Apache user?
@sterndata, to debug the module, please see watchdog and you can see running command to convert video, try the on CLI, if its working then, there is something wrong with video module (rare) but if it doesn't then you will need to carefully look at the FFMPEG installation and FFMPEG configurations.
Comment #19
bcobin commentedThanks for checking in, heshan. Permissions are wide open (for testing purposes) on files, files/temp, files/videos, etc. All files/folders here are "user owned" (not www). I've been able to get one-pass encoding to work (with Alpha2, not with dev) - the big problem right now is HTML5, which is turning into a real adventure. See http://drupal.org/node/987236.
Once I can get videos to play across multiple platforms, I'll revisit the two-pass encoding issue, which is secondary for me at the moment, now that I can get files to successfully transcode. After HTML5 would be the file management issue in not properly deleting files, which may be related somehow to the two-pass issue. (?)
Comment #20
bcobin commentedWorking with latest dev (1/25) and this issue still isn't solved. I'll save the space of the full FFMPEG output, but here's the end:
[libx264 @ 0x1b412f00]kb/s:2536.46 sh: sites/default/files/temp/test_vid.mp4: Permission deniedI will take a moment, if I may:
The site is now on a production server, so it's nothing to do with my development sandbox. The fact that I'm seeing this now on two different, well-configured systems means that it's not me - there's something seriously wrong that has yet to be addressed.
I don't mean to sound unappreciative here; I'm aware that the Video project represents an enormous amount of work, from which the entire community will benefit. And I also realize that most of the work has been going into a D7 version, which will then be backported, as I understand it. But I've been trying now for nigh on two months to try to get Video to work as advertised, without success.
I'd have to say that at this point, the Video project looks to me more like an effort to find co-developers more than a real solution; see a post like http://drupal.org/node/989266 which is clearly an appeal for development help. Regarding the post I'm referring to, deleting the associated video when the node is deleted is very basic (and expected) functionality, not something that should be handled down the line at some point. I'm not harping on this specifically; I merely bring it up because I believe it's demonstrative of the fact that the project is very incomplete at this point and that, in it's current stage, is unlikely to work unless a user has the coding skills to get into some serious development.
Reaching out for collaboration is great, and is what the Drupal community is all about. And I applaud heshan.lk for doing it, and for all the work he's doing here.
However, representing Video as a working project at this point, I feel, is off the mark. It should be more like, "If you have coding skills and want to assist in the development of Video, jump in - otherwise, keep your eye out for the new release version, expected in _____." I am aware that the project is in "Alpha," and what that means, but many if not most users will end up tearing their hair out if they try to use it as the project curerntly stands.
I don't believe it's too much to ask of a developer to verify that a module actually works before posting it. And if certain functionality is lacking, hey, that's OK too, as long as it's well-documented. But 8,543 installs at this point for something that doesn't really work represents a mind-boggling amount of wasted time by a lot of people in verifying that they're not doing something wrong.
I am happy to help in any way I can. And, again, I realize what an enormous task this is and that we owe heshan.lk massive gratitude for taking it on. I would only ask for more responsiveness here on the development side, especially when it comes to major issues like the permissions thing, which is a total show-stopper.
Please take this in the right spirit - I am really only trying to help. I wish I had the coding skills to help out more, but we all do what we can... Hoping that all this can get resolved soon and, once again, a big (if moderated) "thank you!"
Comment #21
virtuali1151 commentedAfter many hours I too have encountered this same issue, and would love to get a workable solution for two pass mp4. I will continue to fool around and post findings... hopefully we can get this one fixed..
Cheers.
Comment #22
parasox commentedI also had the same failures using the MP4 preset, but didn't try to fix it so much as workaround.
I edited hq_flash.inc in the video_preset directory, and changed the cmd_path line to:
'!cmd_path -y -i !videofile -f flv -crf 22 -vcodec libx264 -vpre slow -threads 0 -acodec libfaac -ar 22050 -ab 48 -s !widthx!height -qscale 1 !convertfile'
I was able to get good looking videos using those settings, and you can adjust the crf levels to your liking. One pass mind you, but not ugly pixelated flash either.
In my opinion adding some more "safemode" presets would do Heshan some good, so if you are a noob you can choose a good but safer setting without hacking the module code like I did or learning how to make a module to add your own preset etc.
Would be cool if the community could contribute working presets too, perhaps a preset exporter? Sorry off topic i know, but maybe this post helps someone with current preset problems to just get it working.
Comment #23
bcobin commentedJust to stay on topic, this is a file permissions issue when it comes to mp4 encoding - Flash does you no good if you want your videos to play on iPhone or iPad. Two-pass encoding works fine with Blue Droplet Video, so this isn't something generic to FFMPEG or my installations; it's likely something in the module code that's not properly setting file/folder ownership and/or permissions. As such, I think it shouldn't be too difficult to track down - I just wish that I could, and get on with it.
For us Drupalistas, having videos be unable to play in Apple devices is pretty embarrassing, IMO - hoping heshan.lk can help save our bacon here!
Comment #24
parasox commentedI agree bcobin, but as you mentioned since there's possibly thousands of people in the dark right now, it's also useful to get some people's problem fixed while waiting for this preset to work. Also if we can find some answers before heshan has to fix it for us, maybe we save him some time too.
I just edited the hq_flash preset because I'm a noob and it was the fastest hack to get it to work for me. It's not flash at all, I just chose that preset to edit. Plus I tried the stock flash preset and it looked crazy awful, so I'll never use it anyways :)
Some more reading to help:
http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/ (includes one and two pass command lines at several qualities)
http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/
Also from the horse's mouth in #x264:
Comment #25
virtuali1151 commentedI am quite happy to just do mp4 converting if we can get the permission prob fixed, but if a person wants to do transcoding of multiple file types (wmv, flv, mpg, and mp4) it is very hard to get a preset that will work accordingly for all the formats. Here is what I have come up with that seems to work for most and does the happy medium between speed for the conversion and decent quality...
'!cmd_path -y -i !videofile -acodec libfaac -ab 96k -vcodec libx264 -vpre ultrafast -crf 22 -threads 0 !convertfile'
Hopefully we can get the mp4 permissions prob fixed and just focus on a 2 pass cmd line.
Cheers.
Comment #26
hypertext200Is this whay your using in preset? or what the encoder your using? FFMPEG, Mcoder or HandBreke? What are the version u have installed?
Comment #27
hypertext200Add
-yin to the 2nd pass to override the fileComment #28
hypertext200Closing this and start discussion in #1043144: Multipass encoding stops transcoding
Comment #29
alokkumargarg commentedHi.. I have found the solution...
1. Add absolute path of ffmpeg.exe file in "Path to Video Transcoder" field. (Transcoder tab of video module).
2. Add absolute path of flvtools2.exe file in "Path to FLVTool2" field. (Metadata tab of video module).
download links:
http://www.ffmpeg.org/download.html (ffmpeg.exe, is under bin folder.)
https://github.com/unnu/flvtool2
If using Linux, these tools will be already added. Please check their paths.