View Full Version : how to convert mxf BACK to mp4


Marius Boruch
August 15th, 2012, 10:54 AM
Whiled downloading files from SD card I converted them to mxf; now I need to share them with some other editor and he can't read mxf in his software (not Vegas). How to convert them back to mp4?
thanks in advance

Eric Olson
August 15th, 2012, 12:07 PM
Whiled downloading files from SD card I converted them to mxf; now I need to share them with some other editor and he can't read mxf in his software (not Vegas). How to convert them back to mp4?
thanks in advance

Maybe it is better to rewrap the mxf files as mov or avi without reencoding. With FFMpeg try the command

ffmpeg -i input.mxf -acodec copy -vcodec copy -y output.mov

or

ffmpeg -i input.mxf -acodec copy -vcodec copy -y output.avi

Since this is a command line, it can be automated as a batch to rewrap all the files at once. There may also be a mouse oriented program that can do the same, but I don't have a recommendation there.

Eric Olson
August 15th, 2012, 12:19 PM
Duplicate post, see above.

Marius Boruch
August 15th, 2012, 03:22 PM
uffff....how to run this application; I downloaded it and extracted

Marius Boruch
August 15th, 2012, 03:29 PM
ok , I copied ffmepg to c:\ and used run ffmpeg it is running; how to specify location of the files; what about that "i" parameters

Marius Boruch
August 15th, 2012, 05:11 PM
I got this error that operation is not permitted although I run cmd as administrator and files are not on c:\
what is going on???


c:\>ffmpeg -i g:\358_5308_01.mxf -acodec copy -vcodec copy -y j:\convert.avi
ffmpeg version N-43418-g633b90c Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 9 2012 23:56:26 with gcc 4.7.1 (GCC)
configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runt
ime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass -
-enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-l
ibfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenj
peg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheo
ra --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --ena
ble-zlib
libavutil 51. 67.100 / 51. 67.100
libavcodec 54. 51.100 / 54. 51.100
libavformat 54. 22.104 / 54. 22.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 7.100 / 3. 7.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Input #0, mxf, from 'g:\358_5308_01.mxf':
Metadata:
timecode : 16:03:04;03
Duration: 00:01:26.45, start: 0.000000, bitrate: 36680 kb/s
Stream #0:0: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]
, 35000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
Stream #0:2: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
Output #0, avi, to 'j:\convert.avi':
Metadata:
ISMP : 16:03:04;03
ISFT : Lavf54.22.104
Stream #0:0: Video: mpeg2video (mpg2 / 0x3267706D), yuv420p, 1920x1080 [SAR
1:1 DAR 16:9], q=2-31, 35000 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, 768 k
b/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
g:\358_5308_01.mxf: Operation not permitted
frame= 2591 fps=0.0 q=-1.0 Lsize= 373163kB time=00:00:51.88 bitrate=58917.7kbit
s/s
video:364926kB audio:8105kB subtitle:0 global headers:0kB muxing overhead 0.0355
59%

Marius Boruch
August 15th, 2012, 07:40 PM
I need to figure out how to batch convert; I came across this script:
#===================================
#the directory wav must be present in the current directory
for f in *.mxf;
do
ffmpeg -i "$f" "wav/${f%.mxf}.m2t";
done
#====================================

but can't make it work in ffmpeg....how to write full script so it works; I use c:\a\ as my directory for all files mxf and ffmpeg is hosted there

Eric Olson
August 16th, 2012, 03:05 AM
I need to figure out how to batch convert; I came across this script:
#===================================
#the directory wav must be present in the current directory
for f in *.mxf;
do
ffmpeg -i "$f" "wav/${f%.mxf}.m2t";
done
#====================================

but can't make it work in ffmpeg....how to write full script so it works; I use c:\a\ as my directory for all files mxf and ffmpeg is hosted there

You have found a unix shell script. You can convert it to a Microsoft DOS batch script, or you can install a POSIX compatibility layer such as CYGWIN. Am I correct in assuming you've gotten FFMpeg to work one file at a time? The output from your previous post looked like you might be losing one channel of audio. It may require a little fiddling to get the two monaural audio channels in the MXF files mixed as a single stereo track in the AVI file.

Marius Boruch
August 16th, 2012, 09:08 AM
yes, nore or less I figured it out (thanks to you) ut now I need to batch convert multiple files:

can you povideme with the cript I have to put in cmd that would do so in win7

again, thats in advance for all your help

Marius Boruch
August 16th, 2012, 02:10 PM
Eric,
thanks again but I still have problems with BATCH; here is what I use for single file and it works OK

VIDEO OK
ffmpeg -i c:\a\videos\358_5308_01.mxf -vcodec copy -acodec copy -y c:\a\converted\358_5308_01conv.m2t
AUDIO OK
ffmpeg -i c:\a\videos\358_5308_01.mxf -map 0:0 -vcodec copy -map 0:1 -acodec copy -y c:\a\converted\358_5308_01conv.wav

but for BATCH conversion I found this script online (all mxf files and ffmpeg are in c:\ location) but the script shows "%%a was unexpected at this time" error message.

for %%a in ("*.mxf") do ffmpeg.exe -i "%%a" -vcodec copy -acodec copy -y "%%~na_conv.m2t"

there must be some easy trick to make this BATCH thing wotk. Please help.