Camera footage with multi track audio

Questions and answers on how to get the most out of FFAStrans
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

I get an error I cannot figure out.

I have this in a "Command executor"

Code: Select all

"%s_ffmpeg%" -i "%s_source%" -map 0:v -map_metadata 0 -sn -s 1920x1080 -g 12 -b:v 6500k -map 0:a -b:a 320k -preset fast -c:v h264_nvenc -pix_fmt yuv420p -preset fast -level:v 4.1 -profile high "%s_original_path%\Proxy\%s_original_name%.mp4" -y
It works for Arri amira, Sony FX9 and Canon C300 files.
But for some reason not for Sony FX6, FS7 and FX3

But when I tested directly from FFmpeg in x64 folder, it worked with same command.

Code: Select all

ffmpeg -i sony_FX6_1.MXF -map 0:v -map_metadata 0 -sn -s 1920x1080 -g 12 -b:v 6500k -map 0:a -b:a 320k -preset fast -c:v h264_nvenc -pix_fmt yuv420p -preset fast -level:v 4.1 -profile high sony_FX6_1.mp4 -y
I am not able to see from the log what the error is. (log attached)

I see this error

Code: Select all

[h264_nvenc @ 045ab340] No capable devices found\r\n
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
But that does not explain how it works manually with FFmpeg console commands.


EDIT:
After further testing, it seems to have something to do with encoding multiple files at the same time.
When I ran FFAStrans with only the sony_FX6_1.MXF file alone, it worked.

Looks like it can do 2-3 encodings at the same time with h264_nvenc
Attachments
sony_FX6_1_error.json
(76.52 KiB) Downloaded 149 times
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Camera footage with multi track audio

Post by emcodem »

My guess would be that its about nvidia consumer card (GTX) limitations to encode 3 streams paralell. Nvidia professional cards usually don't have any limit.
If it is that, you'd either need to make the workflow wait or encode using cpu or maybe quicksync. You can check the number of used encoding sessions on nvidia using the smi command, some infos here:
viewtopic.php?f=5&t=1079&p=6188&hilit=smi#p6188

Be aware that i never got quicksync (h264_qsv) and nvidia running on the same machine in paralell.

Edit: or of course you get some professional card. Usually no need to get something high priced and modern, e.g. a P2000 is good enough for lowres encoding. High priced cards are not really faster than low priced but newer chipsets usually can do better quality at the same filesize.
https://developer.nvidia.com/video-enco ... matrix-new
emcodem, wrapping since 2009 you got the rhyme?
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

