# Transcode with FFMPEG

**URL:** <https://community.wowza.com/t/transcode-with-ffmpeg/38431>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [April 2, 2012, 2:30pm UTC](https://community.wowza.com/t/transcode-with-ffmpeg/38431 "2012-04-02T14:30:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanjie\_Ji](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@Hanjie\_Ji](https://community.wowza.com/u/Hanjie_Ji)\
**Post date:** [April 2, 2012, 2:30pm UTC](https://community.wowza.com/t/transcode-with-ffmpeg/38431/1 "2012-04-02T14:30:07Z")

</div>

My application uses rtmp to record video, transcodes the flv video to mp4 using ffmpeg.

Currently, the transcoding happens after the video is recored to flv. I was informed that ffmpeg can take rtmp stream and encode to mp4. This way the processing time can probably greatly shortened as the transcoding starts with the recording.

Currently I put the ffmpeg transcoding command “ffmpeg -i rtmp://localhost:1939/recorder/1333402852509 -acodec libfaac -ac 2 -b:v 200k -ar 48k -async 1 -bufsize 3M -s 320x240 -r 30 -vcodec libx264 -b:a 64k -y 1333402852509.mp4” in the onPublish event of IMediaStreamActionNotify. But no mp4 is written to the disk.

Can someone tell me what’s the correct way to do this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [April 2, 2012, 10:33pm UTC](https://community.wowza.com/t/transcode-with-ffmpeg/38431/2 "2012-04-02T22:33:22Z")

</div>

I recommend sticking with the workflow you have. You can start with h.264 video and Speex audio if you use Flash 11 and follow this guide to configure your application:

[https://www.wowza.com/docs/how-to-convert-flash-player-11-output-from-h-264-speex-audio-to-h-264-aac-audio-using-wowza-transcoder](https://www.wowza.com/docs/how-to-convert-flash-player-11-output-from-h-264-speex-audio-to-h-264-aac-audio-using-wowza-transcoder)

Richard
