Flash Tutorials - Herong's Tutorial Examples - v3.03, by Dr. Herong Yang
Split Video Stream Out of SWF File
This section provides a tutorial example on how to split the video stream out of a stream SMF file. '-map 0:1' option is used to select the second stream (video stream) of the first input file into the output file.
After splitting the audio stream out of the SWF file, you may want to split the video stream out too. This can also be done easily with the "ffmpeg" command:
C:\herong>\local\ffmpeg\bin\ffmpeg -i input.swf -map 0:1 output.swf
The above command uses "-map 0:1" to specify the second stream (video stream) of the first input file to be mapped to the output file.
Let's try it on our sample SWF file, Anchor_and_Spider_Man.swf:
C:\herong>\local\ffmpeg\bin\ffmpeg -i Anchor_and_Spider_Man.swf -map 0:1 Video_with_No_Audio.swf Input #0, swf, from 'Anchor_and_Spider_Man.swf': Duration: 00:02:04.08, start: 0.000000, bitrate: 127 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Stream #0:1: Video: flv1, yuv420p, 416x240, 25 fps, 25 tbr, 25 tbn Output #0, swf, to 'Video_with_No_Audio.swf': Metadata: encoder : Lavf55.40.100 Stream #0:0: Video: flv1 (flv), yuv420p, 416x240, q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc Metadata: encoder : Lavc55.63.100 flv Stream mapping: Stream #0:1 -> #0:0 (flv -> flv) Press [q] to stop, [?] for help frame=198 fps=0.0 q= 2.0 size= 320kB time=00:00:07.92 bitrate=330.5 frame=744 fps=744 q=31.0 size=1093kB time=00:00:29.76 bitrate=300.9 frame=986 fps=846 q=31.0 Lsize=1311kB time=00:00:39.44 bitrate=272.3 video:1292kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.419381%
Check the output file with "swfdump" command from SWFTools first:
C:\herong>\local\SWFTools\swfdump Video_with_No_Audio.swf [HEADER] File version: 6 [HEADER] File size: 1342249 [HEADER] Frame rate: 25.000000 [HEADER] Frame count: 986 [HEADER] Movie width: 416.00 [HEADER] Movie height: 240.00 [03c] 10 DEFINEVIDEOSTREAM defines id 0000 (986 frames, 416x240 s... [01a] 21 PLACEOBJECT2 places id 0000 at depth 0001 name "video" [03d] 9058 VIDEOFRAME adds information to id 0000 (frame 0) 416x240... [001] 0 SHOWFRAME 1 (00:00:00,000) [01a] 5 PLACEOBJECT2 moves object at depth 0001 [03d] 901 VIDEOFRAME adds information to id 0000 (frame 1) 416x240... [001] 0 SHOWFRAME 2 (00:00:00,040) ... [01a] 5 PLACEOBJECT2 moves object at depth 0001 [03d] 987 VIDEOFRAME adds information to id 0000 (frame 985) 416x2... [001] 0 SHOWFRAME 986 (00:00:39,399) [000] 0 END
The "swfdump" result looks good. Now enjoy the video without any music:
C:\herong>\local\bin\flashplayer_13_sa Video_with_No_Audio.swf
Table of Contents
Adobe Flash Player Plugin for Firefox
Adobe Flash Player Plugin for Chrome
Adobe Flash Player Plugin for Safari
Adobe Flash Player ActiveX for IE
Using "object" Elements for Flash Files
Using "embed" Elements for Flash Files
"mp3player" - MP3 Music Player
SWFObject - Hidding "object" behind JavaScript
SWFTools - SWF File Manipulation Tools
SWFC Script to Generate Flash SWF Files
ActionScript Embedded in SWFC Script
AS3Compile - ActionScript 3 Compiler
►SWF Files for Video and Audio Streams
Video and Audio Stream SWF File Structure
Installing FFmpeg to Manipulate Video SWF Files
Playing Movie with FFmpeg "ffplay" Command
See File Properties with FFmpeg "ffprobe" Command
Convert File Format with "ffmpeg" Command
Issue with "ffplay" on SWF Output File
Break Long Video into Parts with "ffmpeg"
Concatenate Video Files with "ffmpeg"
Video/Audio Stream Concatenation Order
Split Audio Stream Out of SWF File
►Split Video Stream Out of SWF File
Merge Video and Audio Streams to SWF File