I intend to have my workflow on different locations, and not all of them will have a professional card.
Yeah using special hardware requires unfortunately special attention :D maybe thats the main reason why ffastrans dont have any hardware accelerator ("gpu") support natively
I have not been able to get the QSV to work at all, but have not use too much time on it yet.
From my experience that qsv is easy to use on Consumer processors but a hassle on Xeons unfortunately - IF the xeon even supports it :(
I'm wondering if it would work to use Bootcamp on an M1 Mac, and use M1 acceleration...
Sounds far too experimental for productive use :D ...also Apple has no reasons to deliver windows drivers for their hardware encoders.
As far as i see they call the apple hardware encoders "videotoolbox", seems like at least in ffmpeg there is no windows support for those: https://trac.ffmpeg.org/wiki/HWAccelIntro
But it is absolutely thinkable to use apple OS as a slave encoder if you want to do that... let me know :D
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Camera footage with multi track audio

Post by emcodem »

oh i think i hit the edit button instead of the quote button, sorry :D
emcodem, wrapping since 2009 you got the rhyme?
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

From my experience that qsv is easy to use on Consumer processors but a hassle on Xeons unfortunately - IF the xeon even supports it :(
Thats it, the machine I was testing on was a Xeon, and I think it was not in the list of supported when I checked.
Witch is weird, because I only bought that processor and the P4000 because sony recommended that for their NavigatorX software, but I guess they only used gpu encoding.

I am absolutely interesting in using the encoding power of M1 chip (and eventually M2), using the BMD Proxy generator on M1 chip is very fast,
have not compared to FFmpeg.

Testet the workflow on P4000 setup, and all files was encoded, but very slow 5fps, I'll have to check up on that, testfolder had 13 files.
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Camera footage with multi track audio

Post by emcodem »

Well i'm not very experienced with hardware encoding but from what i know the intel qsv stuff is used pretty rarely compared to nvidias nvenc. Anyway, Xeons can handle massive loads much better than the consumer stuff so in case NavigatorX does some decoding/encoding of professional formats that cannot be done on usual hardware e.g. XAVC, they need xeons of course, otherwise the pc would constantly shutdown cores in order not to overheat.

Regarding doing jobs on macos/linux, i have some ideas in my head since a long time. We cannot run ffastrans on these OS'es tough, that will just not happen because of the scripting language that we use and it's tight integration with windows api's.
How i imagine it could work is that you run one ffastrans main installation e.g. on a single windows host which picks up the jobs e.g. from watchfolder, then does all the analyzing and logic to construct an ffmpeg command which should be finally executed on a linux/macos host.

The linux host would just need to run a little application that is able to receive and execute the ffmpeg commands and report back the state and logs.

offload_jobs.png
offload_jobs.png (37.01 KiB) Viewed 2982 times
What would you think about such a setup? ...i believe a corresponding micro webserver for linux/macos is pretty simple to implement. It would just need to be started as a daemon.

One small problem is that one needs to align the perspective of the file paths, e.g. if the main ffastrans server picks up a file on :
\\server\share\file.mxf
The Linux client would need to access it via
/mnt/server/share/file.mxf

The ffastrans job would of course need to translate the unc paths to mount paths before submitting the job to the linux client.
emcodem, wrapping since 2009 you got the rhyme?
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

Looks like a good setup for a remote render setup.

and on macos it would be Volumes/server/share/file.mxf
I'm guessing the easiest would be some user config on the apple / linux client to config the first part of the file path turning X:\ into Volumes/server/

Server config (FFAStrans)
Watchfolder name | watchfolder location

watchfolder_01 | X:\my_videos
watchfolder_02 | \\10.0.0.25\my_other_videos

client Config (Mac os client)
Watchfolder name | watchfolder location

watchfolder_01 | Volumes/networkshare/my_videos
watchfolder_02 | Volumes/networkshare/my_other_videos

This way the server would only tell the "client" to look into watchfolder_01 to get to the correct location.
Or watchfolder_01\MyProject\Day4\Card1\ if you want to do a job in a specific folder.
My programming skills are weak, but I'm guessing there is no way to do it automagically.
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Camera footage with multi track audio

Post by emcodem »

well i't probably avoid configs on the clients because i usually prefer configuration from a central location. In such setups i normally keep the client software as dumb as possible, e.g. all they need to do is executing the ffmpeg command, no "business logic" at all.
Anyway, before we go down that route, i'd like to make sure you understand the implications. macos/android/amazon (all of it is linux) clients could only execute pure ffmpeg commands that also means most of ffastrans filters (based on avisynth) cannot be used. Introducing avisynth to this kind of setup is unthinkable because most of the filter plugins don't exist for other OS'es than windows. Moreover we have to consider the CPU architecture, it is only ffmpeg that is available for virtually all cpu architectures.

Anyway, such a setup is also kind of "hard to use", so one needs to get a real good benefit from using it.
The reason you mentioned, that you only get like 5 fps using nvidia encoding are not sufficient because nvidia will usually work with minimum 120 fps for a single 25fps fullhd proxy encode. So you just have to find out whats the speed break for you and voila, your windows encodes with 5x realtime, 2-3 jobs paralell without using much cpu. As there are still cpu resources, you can additionally encode 1 or 2 with the same speed on CPU and voila, you got 5 jobs at 5 realtime on a single machine.

If you can tell me good reasons that beat all of what i said, you got my attention :D
emcodem, wrapping since 2009 you got the rhyme?
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

Pure FFmpeg commands is no problem, as this would probably mostly be used for large scale proxy generation.

I have gotten my workflow to work better for both P4000 and 3080. And I guess with some tweaks I could get it to work on cpu and "software" encoding.

The best reason would be that many if not most production houses / editors have Apple computers as their main editing machines / ingest, and the M1 (and I guess the M2) is pretty decent at encoding h264.

We see more people working from home, often on average laptops, and a quick proxy encoding and upload to the sky helps reduce the wait for footage from the photographer.
Then any Apple based production houses only need to buy a basic windows machine as a server to delegate the work to a relatively cheap iMac or Mac mini.

But for my part, I'm creating my workflow based on nvenc, and I'm happy with that, for now atleast :)
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Camera footage with multi track audio

Post by Conniver »

I found a patch for nvidia consumer cards, that removes the max 2 job parallel limit.

https://github.com/keylase/nvidia-patch/tree/master/win

If anyone is interested.
Post Reply