我想從pdf文件製作視頻。有可能嗎? 我使用ffmpeg創建了視頻,但不能使用 可以從pdf和doc創建視頻。這是可能從pdf文件創建視頻?
3
A
回答
3
這裏是腳本將PDF轉換爲視頻:
exec("convert -geometry 1600x1600 -density 200x200 -quality 100 -resize 800x $pdf_path $temp_images");
exec("ffmpeg -loop 1 -f image2 -framerate 0.5 -b 1800 -i $temp_images_wildcard -c:v libx264 -preset slow -tune stillimage -r 5 -t 22 -y $frame_target 2>&1",$output);
+0
轉換:缺少圖像文件名 – KJW
2
您可以將PDF轉換爲圖像,然後使用舊的方法來生成視頻
0
標準FPS(每秒幀數)的視頻是30歲左右,這就是爲什麼定期呼叫保持它在通常的文檔格式是不切實際的。 There's a way將PDF文件轉換爲圖像,然後您可以在視頻中使用它。
1
假設您的PDF文件在你的工作目錄,創建一個從一組PDF文件的電影文件可以執行:
exec("mogrify -verbose -density 500 -resize 800 -format png ./*.pdf")
exec("convert -delay 600 *.png movie.mp4")
這需要安裝Imagemagick和Ghostscript。適用於Linux/Mac OS X/Microsoft Windows。不是矢量的。
如果你想生成一些PDF文件來測試命令,這裏是一個Python腳本生成的PDF文件:
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
for i in range(10):
np.random.seed(i)
dates = pd.date_range('1/1/2000', periods=50)
print('dates: {0}'.format(dates))
df = pd.DataFrame(np.random.randn(len(dates), 1), index=dates.astype(str), columns=['A'])
print('df: {0}'.format(df))
plt.figure(figsize=(60,15))
df.plot(y='A', use_index=True)
plt.xticks(rotation=70)
plt.savefig('plot_{0}.pdf'.format(i), dpi=300, bbox_inches='tight')
FYI:
- Imagemagick Convert PDF to JPEG: FailedToExecuteCommand `"gswin32c.exe"/PDFDelegateFailed - - >如果沒有安裝Ghostscript,那就是你得到的錯誤信息。
- Convert every pdf in the current directory to png - > convert不支持批量轉換,與mogrify不同。
- ffmpeg要求圖像具有一些非常特定的命名約定,不像convert只是採用字典順序。
- Using Imagemagick to convert images to the video: background of the video is black, whereas the background of the pictures are white
- How can I run mogrify over the 3 million JPG files? - > mogrify只能處理當時的一個文件,而是一個可以與
xargs
繞過去。
相關問題
- 1. 是否有可能從Flash中的BitmapDatas創建視頻文件?
- 2. OpenCV從文本文件創建視頻
- 3. 創建視頻文件
- 4. 創建視頻文件
- 5. 從NSMutableData創建PDF文件
- 6. C++從多個視頻文件創建1個視頻
- 7. 從多個視頻部分創建單個視頻文件
- 8. 使用AV Foundation可以從RGB幀創建視頻文件
- 9. iphone從pdf頁面創建PDF文件
- 10. 如何使用多個視頻文件創建視頻文件?
- 11. 是否可以從base64字符串創建一個pdf文件?
- 12. 從pdf文件創建.txt文件
- 13. 是否有可能從文件系統創建VectorDrawable(* .xml文件)
- 14. 從圖像和音頻創建視頻文件(預先錄製)
- 15. 通過文件輸入從視頻文件創建縮略圖
- 16. 這是可能在joomla創建新的配置文件
- 17. 創建PDF文件
- 18. 創建PDF文件?
- 19. 是否有可能創建一個等距視頻
- 20. 這個文件是視頻(Python)嗎?
- 21. 創建PDF文件,但不能打開
- 22. 從圖像創建視頻
- 23. 使用PHP創建視頻文件
- 24. 如何創建動態視頻文件?
- 25. OpenGL - 創建視頻輸出文件
- 26. 在Windows Phone創建視頻文件7
- 27. 在PDFBOX中創建PDF文件(從現有的pdf文件)
- 28. 是否有可能從雲中創建時間流逝的視頻
- 29. PDF創建軟件可用?
- 30. 這是可能打破PDF文件小於明智的破壞?
爲什麼downvote?完全有效的問題與價值。 – KJW