Question

I've searched a lot but couldn't find any solution to the situation i'm in

What i do is i watermark video using ffmpeg.exe via php script but the output file doesn't play on jwplayer. i've found out that it is an encoding issue and i tried QTIndexSwapper but it is for windows. the input files i used is working nice on jwplayer but after watermark not working here is the code for ffmpeg i used

$ffmpeg_bin -i input.mp4 -s 320x240 -vf 'movie=$watermarkx $watermark_pos' -c:v libx264 -c:a aac -strict -2 $final_name   2<&1

NOTE: i used ffmpeg.exe

Was it helpful?

Solution 2

Run this tool on your file - http://renaun.com/blog/2010/06/qtindexswapper-2/, it has to do with an encoding issue.

OTHER TIPS

You can try to add -movflags faststart to your command line:

$ffmpeg_bin -i input.mp4 -s 320x240 -vf 'movie=$watermarkx $watermark_pos' -movflags faststart -c:v libx264 -c:a aac -strict -2 $final_name   2<&1

You can also use this option for existing videos without the need to re-encode:

$ ffmpeg -i input.mp4 -c copy -movflags faststart output.mp4

Without this option the index atom (moov) is written at the end of the file and the player can't start playing until it's download / read it. Once encoding finishes this option moves the moov to the beginning of the file and allows the player to start playing immediately. FYI it adds a couples a seconds to the encode process.

QTIndexSwapper made my file unplayable.

But you could also try to reencode the file with Handbrake. Just make sure that you have "Web optimized" checked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top