Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -thread_queue_size 4096 #8396

Closed
wants to merge 1 commit into from
Closed

Conversation

Esteban82
Copy link
Member

Fix #8394

@Esteban82 Esteban82 self-assigned this Mar 5, 2024
@Esteban82 Esteban82 requested a review from a team March 5, 2024 19:34
@Esteban82
Copy link
Member Author

I test it on my script and it works.

@Esteban82
Copy link
Member Author

It is also related with #8391.

@joa-quim
Copy link
Member

joa-quim commented Mar 5, 2024

Can't you achieve the same effect with -F+o? From man and a quick code reading I would say one can.
Adding fixed numbers in code (-thread_queue_size 4096) is normally not a good idea.

@Esteban82
Copy link
Member Author

Can't you achieve the same effect with -F+o? From man and a quick code reading I would say one can. Adding fixed numbers in code (-thread_queue_size 4096) is normally not a good idea.

I didn't rememeber that.

But, it didn't work. The mp4 was not even created. The problem is that the code (-thread_queue_size 4096) was added at the end of the ffmpeg command and it must be added at the start. ffmpeg is very sensity to the order of arguments,

movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 60 -y -i "/home/thor/Github/Esteban82/gmt-2024-animation/WED-A_Fig_8/WED-A_Fig_8_%04d.png" -i IndianaJones_RaidersMarch.mp3 -af atempo=1.94612 -vcodec libx264 -thread_queue_size 4096 -pix_fmt yuv420p WED-A_Fig_8.mp4
Option thread_queue_size (set the maximum number of queued packets from the demuxer) cannot be applied to output url WED-A_Fig_8.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file WED-A_Fig_8.mp4.
Error opening output files: Invalid argument
movie [ERROR]: Running FFmpeg conversion to MP4 returned error 256 - exiting.

@Esteban82
Copy link
Member Author

Adding fixed numbers in code (-thread_queue_size 4096) is normally not a good idea.

I also don't like adding fixed numbers. That's why I would like that tell ffmpeg to take all the time it needs to process the data.

@joa-quim
Copy link
Member

joa-quim commented Mar 5, 2024

Well, we could change the order of the option insertion, but it looks that that option is tricky to use what pleases one case can error in another. Not sure what to propose.

@Esteban82
Copy link
Member Author

Well, we could change the order of the option insertion,

I don't thik so. -F+o is currently used (I think) to pass new arguments for the output file.

We would need a similar option but for the input file (something like -F+i). And I don't know if we need one map for the video and another for the audio. ffmpeg is tricky.

@joa-quim
Copy link
Member

joa-quim commented Mar 6, 2024

Can you try the movie-Fi branch (#8397)? Is not documented yet but what it does is to implement a -F+i option that works like -F+o. See if it solves the current issue.

@Esteban82
Copy link
Member Author

Ok, I will test it.

@joa-quim
Copy link
Member

joa-quim commented Mar 8, 2024

Better addressed in #8397

@joa-quim joa-quim closed this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Movie. ffmpeg "Thread message queue blocking"
2 participants