GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   share your ffmpeg recipes (https://gfy.com/showthread.php?t=1046361)

fris 11-18-2011 10:44 AM

share your ffmpeg recipes
 
anyone got any command line args they can share?

:thumbsup

nextri 11-18-2011 10:45 AM

I gave up on it and started using pandastream.com.
No idea how many hours I've spent tweaking encoding options. Could never seem to get it quite right..

MaDalton 11-18-2011 10:49 AM

worked like a charm for me recently when i really needed it

i used this to create DVD compatible videos from source videos where no encoding program could read the audio track:

ffmpeg -i test.m2ts -acodec mp2 -ab 224k -ar 48000 -vcodec mpeg2video -b:v 8000k -g 15 -r 25 -s 720x576 -sn test.mpg

spent nearly half of saturday to figure it out but the possibilities are endless

evulvmedia 11-18-2011 11:01 AM

Encoding for web + mobile, streaming + downloading: mp4 format, 640px width, 720kbps video, 96kbps audio.

This is nice because it gives excellent quality while also working fine on mobile devices, even first-generation iPhone and iPod Touch.

Using the x264 presets it is easy!

Two passes:

ffmpeg -i INPUT -an -pass 1 -s 640xH -vcodec libx264 -profile baseline -preset slow -vpre ipod640 -b 720k -aspect W:H -threads 0 -f ipod -y /dev/null

ffmpeg -i INPUT -acodec libfaac -ar 48000 -ac 2 -ab 96k -async 1 -pass 2 -s 640xH -vcodec libx264 -profile baseline -preset slow -vpre ipod640 -b 720k -aspect W:H -threads 0 -f ipod -metadata "title=TITLE" OUTPUT-1.mp4

You need to specify H in the -s parameter based on the size of the source video (e.g. H=360 for 16:9 aspect ratio). And of course you need to specify W:H for the -aspect parameter.

Finally, you need to adjust the moov atom for streaming:

qt-faststart OUTPUT-1.mp4 OUTPUT.mp4

raymor 11-18-2011 11:20 AM

Is there any script for "use the same options as this other video"? Say you have a video that works well on a phone and you want to encode another one with the same codecs, package format, etc.

SmokeyTheBear 11-18-2011 11:37 AM

Quote:

Originally Posted by raymor (Post 18569216)
Is there any script for "use the same options as this other video"? Say you have a video that works well on a phone and you want to encode another one with the same codecs, package format, etc.

wouldn't you just view the video and read it's properties.

besides you are reading the output not the input so if you want your video to have the same output chances are the input is different , and thus the method would also be different.

Bird 11-18-2011 11:41 AM

Fuck, all I know how to do is grab a few frames from a video.

ffmpeg -i $input -an -ss 00:00:01 -r 1 -vframes 1 -f mjpeg -y $output

fris 11-18-2011 12:11 PM

Quote:

Originally Posted by raymor (Post 18569216)
Is there any script for "use the same options as this other video"? Say you have a video that works well on a phone and you want to encode another one with the same codecs, package format, etc.

you can create your own presets so its saved parameters

fris 11-18-2011 12:12 PM

Quote:

Originally Posted by evulvmedia (Post 18569152)
Encoding for web + mobile, streaming + downloading: mp4 format, 640px width, 720kbps video, 96kbps audio.

This is nice because it gives excellent quality while also working fine on mobile devices, even first-generation iPhone and iPod Touch.

Using the x264 presets it is easy!

Two passes:

ffmpeg -i INPUT -an -pass 1 -s 640xH -vcodec libx264 -profile baseline -preset slow -vpre ipod640 -b 720k -aspect W:H -threads 0 -f ipod -y /dev/null

ffmpeg -i INPUT -acodec libfaac -ar 48000 -ac 2 -ab 96k -async 1 -pass 2 -s 640xH -vcodec libx264 -profile baseline -preset slow -vpre ipod640 -b 720k -aspect W:H -threads 0 -f ipod -metadata "title=TITLE" OUTPUT-1.mp4

You need to specify H in the -s parameter based on the size of the source video (e.g. H=360 for 16:9 aspect ratio). And of course you need to specify W:H for the -aspect parameter.

Finally, you need to adjust the moov atom for streaming:

qt-faststart OUTPUT-1.mp4 OUTPUT.mp4

do you only encode 1 video for both mobile and web, or two?

raymor 11-18-2011 02:23 PM

Quote:

Originally Posted by SmokeyTheBear (Post 18569290)
wouldn't you just view the video and read it's properties.

I sometimes don't know how to translate some property to an ffmpeg output parameter. I'd like a script that reads the properties and generates the right arguments for ffmpeg.

raymor 11-18-2011 02:31 PM

Quote:

Originally Posted by fris (Post 18569427)
you can create your own presets so its saved parameters

I've like to look at a video YOU and made figure out what presets YOU used so I can use the ones. Obviously that applies only to parameters like codecs which can be determined from the output.

Example:
Assume you have an old phone or DVR which will record and play files in a specific format (size, codec, packaging, etc.). I want to convert another video to be playable on the device. I used the same codec and package type, but parameter is different so it can't play my file. I'd like to use one of it's own native files as a reference, saying "convert this foreign file to have the same format as this native file."

evulvmedia 11-18-2011 08:51 PM

Quote:

Originally Posted by fris (Post 18569430)
do you only encode 1 video for both mobile and web, or two?

only one for both web and mobile

fris 11-21-2011 10:16 AM

Quote:

Originally Posted by evulvmedia (Post 18570628)
only one for both web and mobile

what aspect ratio do you use? i want to try your method

vending_machine 11-21-2011 10:53 AM

ffmpeg can blow me.

Quote:

find / -depth -name ffmpeg\* -exec rm -rf {} \;

Socks 11-21-2011 10:59 AM

'!cmd_path -y -i !videofile -f flv -crf 24 -vcodec libx264 -vpre slow -threads 0 -acodec libfaac -ar 44100 -ab 192 -s !widthx!height -qscale 1 !convertfile'

acctman 11-21-2011 01:23 PM

if you have SoftLayer as your dedicated hoster they have a set of server banks and api's that you can use to process all you movies for free.

Jack Sparrow 11-21-2011 01:32 PM

Quote:

Originally Posted by fris (Post 18575767)
what aspect ratio do you use? i want to try your method

I think the 360 method would work best right?
Most phones are on a 16:9 ratio?!

Just Alex 11-21-2011 01:38 PM

Quote:

Originally Posted by fris (Post 18569069)
anyone got any command line args they can share?

:thumbsup

Here you go. Takes all videos in current folder and makes flash

for i in *.wmv; do ffmpeg -i "$i" -f flv -ar 22050 -ab 56 -r 25 -b 650k -s 320x240 `basename $i .wmv`.flv; done

then you make screen prints out of all flv files

for i in *.flv; do ffmpeg -i "$i" -an -ss 00:00:03 -an -r 1 -vframes 10 -s 160x120 -y `basename $i .flv`-%d.jpg; done


You welcome. :2 cents:

fris 11-22-2011 11:08 AM

Quote:

Originally Posted by Just Alex (Post 18576341)
Here you go. Takes all videos in current folder and makes flash

for i in *.wmv; do ffmpeg -i "$i" -f flv -ar 22050 -ab 56 -r 25 -b 650k -s 320x240 `basename $i .wmv`.flv; done

then you make screen prints out of all flv files

for i in *.flv; do ffmpeg -i "$i" -an -ss 00:00:03 -an -r 1 -vframes 10 -s 160x120 -y `basename $i .flv`-%d.jpg; done


You welcome. :2 cents:

wont the 320x240 be a bit small for desktop?

Just Alex 11-22-2011 01:47 PM

Quote:

Originally Posted by fris (Post 18578438)
wont the 320x240 be a bit small for desktop?

Obviously you can change all parameters. I just gave you sample code.

fris 11-22-2011 01:55 PM

Quote:

Originally Posted by Just Alex (Post 18579093)
Obviously you can change all parameters. I just gave you sample code.

ya trying to use one video for desktop and mobile.

pornsprite 11-27-2011 07:22 PM

Best thread of the month as far as I am concerned.

Solace 11-27-2011 07:36 PM

I can make ffmpeg suck cocks


All times are GMT -7. The time now is 11:39 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123