-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_packets.py
40 lines (29 loc) · 1.31 KB
/
test_packets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from fluggo.media import process, libav
from fluggo.media.basetypes import *
import fractions
import sys
packet_source = libav.AVDemuxer(sys.argv[1], 0)
coded_image = libav.AVVideoDecoder(packet_source, 'dvvideo')
packet_source = libav.AVVideoEncoder(coded_image, 'dvvideo', start_frame=0, end_frame=200, frame_size=v2i(720, 480),
sample_aspect_ratio=fractions.Fraction(33, 40), interlaced=True, top_field_first=False, frame_rate=fractions.Fraction(30000/1001))
muxer = libav.AVMuxer('/home/james/software/fluggo-media/test_packet.avi', 'avi')
muxer.add_video_stream(packet_source, 'dvvideo', frame_rate=fractions.Fraction(30000, 1001),
frame_size = v2i(720, 480), sample_aspect_ratio=fractions.Fraction(33, 40))
#muxer.run()
if False:
#print len(packet_source.get_header())
with open('/home/james/software/fluggo-media/test_packet.dv', 'w') as file_:
while True:
packet = packet_source.get_next_packet()
if not packet:
break
file_.write(str(packet.data))
#print packet
#print packet.dts, packet.pts
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from fluggo.editor.ui import renderprogress
app = QApplication(sys.argv)
window = renderprogress.RenderProgressDialog(muxer, [packet_source])
window.show()
quit(app.exec_())