The No.1 Website for Pro Audio
 Search This Thread  Search This Forum  Search Reviews  Search Gear Database  Search Gear for sale  Search Gearslutz Go Advanced
Best .mov/mp4 converter DAW Software
Old 24th May 2018
  #31
Gear Head
 

Hi nuclear,
I installed ffmpeg via Homebrew and make a test with your code on Automator. It works like a charm, it's very useful !
Indeed I need another conversion type : DNxHD 36
If you can give me the code it will help me. I tried to found it on the web, but I am not sure what to do…
And the best would be a new file created and named for example "Film_DNxHD_36.mov". As you did in your code, in the same folder.
Thanks !
Old 24th May 2018
  #32
Lives for gear
 
nucelar's Avatar
 

Quote:
Originally Posted by YannL View Post
Hi nuclear,
I installed ffmpeg via Homebrew and make a test with your code on Automator. It works like a charm, it's very useful !
It's very practical, isn't it?

Here's the code for DNxHD 36.
It's worth to learn a bit about ffmpeg, you will quickly be doing your own commands, everything can be done!
Code:
on run {input, parameters}
	tell application "Terminal"
		activate
		set filesString to ""
		repeat with file_ in input
			set filesString to filesString & " " & quoted form of (POSIX path of file_)
		end repeat
		do script "for f in" & filesString & "; do
/usr/local/bin/ffmpeg -i \"$f\" -vf scale=1920:1080 -pix_fmt yuv422p -c:v dnxhd -b:v 36M -c:a pcm_s24le -ar 48000 \"${f%.*}_DNxHD_36.mov\"
done"
	end tell
	return input
end run
Old 24th May 2018
  #33
Lives for gear
 
Jamie Mac's Avatar
Can ffmpeg burn in time code?
Old 24th May 2018
  #34
Gear Head
 

You make my day, thanks a lot nuclear !!
I just did it in Automator. It's perfect, so practical and faster than others application I used.

I gonna try to learn more about ffmpeg (and too Automator), and with your codes it will be easier for me.

Thanks again.
Old 24th May 2018
  #35
Gear Head
 

Quote:
Originally Posted by Jamie Mac View Post
Can ffmpeg burn in time code?
I think :
https://gist.github.com/reidransom/2630650
https://www.google.com/search?source....0.T28btpfbV3g
Old 24th May 2018
  #36
Lives for gear
 
Jamie Mac's Avatar
Quote:
Originally Posted by nucelar View Post
It's very practical, isn't it?

Here's the code for DNxHD 36.
It's worth to learn a bit about ffmpeg, you will quickly be doing your own commands, everything can be done!
Code:
on run {input, parameters}
	tell application "Terminal"
		activate
		set filesString to ""
		repeat with file_ in input
			set filesString to filesString & " " & quoted form of (POSIX path of file_)
		end repeat
		do script "for f in" & filesString & "; do
/usr/local/bin/ffmpeg -i \"$f\" -vf scale=1920:1080 -pix_fmt yuv422p -c:v dnxhd -b:v 36M -c:a pcm_s24le -ar 48000 \"${f%.*}_DNxHD_36.mov\"
done"
	end tell
	return input
end run

thanks for sharing, this is a nice workflow!
Old 8th August 2018
  #37
Here for the gear
 

Hello nuclear,
this is really nice workflow, but on my system it moves audio 1f forward and the picture is 1f longer. Can You please check this in ProTools 12 system?

This 1f unsync is getting me crazy.
Old 10th August 2018
  #38
Lives for gear
 
iluvcapra's Avatar
Quote:
Originally Posted by shtepan View Post
Hello nuclear,
this is really nice workflow, but on my system it moves audio 1f forward and the picture is 1f longer. Can You please check this in ProTools 12 system?

This 1f unsync is getting me crazy.
The ffmpeg invocation is pretty airtight, have you confirmed that the movie you received doesn't have the same error?
Old 10th August 2018
  #39
Lives for gear
 
minister's Avatar
We switched to Edit Ready early this year. MPEG Streamclip is great, this better more up-to-date, faster. Let's you batch. VERY happy.

EditReady : Transcode Any Camera Source Without The Hassle
Old 10th August 2018
  #40
Lives for gear
 
iluvcapra's Avatar
Quote:
Originally Posted by minister View Post
We switched to Edit Ready early this year. MPEG Streamclip is great, this better more up-to-date, faster. Let's you batch. VERY happy.

EditReady : Transcode Any Camera Source Without The Hassle
Somewhat obscure feature but you can batch with Streamclip. Edit → Batch List...
Old 10th August 2018
  #41
Lives for gear
 
minister's Avatar
Quote:
Originally Posted by iluvcapra View Post
Somewhat obscure feature but you can batch with Streamclip. Edit → Batch List...
Ah. But, Edit Ready is WAY faster. For Features, it cuts our conversion down by about an hour and a half.
Old 22nd August 2018
  #42
Lives for gear
 
nucelar's Avatar
 

Quote:
Originally Posted by Jamie Mac View Post
Can ffmpeg burn in time code?
Hi there!

Yes it can, but you must be careful to set it to the same rate as the video.


Ok here it goes:
This converts any source video to DNxHD36 with TC inserted.
The code relevant to TC starts at "drawtext" There are several things you can/should customize to match your needs

- You can use any font you like, in OSX you must specify the path and better use a font without spaces in the name, otherwise you'll run into trouble.
- You must specify a start timecode, in the example it's 10:00:00:00, be careful to respect the quotes and backslashes
- with r=24 you set the rate of the TC generator, in this case at 24fps. If you work with 25 and 23,98 i recommend making separate versions of the script for each rate.
The other options are for the appearance, it's highly customizable. see FFmpeg Filters Documentation for details. In the example below it places it centered on top, white text on black box.

I hope you get it running!


Code:
on run {input, parameters}
	tell application "Terminal"
		activate
		set filesString to ""
		repeat with file_ in input
			set filesString to filesString & " " & quoted form of (POSIX path of file_)
		end repeat
		do script "for f in" & filesString & "; do
/usr/local/bin/ffmpeg -i \"$f\" -vf \"scale=1920:1080, drawtext=fontfile=/Library/fonts/Tahoma.ttf: timecode='10\\:00\\:00\\:00': r=24: x=(w-tw)/2: y=(2*lh): fontsize=72: fontcolor=white: box=1: boxcolor=0x000000FF\" -pix_fmt yuv422p -c:v dnxhd -b:v 36M -c:a pcm_s24le -ar 48000 \"${f%.*}_DNxHD_36_TC_24fps.mov\"
done"
	end tell
	return input
end run
Old 22nd August 2018
  #43
Lives for gear
 
nucelar's Avatar
 

Quote:
Originally Posted by shtepan View Post
Hello nuclear,
this is really nice workflow, but on my system it moves audio 1f forward and the picture is 1f longer. Can You please check this in ProTools 12 system?

This 1f unsync is getting me crazy.
Hi Stephan,

I assume you tested the example where it creates a low resolution mp4 (with aac audio)

when PCM audio is converted to aac there is always an encoding delay involved. the encoder, in this case ffmpeg, should incorporate this delay info in the file so that the decoding software (video player, video editor, DAW...) knows and compensates accordingly. Unfortunately in my experience this ideal behaviour is not implemented consistently across different encoders/decoders and sample accurate sync is lost. For example my ProTools discards the first frame and everything is shifted 1 frame like you observed.

If you convert to mp4 + aac , keep in mind it is only for viewing purposes, not for further production.

Never trust the audio sync accuracy of an mp4 or similar compressed format

Nothing of this happens when you convert from one production format to another (for example ProRes to DnxHD)

Cheers
Old 22nd August 2018
  #44
Lives for gear
 
Jamie Mac's Avatar
Quote:
Originally Posted by nucelar View Post
Hi there!

Yes it can, but you must be careful to set it to the same rate as the video.


Ok here it goes:
This converts any source video to DNxHD36 with TC inserted.
The code relevant to TC starts at "drawtext" There are several things you can/should customize to match your needs

- You can use any font you like, in OSX you must specify the path and better use a font without spaces in the name, otherwise you'll run into trouble.
- You must specify a start timecode, in the example it's 10:00:00:00, be careful to respect the quotes and backslashes
- with r=24 you set the rate of the TC generator, in this case at 24fps. If you work with 25 and 23,98 i recommend making separate versions of the script for each rate.
The other options are for the appearance, it's highly customizable. see FFmpeg Filters Documentation for details. In the example below it places it centered on top, white text on black box.

I hope you get it running!
Still very new at ffmpeg, but your help here has been great so far, thank you!

Unfortunately it gives the following error.


[AVFilterGraph @ 0x7fdf98514600] No such filter: 'drawtext'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
Old 22nd August 2018
  #45
Lives for gear
 
nucelar's Avatar
 

Quote:
Originally Posted by Jamie Mac View Post
Still very new at ffmpeg, but your help here has been great so far, thank you!

Unfortunately it gives the following error.


[AVFilterGraph @ 0x7fdf98514600] No such filter: 'drawtext'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
Hi, sorry to hear that.
This is related to the way you installed ffmpeg on your mac. Ffmpeg can be compiled with a set of optional libraries, the one that drawtext uses is called libfreetype. Maybe you downloaded some precompiled binary that does not include this option. Best way is to go to static FFmpeg binaries for macOS 64-bit
and download the latest binary from there. good luck!
Top Mentioned Products
Topic:
Post Reply

Welcome to the Gearslutz Pro Audio Community!

Registration benefits include:
  • The ability to reply to and create new discussions
  • Access to members-only giveaways & competitions
  • Interact with VIP industry experts in our guest Q&As
  • Access to members-only sub forum discussions
  • Access to members-only Chat Room
  • Get INSTANT ACCESS to the world's best private pro audio Classifieds for only USD $20/year
  • Promote your eBay auctions and Reverb.com listings for free
  • Remove this message!
You need an account to post a reply. Create a username and password below and an account will be created and your post entered.


 
 
Slide to join now Processing…
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Forum Jump
Forum Jump